Recently a developer asked this question and here is the code snippet. The code snippet can be modified to fetch entities based on any such criteria. The “acedssget” method can take filter in the form a result buffer. It can be formed using the “acutBuildList” method, but I havent used it in this code snippet since the layers that are unlocked are not known until we iterate the Layer table. Instead, the result buffer is created node by node based on the number of unlocked layer that we find.
resbuf* pLineResbuf;
resbuf* pIter = 0;
wchar_t szLineBuff[] = L"LINE";
pLineResbuf = acutNewRb(0);
pIter = pLineResbuf;
pIter->resval.rstring = new wchar_t[wcslen(szLineBuff) + 1];
wcscpy(pIter->resval.rstring, szLineBuff);
wchar_t szConditionBuff1[] = L"";
pIter->rbnext = acutNewRb(-4);
pIter = pIter->rbnext;
pIter->resval.rstring = new wchar_t[wcslen(szConditionBuff2) + 1];
wcscpy(pIter->resval.rstring, szConditionBuff2);
ads_name selectset;
acedSSGet(L"_X", NULL, NULL, pLineResbuf, selectset);
long length=0;
acedSSLength (selectset, &length);
acutPrintf(L"nNumber of Entities: %d", length);
for (int idx=0; idxisA()->name());
}
acedSSFree(selectset);
acutRelRb(pLineResbuf);

Leave a Reply