我想把一个圆沿一跟直线拉生成圆柱,用extrude可以实现,但是用extrudeAlongPath这个函数却出现问题?这是怎么回事?大家帮忙看看,先谢谢大家。
AcDbBlockTable *pThisBlockTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pThisBlockTable, AcDb::kForWrite); AcDbBlockTableRecord *pOtherBtr; pThisBlockTable->getAt(ACDB_MODEL_SPACE,pOtherBtr,AcDb::kForWrite); pThisBlockTable->close();
AcDbCircle *OCircle = new AcDbCircle(AcGePoint3d(0,0,0),AcGeVector3d(1,0,0),80); AcDbLine *line = new AcDbLine(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0)); AcDb3dSolid *OSolid = new AcDb3dSolid(); AcDbObjectId OSolidId,liId;
pOtherBtr->appendAcDbEntity(liId,line); AcDbVoidPtrArray OArr,OgnArr; OArr.append(OCircle); OCircle->close();
int i; if (AcDbRegion::createFromCurves(OArr,OgnArr)!=Acad::eOk) { for (i=0;i<OgnArr.length();i++) delete OgnArr; return; } AcDbRegion *oRegion; oRegion=AcDbRegion::cast((AcRxObject*)OgnArr[0]);
OSolid->extrudeAlongPath(oRegion,line); // OSolid->extrude(oRegion,100,0); pOtherBtr->appendAcDbEntity(OSolidId,OSolid); line->close(); OSolid->close(); pOtherBtr->close(); |