你可以程序中增加这个子函数 Acad::ErrorStatus addToModelSpace(AcDbObjectId &objId, AcDbEntity* pEntity) { AcDbBlockTable *pBlockTable; AcDbBlockTableRecord *pSpaceRecord; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead); pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite); pSpaceRecord->appendAcDbEntity(objId, pEntity); pBlockTable->close(); pEntity->close(); pSpaceRecord->close(); return Acad::eOk; } 然后用这个函数把你偏移后的对象添加到图纸空间中去 Pline->getOffsetCurves(wide , offsetCurves); AcDbObjectId ofsID; addToModelSpace(ofsID, (AcDbEntity*)offsetCurves[0]);
|