我想通过编程实现下述功能:
编程画了一条直线:
AcGePoint3d startPt,endPt;
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pBlockRecord;
pBlockTable->getAt(ACDB_MODOAL_SPACE,pBlockRecord,AcDb::kForWrite);
pBlockTable->close();
startPt.set(100.0,100.0,0);
endPt.set(200.0,100.0,0);
AcDbLine *pLine;
pLine=new AcDbLine(startpt,endPt);
AcDbObjectId id;
pBlockRecord->appendAcDbEntity(id,pLine);
pLine->close();
上面直线画好了。现在我已知这条直线上的两点Pt1,Pt2:
AcGePoint3d Pt1(120.0,100.0,0),Pt2(160.0,100.0,0);
我请教如何通过编程在Pt1和Pt2点打断这条直线并删除Pt1和Pt2两点之间部分,保留其余部分。
这个功能用acedCommand()函数利用AutoCAD本身带的break命令能实现吗?如何实现?
请赐教一段程序,不胜感激!! |