|
用acdbGetAdsName获得图元名,用acedSSAdd加入到选择集,用acedSSSetFirst亮显并选择
- static void mydraw采用ddd(void)
- {
- // Add your code for command mydraw.采用ddd here
- ads采用point pt1,pt2;
- if( acedGetPoint(NULL,采用T("\nPlease Enter start point: "),pt1) != RTNORM
- || acedGetPoint(pt1,采用T("\nPlease Enter end point: "),pt2)!= RTNORM)
- return;
- AcGePoint3d p1,p2;
- p1 = asPnt3d(pt1);
- p2 = asPnt3d(pt2);
-
- //创建一条直线并返回其ID
- AcDbObjectId lineId = CreateLine(p1,p2);
- //获得其图元名
- ads采用name ent;
- acdbGetAdsName(ent,lineId);
- //加入到一个空的选择集
- ads采用name sel;
- acedSSAdd(ent,NULL,sel);
-
- //创建一个圆,并得到其ID
- AcDbObjectId CircleId = CreateCircle(p1,p2);
- //获得其图元名,并加入到先前的选择集
- acdbGetAdsName(ent,CircleId);
- acedSSAdd(ent,sel,sel);
-
- //亮显
- acedSSSetFirst(sel,sel);
- return;
- }
复制代码 |
|