admin 发表于 2024-3-14 19:40:25

[每日一码] 事物处理中亮显AcDb2dPolyline的顶点

AcTransaction::getObject().

Here's a snippet to illustrate:


//pPline points to an AcDb2dPolyline open for Read.
AcDbObjectIterator *pVertIter= pPline->vertexIterator();
AcDbObjectId vertexObjId;
//start a transaction
AcTransaction *pTrans = actrTransactionManager->startTransaction();
assert(pTrans != NULL);

//iterate through the oldstyle pline
//highlight each segment as you go
//numVerts == number of vertices in polyline
for (int vertexNumber = 0;vertexNumber < numVerts - 1;
   vertexNumber++, pVertIter->step())
   {
         vertexObjId = pVertIter->objectId();
         ads采用name ename;
         acdbGetAdsName(ename, vertexObjId);

         ads采用redraw(ename, 3);
         //pause for user to see the effect
         ads采用getstring(0, "\nPress return to continue: ", dummy);
         //always balance ads采用redraw highlight calls in R14
         ads采用redraw(ename, 4);
   }
actrTransactionManager->endTransaction();
delete pVertIter;
页: [1]
查看完整版本: [每日一码] 事物处理中亮显AcDb2dPolyline的顶点