acedssget F 方式

ads_point p1;
ads_point p2;
acedGetPoint(NULL, _T("\n插入第一点"), p1);
acedGetPoint(p1, _T("\n插入第二点"), p2);
//通过亮点来获取选中实体
ads_name ssName;
resbuf *pRb = acutBuildList(RTPOINT, p1, RTPOINT, p2, 0);
acedSSGet(_T("F"),pRb, NULL, NULL, ssName);
acutRelRb(pRb);
//遍历选择集
long len = 0;
acedSSLength(ssName, &len);

for (long index = 0; index < len;index++)
{
ads_name ent;
AcDbObjectId pId;
acedSSName(ssName, index, ent);

acdbGetObjectId(pId, ent);
if (!pId.isValid())
{
continue;
}
pidArr.append(pId);
}
acedSSFree(ssName);

posted @ 2016-06-22 09:25  xzh1993  阅读(372)  评论(0编辑  收藏  举报