简单的写一下.取其中一个面的四点,厚度取四点以外的点到这个平面距离 AcDbObjectId AddEntity(AcDbEntity * pEnt) { AcDbBlockTable *pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead); assert(pBlockTable); AcDbBlockTableRecord *pBlockTableRecord = NULL; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); assert(pBlockTableRecord); pBlockTable->close(); AcDbObjectId lineId; pBlockTableRecord->appendAcDbEntity(lineId, pEnt); pBlockTableRecord->close(); return lineId; } void test() { AcGePoint3d pt1(0,0,0); AcGePoint3d pt2(100,0,0); AcGePoint3d pt3(0,100,0); AcGePoint3d pt4(100,100,0); AcDbSolid *sold = new AcDbSolid(pt1,pt2,pt3,pt4); sold->setThickness(100); AddEntity(sold); sold->close(); } |