- 积分
- 23696
- 明经币
- 个
- 注册时间
- 2003-7-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
直线和多线段不能求交点,错误如下图,请问如何解决?- AcDbObject *pObj;
- AcDbObject *pObj1;
- AcDbObjectId eId;
- AcDb2dPolyline *pPline;
- AcDbLine *pLine;
- AcGePoint3dArray point;//交点坐标
- AcGePlane pj;//投影面
- ads_point pt1;
- ads_name ent,ent1;
- Acad::ErrorStatus es = Acad::eOk ; acedEntSel("\n选择多线段:",ent,pt1);
- acedEntSel("\n选择直线:",ent1,pt1);
- acdbGetObjectId(eId,ent);
- acdbOpenObject(pObj,eId, AcDb::kForRead);
- if(pObj->isKindOf(AcDbPolyline::desc()))
- {
- pObj->close ();
- acdbOpenObject(pPline,eId,AcDb::kForRead); acdbGetObjectId(eId,ent1);
- acdbOpenObject(pObj1,eId, AcDb::kForRead);
- if(pObj1->isKindOf(AcDbLine::desc()))
- {
- acdbOpenObject(pLine,eId,AcDb::kForRead);//得到实体直线
- //延伸求交点坐标
- if((es = pLine->intersectWith(pPline,AcDb::kExtendThis,pj,point)) == Acad::eOk)
- {
- //......
- }
- pLine->close();
- }
- pObj1->close();
- pPline->close();
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|