代码语言:javascript复制
void CCommonModel::AppendPoly( const AcDbObjectIdArray& objArray,AcDbPolyline *pPolyNew )
{
AcDbObjectIdArray objIdArray = objArray;
std::multimap<AcGePoint3d,int> mapPoints; // AcGePoint3d不能排序,要重载符号“<”;
std::multimap<AcGePoint3d,int>::iterator ite1;
std::multimap<AcGePoint3d,int>::iterator ite2;
for (int i = 0; i < objIdArray.length(); i )
{
AcDbObjectId objId;
objId = objIdArray.at(i);
AcGePoint3d ptStart;
AcGePoint3d ptEnd;
AcDbObjectPointer<AcDbPolyline> pPoly(objId,AcDb::kForRead);
pPoly->getStartPoint(ptStart);
pPoly->getEndPoint(ptEnd);
if (i == 0)
{
mapPoints.insert(std::make_pair(ptStart,1));
mapPoints.insert(std::make_pair(ptEnd,1));
}
else
{
ite1 = mapPoints.find(ptStart);
ite2 = mapPoints.find(ptEnd);
if (ite1 != mapPoints.end())
{
(ite1->second) ;
}
else
{
mapPoints.insert(std::make_