c735023723 发表于 2012-7-13 17:28:57

BDYCAD 发表于 2011-8-11 14:37 static/image/common/back.gif
ads_name Ename;
ads_point p1;
AcGePoint3d Spt,Ept;


怎么选择开始点和结束点之外的别的点呢啊?

BDYCAD 发表于 2012-7-15 07:33:39

ads_real Dist;
ads_name Ename;
ads_point p1;
AcGePoint3d Spt,Ept,Mpt;
AcGePoint3dArray PtList;
AcDbObjectId ObjID;
AcDbCurve *pCur;
if (acedEntSel(_T("\n选线:"),Ename,p1)!=RTNORM)return;
acdbGetObjectId(ObjID,Ename);
if (acdbOpenObject(pCur,ObjID,AcDb::kForWrite)!=Acad::eOk)return;
pCur->getStartPoint(Spt);//取出对象起点
pCur->getEndPoint(Ept);//取出对象终点
pCur->getDistAtPoint(Ept,Dist);
pCur->getPointAtDist(Dist*0.5,Mpt);//对象中点
pCur->getStretchPoints(PtList);//对象所有节点
pCur->close();
页: 1 [2]
查看完整版本: 获取多段线起始点和结束点