调用绘线命令,并把绘的线的线型改成虚线.
C++开发|大少爷|2017-07-27 16:14
-
回答:
acDocManager->sendStringToExecute(MxDraw::GetDatabase(MxDraw::GetCurOcxHandle())->GetDocument(), _T("Mx_Line"),true,false,true,0,true ); // 得到Mx_Line调用后,绘制的直线id. McDbObjectIdArray aryId; Mx::mcdbEntitysLastCmd(aryId); if(aryId.isEmpty()) return; // 得到虚线的id. McDbObjectId lineTypeId = MrxDbgUtils::getSymbolTableRecordId<McDbLinetypeTableRecord>(_T("DASHED"),acdbCurDwg()); // 修改绘的直线线型。 for(int i = 0; i < aryId.length();i++) { McDbObjectPointer<McDbCurve> spCurve(aryId[i],McDb::kForWrite); if(spCurve.openStatus() != Mcad::eOk) continue; spCurve->setLinetype(lineTypeId); }