diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp')
| -rw-r--r-- | Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp | 461 |
1 files changed, 461 insertions, 0 deletions
diff --git a/Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp b/Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp new file mode 100644 index 0000000..c46fd0a --- /dev/null +++ b/Master/CGuCAD/projects/Prakt1/Prakt1/acrxEntryPoint.cpp @@ -0,0 +1,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)
|
