summaryrefslogtreecommitdiffstats
path: root/Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp
blob: c46fd0ac259c481bc136012409d7a5ccbebe2868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
// (C) Copyright 2002-2007 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
//#include "axlock.h"
//-----------------------------------------------------------------------------
#define szRDS _RXST("CGCAD_sei")

//Prototypes
void createNewLayer();
void createFloor(ads_real,ads_real,ads_real);
void createRoof(ads_real ,ads_real, ads_real, ads_real);

//Constants
#define LAYERNAME _T("HAUS10LAYER")
#define WINDOW_HEIGHT 90
#define WINDOWS_WIDTH 90

//Global variables
ads_point base_point = {0.0, 0.0, 0.0};

//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CPrakt1App : public AcRxArxApp {

public:
	CPrakt1App () : AcRxArxApp () {}

	virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
		// TODO: Load dependencies here

		// You *must* call On_kInitAppMsg here
		AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
		
		// TODO: Add your initialization code here

		return (retCode) ;
	}

	virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
		// TODO: Add your code here

		// You *must* call On_kUnloadAppMsg here
		AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;

		// TODO: Unload dependencies here

		return (retCode) ;
	}

	virtual void RegisterServerComponents () {
	}

public:

	// - CGCAD_seiPrakt1.house10 command (do not rename)
	static void CGCAD_seiPrakt1house10(void)
	{
		createNewLayer();

		// Add your code for command CGCAD_seiPrakt1.house10 here
		acutPrintf(_T("\nHaus 10 App. by SEi!"));
		ads_point dlgPoint = {0.0,0.0,0.0};

		if (RTNORM != acedGetPoint(dlgPoint,_T("\nEnter BasePoint for House"),base_point)) {
			acutPrintf(_T("\nError reading base point for house"));
			return;
		}
		acutPrintf(_T("\nYou entered %d, %d, %d as base point for house")
			,base_point[0],base_point[1],base_point[2] );
		
		ads_real house_length;
		if (RTNORM != acedGetReal(_T("\nLength: "),&house_length)) {
			acutPrintf(_T("\nError reading length"));
			return;
		}
		
		ads_real house_width;
		if (RTNORM != acedGetReal(_T("\nWidth: "),&house_width)) {
			acutPrintf(_T("\nError reading width"));
			return;
		}

		ads_real house_height;
		if (RTNORM != acedGetReal(_T("\nHeight: "),&house_height)) {
			acutPrintf(_T("\nError reading heigth"));
			return;
		}

		ads_real house_roof_height;
		if (RTNORM != acedGetReal(_T("\nRoof Height: "),&house_roof_height)) {
			acutPrintf(_T("\nError reading roof heigth"));
			return;
		}
		
		createFloor(house_length,house_width,house_height);
		createRoof(house_length,house_width,house_height,house_roof_height);

		acedCommand(RTSTR, _T("_zoom"), RTSTR, _T("a"),RTSTR,PAUSE,0);
	}
} ;

void
createNewLayer()
{
	//AcAxDocLock docLock;
    AcDbLayerTable *pLayerTable = NULL;
	AcDbDatabase *pDB = NULL;
    pDB = acdbHostApplicationServices()->workingDatabase();
	
	Acad::ErrorStatus res = pDB->getSymbolTable(pLayerTable, AcDb::kForWrite);

	if (Acad::eOk != res) {
		acutPrintf(_T("\nError opening layer table: %d"),res);
		return;
	}

    AcDbLayerTableRecord *pLayerTableRecord =
        new AcDbLayerTableRecord;

	pLayerTableRecord->setName(LAYERNAME);
	AcCmColor layerColor;
	layerColor.setRGB(255,255,255);
	pLayerTableRecord->setColor(layerColor);

    // Defaults are used for other properties of 
    // the layer if they are not otherwise specified.
    //
	if ( Acad::eOk != pLayerTable->add(pLayerTableRecord) ) {
		acutPrintf(_T("\nError add Layer"));
		return;
	}
    if ( Acad::eOk != pLayerTable->close() ) {
		acutPrintf(_T("\nError close Layer table"));
		return;
	}
    if ( Acad::eOk != pLayerTableRecord->close() ) {
		acutPrintf(_T("\nError close Layer table record"));
		return;
	}
}
void
createFloor(ads_real length,ads_real width, ads_real height) {
		// floor
		AcGePoint3d floor1_point1(base_point[0], base_point[1], base_point[2]);
		AcGePoint3d floor1_point2(base_point[0]+length, base_point[1],base_point[2]);
		AcGePoint3d floor1_point3(base_point[0], base_point[1]+width, base_point[2]);
		AcDbFace* floor1 = new AcDbFace(floor1_point1,floor1_point2,floor1_point3,false,false,false,false);
		floor1->setLayer(LAYERNAME);
		AcGePoint3d floor2_point1(base_point[0], base_point[1]+width, base_point[2]);
		AcGePoint3d floor2_point2(base_point[0]+length, base_point[1]+width, base_point[2]);
		AcGePoint3d floor2_point3(base_point[0]+length, base_point[1], base_point[2]);
		AcDbFace* floor2 = new AcDbFace(floor2_point1,floor2_point2,floor2_point3,false,false,false,false);
		floor2->setLayer(LAYERNAME);
		
		//ceiling
		AcGePoint3d ceiling1_point1(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d ceiling1_point2(base_point[0]+length, base_point[1]+width, base_point[2]+height);
		AcGePoint3d ceiling1_point3(base_point[0], base_point[1]+width, base_point[2]+height);
		AcDbFace* ceiling1 = new AcDbFace(ceiling1_point1,ceiling1_point2,ceiling1_point3,false,false,false,false);
		ceiling1->setLayer(LAYERNAME);
		AcGePoint3d ceiling2_point1(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d ceiling2_point2(base_point[0]+length, base_point[1]+width, base_point[2]+height);
		AcGePoint3d ceiling2_point3(base_point[0]+length, base_point[1], base_point[2]+height);
		AcDbFace* ceiling2 = new AcDbFace(ceiling2_point1,ceiling2_point2,ceiling2_point3,false,false,false,false);
		ceiling2->setLayer(LAYERNAME);

		//front wall
		AcGePoint3d front1_point1(base_point[0], base_point[1], base_point[2]);
		AcGePoint3d front1_point2(base_point[0], base_point[1], base_point[2]+height);
		AcGePoint3d front1_point3(base_point[0]+length, base_point[1], base_point[2]);
		AcDbFace* front1 = new AcDbFace(front1_point1,front1_point2,front1_point3,false,false,false,false);
		front1->setLayer(LAYERNAME);
		AcGePoint3d front2_point1(base_point[0], base_point[1], base_point[2]+height);
		AcGePoint3d front2_point2(base_point[0]+length, base_point[1], base_point[2]+height);
		AcGePoint3d front2_point3(base_point[0]+length, base_point[1], base_point[2]);
		AcDbFace* front2 = new AcDbFace(front2_point1,front2_point2,front2_point3,false,false,false,false);
		front2->setLayer(LAYERNAME);

		//rear wall
		AcGePoint3d rear1_point1(base_point[0], base_point[1]+width, base_point[2]);
		AcGePoint3d rear1_point2(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d rear1_point3(base_point[0]+length, base_point[1]+width, base_point[2]);
		AcDbFace* rear1 = new AcDbFace(rear1_point1,rear1_point2,rear1_point3,false,false,false,false);
		rear1->setLayer(LAYERNAME);
		AcGePoint3d rear2_point1(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d rear2_point2(base_point[0]+length, base_point[1]+width, base_point[2]+height);
		AcGePoint3d rear2_point3(base_point[0]+length, base_point[1]+width, base_point[2]);
		AcDbFace* rear2 = new AcDbFace(rear2_point1,rear2_point2,rear2_point3,false,false,false,false);
		rear2->setLayer(LAYERNAME);

		ads_real window_lower = base_point[2]+( (height/2)-(WINDOW_HEIGHT/2) );
		ads_real window_upper = base_point[2]+( (height/2)+(WINDOW_HEIGHT/2) );
		ads_real window_near = base_point[1]+( (width/2)-(WINDOWS_WIDTH/2) );
		ads_real window_far = base_point[1]+( (width/2)+(WINDOWS_WIDTH/2) );
		//right wall
		AcGePoint3d right1_point1(base_point[0]+length, base_point[1], base_point[2]);
		AcGePoint3d right1_point2(base_point[0]+length, base_point[1]+width, base_point[2]);
		AcGePoint3d right1_point3(base_point[0]+length, window_far, window_lower);
		AcGePoint3d right1_point4(base_point[0]+length, window_near, window_lower);
		AcDbFace* right1 = new AcDbFace(
			right1_point1,right1_point2,right1_point3,right1_point4
			,false,false,false,false);
		right1->setLayer(LAYERNAME);
		AcGePoint3d right2_point1(base_point[0]+length, base_point[1], base_point[2]);
		AcGePoint3d right2_point2(base_point[0]+length, base_point[1], base_point[2]+height);
		AcGePoint3d right2_point3(base_point[0]+length, window_near, window_upper);
		AcGePoint3d right2_point4(base_point[0]+length, window_near, window_lower);
		AcDbFace* right2 = new AcDbFace(
			right2_point1,right2_point2,right2_point3,right2_point4
			,false,false,false,false);
		right2->setLayer(LAYERNAME);
		AcGePoint3d right3_point1(base_point[0]+length, base_point[1], base_point[2]+height);
		AcGePoint3d right3_point2(base_point[0]+length, base_point[1]+width, base_point[2]+height);
		AcGePoint3d right3_point3(base_point[0]+length, window_far, window_upper);
		AcGePoint3d right3_point4(base_point[0]+length, window_near, window_upper);
		AcDbFace* right3 = new AcDbFace(
			right3_point1,right3_point2,right3_point3,right3_point4
			,false,false,false,false);
		right3->setLayer(LAYERNAME);
		AcGePoint3d right4_point1(base_point[0]+length, base_point[1]+width, base_point[2]+height);
		AcGePoint3d right4_point2(base_point[0]+length, base_point[1]+width, base_point[2]);
		AcGePoint3d right4_point3(base_point[0]+length, window_far, window_lower);
		AcGePoint3d right4_point4(base_point[0]+length, window_far, window_upper);
		AcDbFace* right4 = new AcDbFace(
			right4_point1,right4_point2,right4_point3,right4_point4
			,false,false,false,false);
		right4->setLayer(LAYERNAME);

		//left wall
		AcGePoint3d left1_point1(base_point[0], base_point[1], base_point[2]);
		AcGePoint3d left1_point2(base_point[0], base_point[1]+width, base_point[2]);
		AcGePoint3d left1_point3(base_point[0], window_far, window_lower);
		AcGePoint3d left1_point4(base_point[0], window_near, window_lower);
		AcDbFace* left1 = new AcDbFace(
			left1_point1,left1_point2,left1_point3,left1_point4
			,false,false,false,false);
		left1->setLayer(LAYERNAME);
		AcGePoint3d left2_point1(base_point[0], base_point[1], base_point[2]);
		AcGePoint3d left2_point2(base_point[0], base_point[1], base_point[2]+height);
		AcGePoint3d left2_point3(base_point[0], window_near, window_upper);
		AcGePoint3d left2_point4(base_point[0], window_near, window_lower);
		AcDbFace* left2 = new AcDbFace(
			left2_point1,left2_point2,left2_point3,left2_point4
			,false,false,false,false);
		left2->setLayer(LAYERNAME);
		AcGePoint3d left3_point1(base_point[0], base_point[1], base_point[2]+height);
		AcGePoint3d left3_point2(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d left3_point3(base_point[0], window_far, window_upper);
		AcGePoint3d left3_point4(base_point[0], window_near, window_upper);
		AcDbFace* left3 = new AcDbFace(
			left3_point1,left3_point2,left3_point3,left3_point4
			,false,false,false,false);
		left3->setLayer(LAYERNAME);
		AcGePoint3d left4_point1(base_point[0], base_point[1]+width, base_point[2]+height);
		AcGePoint3d left4_point2(base_point[0], base_point[1]+width, base_point[2]);
		AcGePoint3d left4_point3(base_point[0], window_far, window_lower);
		AcGePoint3d left4_point4(base_point[0], window_far, window_upper);
		AcDbFace* left4 = new AcDbFace(
			left4_point1,left4_point2,left4_point3,left4_point4
			,false,false,false,false);
		left4->setLayer(LAYERNAME);

		// Now we need to open the appropriate container which is inside BlockTable
		AcDbBlockTable *pBlockTable = NULL;

		// Get the current Database
		AcDbDatabase* pDB = acdbHostApplicationServices()->workingDatabase();

		if (Acad::eOk != pDB->getSymbolTable(pBlockTable, AcDb::kForRead)) {
			acutPrintf(_T("\nError getting block table"));
			return;
		}
		// Inside BlockTable, open the ModelSpace
		AcDbBlockTableRecord* pBlockTableRecord = NULL;
		pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);

		// After get ModelSpace we can close the BlockTable
		pBlockTable->close();

		// Using ModelSpace pointer we can add our brand new line
		AcDbObjectId floor1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(floor1Id, floor1);
		AcDbObjectId floor2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(floor2Id, floor2);

		AcDbObjectId ceiling1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(ceiling1Id, ceiling1);
		AcDbObjectId ceiling2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(ceiling2Id, ceiling2);

		AcDbObjectId front1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(front1Id, front1);
		AcDbObjectId front2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(front2Id, front2);

		AcDbObjectId rear1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(rear1Id, rear1);
		AcDbObjectId rear2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(rear2Id, rear2);

		AcDbObjectId right1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(right1Id, right1);
		AcDbObjectId right2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(right2Id, right2);
		AcDbObjectId right3Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(right3Id, right3);
		AcDbObjectId right4Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(right4Id, right4);

		AcDbObjectId left1Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(left1Id, left1);
		AcDbObjectId left2Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(left2Id, left2);
		AcDbObjectId left3Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(left3Id, left3);
		AcDbObjectId left4Id = AcDbObjectId::kNull;
		pBlockTableRecord->appendAcDbEntity(left4Id, left4);

		// To finish the process we need to close ModelSpace and the entity
		pBlockTableRecord->close();
		floor1->close();
		floor2->close();
		ceiling1->close();
		ceiling2->close();
		front1->close();
		front2->close();
		rear1->close();
		rear2->close();
		right1->close();
		right2->close();
		right3->close();
		right4->close();
		left1->close();
		left2->close();
		left3->close();
		left4->close();
}
void
createRoof(ads_real length,ads_real width, ads_real level,ads_real roofHeight) {
	// Now we need to open the appropriate container which is inside BlockTable
	AcDbBlockTable *pBlockTable = NULL;

	// Get the current Database
	AcDbDatabase* pDB = acdbHostApplicationServices()->workingDatabase();

	if (Acad::eOk != pDB->getSymbolTable(pBlockTable, AcDb::kForRead)) {
		acutPrintf(_T("\nError getting block table"));
		return;
	}
	// Inside BlockTable, open the ModelSpace
	AcDbBlockTableRecord* pBlockTableRecord = NULL;
	pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);

	// After get ModelSpace we can close the BlockTable
	pBlockTable->close();
	// front
	AcGePoint3d rooffront1_point1(base_point[0], base_point[1], base_point[2]+level);
	AcGePoint3d rooffront1_point2(base_point[0]+length/2, base_point[1], base_point[2]+level);
	AcGePoint3d rooffront1_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* rooffront1 = new AcDbFace(rooffront1_point1,rooffront1_point2,rooffront1_point3,false,false,false,false);
	rooffront1->setLayer(LAYERNAME);
	AcDbObjectId rooffront1Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(rooffront1Id, rooffront1);

	AcGePoint3d rooffront2_point1(base_point[0]+length/2, base_point[1], base_point[2]+level);
	AcGePoint3d rooffront2_point2(base_point[0]+length, base_point[1], base_point[2]+level);
	AcGePoint3d rooffront2_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* rooffront2 = new AcDbFace(rooffront2_point1,rooffront2_point2,rooffront2_point3,false,false,false,false);
	rooffront2->setLayer(LAYERNAME);
	AcDbObjectId rooffront2Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(rooffront2Id, rooffront2);
	// rear
	AcGePoint3d roofrear1_point1(base_point[0], base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofrear1_point2(base_point[0]+length/2, base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofrear1_point3(base_point[0]+length/2, base_point[1]+width, base_point[2]+level+roofHeight);
	AcDbFace* roofrear1 = new AcDbFace(roofrear1_point1,roofrear1_point2,roofrear1_point3,false,false,false,false);
	roofrear1->setLayer(LAYERNAME);
	AcDbObjectId roofrear1Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofrear1Id, roofrear1);

	AcGePoint3d roofrear2_point1(base_point[0]+length/2, base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofrear2_point2(base_point[0]+length, base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofrear2_point3(base_point[0]+length/2, base_point[1]+width, base_point[2]+level+roofHeight);
	AcDbFace* roofrear2 = new AcDbFace(roofrear2_point1,roofrear2_point2,roofrear2_point3,false,false,false,false);
	roofrear2->setLayer(LAYERNAME);
	AcDbObjectId roofrear2Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofrear2Id, roofrear2);
	// left
	AcGePoint3d roofleft1_point1(base_point[0], base_point[1], base_point[2]+level);
	AcGePoint3d roofleft1_point2(base_point[0], base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofleft1_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* roofleft1 = new AcDbFace(roofleft1_point1,roofleft1_point2,roofleft1_point3,false,false,false,false);
	roofleft1->setColorIndex(10);
	roofleft1->setLayer(LAYERNAME);
	AcDbObjectId roofleft1Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofleft1Id, roofleft1);

	AcGePoint3d roofleft2_point1(base_point[0], base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofleft2_point2(base_point[0]+length/2, base_point[1]+width, base_point[2]+level+roofHeight);
	AcGePoint3d roofleft2_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* roofleft2 = new AcDbFace(roofleft2_point1,roofleft2_point2,roofleft2_point3,false,false,false,false);
	roofleft2->setLayer(LAYERNAME);
	roofleft2->setColorIndex(10);
	AcDbObjectId roofleft2Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofleft2Id, roofleft2);
	// right
	AcGePoint3d roofright1_point1(base_point[0]+length, base_point[1], base_point[2]+level);
	AcGePoint3d roofright1_point2(base_point[0]+length, base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofright1_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* roofright1 = new AcDbFace(roofright1_point1,roofright1_point2,roofright1_point3,false,false,false,false);
	roofright1->setColorIndex(10);
	roofright1->setLayer(LAYERNAME);
	AcDbObjectId roofright1Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofright1Id, roofright1);

	AcGePoint3d roofright2_point1(base_point[0]+length, base_point[1]+width, base_point[2]+level);
	AcGePoint3d roofright2_point2(base_point[0]+length/2, base_point[1]+width, base_point[2]+level+roofHeight);
	AcGePoint3d roofright2_point3(base_point[0]+length/2, base_point[1], base_point[2]+level+roofHeight);
	AcDbFace* roofright2 = new AcDbFace(roofright2_point1,roofright2_point2,roofright2_point3,false,false,false,false);
	roofright2->setLayer(LAYERNAME);
	roofright2->setColorIndex(10);
	AcDbObjectId roofright2Id = AcDbObjectId::kNull;
	pBlockTableRecord->appendAcDbEntity(roofright2Id, roofright2);
	// To finish the process we need to close ModelSpace and the entity
	pBlockTableRecord->close();
	roofleft1->close();
	roofleft2->close();
	roofright1->close();
	roofright2->close();
	rooffront1->close();
	rooffront2->close();
	roofrear1->close();
	roofrear2->close();
}
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CPrakt1App)

ACED_ARXCOMMAND_ENTRY_AUTO(CPrakt1App, CGCAD_seiPrakt1, house10, haus10, ACRX_CMD_MODAL, NULL)