|
AcDb2dPolyline *p2dPl=(AcDb2dPolyline*)pCurve;
////节点处理
AcDb2dVertex *p2dVertex;
Acad::ErrorStatus es;
AcDbObjectIterator *pIter;
pIter=p2dPl->vertexIterator();
AcDbObjectId verId,newVerId;
int i=0;
for(i=0,pIter->start();!pIter->done()&&i<index;pIter->step(),i++)
{
verId=pIter->objectId();
}
///get width
if(acdbOpenObject(p2dVertex,verId,AcDb::kForRead)==Acad::eOk)
{
startWidth=p2dVertex->startWidth();
endWidth=p2dVertex->endWidth();
p2dVertex->close();
}
else
startWidth=endWidth=0.0;
///get width over!
if(index==0)
verId=AcDbObjectId::kNull;
for(i=0;i<PntArray.length();i++)
{
p2dVertex=new AcDb2dVertex(PntArray.at(i));
p2dVertex->setStartWidth(startWidth);
p2dVertex->setEndWidth(endWidth);
es=p2dPl->insertVertexAt(newVerId,verId,p2dVertex);
if(es!=Acad::eOk)
{
///close the open curve
p2dPl->close();
delete p2dVertex;
return !retbool;
}
///Close the vertex:
p2dVertex->close();
verId=newVerId;
}
////close the open curve
delete pIter;
p2dPl->close(); |
|