最简单的典型用法
ads_name ss = { 0 };
int ret = acedSSGet(NULL, NULL, NULL, NULL, ss);
if (RTNORM == ret)
{
long len = 0;
acedSSLength(ss, &len);
for (long i = 0L; i < len; ++i)
{
ads_name ename = { 0 };
acedSSName(ss, i, ename);
AcDbObjectId id = AcDbObjectId::kNull;
acdbGetObjectId(id, ename);
if (id.isNull())
{
continue;
}
AcDbObjectPointer<AcDbObject> dbobjPtr(id, AcDb::kForRead);
if (Acad::eOk == dbobjPtr.openStatus())
{
//acutPrintf(_T("\n%s"), dbobjPtr->isA()->name());
......
}
}
acedSSFree(ss);
}
过滤器
在图层"ABC"上的圆 或 红色的直线
ads_name ss;
struct resbuf* rbFilter;
rbFilter = acutBuildList(
AcDb::kDxfOperator, _T("<OR"),
AcDb::kDxfOperator, _T("<AND"),
RTDXF0, _T("CIRCLE"),
AcDb::kDxfLayerName, _T("ABC"),
AcDb::kDxfOperator, _T("AND>"),
AcDb::kDxfOperator, _T("<AND"),
RTDXF0, _T("LINE"),
AcDb::kDxfColor, 1,
AcDb::kDxfOperator, _T("AND>"),
AcDb::kDxfOperator, _T("OR>"),
0);
int ret = acedSSGet(NULL, NULL, NULL, rbFilter, ss);
if (RTNORM == ret)
{
......
}
网友评论