ObjectARX 获取指定一个图层中的所有实体

BOOL CTest::getEntityByLayerName( const CString& strLayerName, AcDbObjectIdArray& objIds ) { TCHAR *pValue = new TCHAR[strLayerName.GetLength()+1]; _tcscpy(pValue, strLayerName); resbuf* resTmp = acutNewRb(AcDb::kDxfLayerName); resTmp->resval.rstring = pValue; ads_name name; int nRes = acedSSGet(_T("_X"), NULL, NULL, resTmp, name); acutRelRb(resTmp); if (nRes != RTNORM)   return FALSE; long sslen = 0; if (acedSSLength(name, &sslen) != RTNORM) {   acedSSFree(name);   return FALSE; } int ret; AcDbObjectId objId; for (long i=0L; i

你可能感兴趣的:(ObjectARX 获取指定一个图层中的所有实体)