private:
static AcDbObjectIdArray secectScreen()
{
ads_name ssname;
AcDbObjectIdArray idsSelected = NULL;
if (acedSSGet(NULL,NULL,NULL,NULL,ssname) != RTNORM)
{
acedSSFree(ssname);
return NULL;
}
long nSelectedLength;
ads_name sent;
acedSSLength(ssname,&nSelectedLength);
AcDbObjectId idTemp;
for (int i = 0; i < nSelectedLength; i++)
{
acedSSName(ssname,i,sent);
acdbGetObjectId(idTemp,sent);
idsSelected.append(idTemp);
}
acedSSFree(ssname);
return idsSelected;
}
另外还需要将命令的执行方式加上ACRX_CMD_USEPICKSET。如下
ACED_ARXCOMMAND_ENTRY_AUTO(CYBD_LayerContrlApp, PengYBD_LayerContrl, _YBD_DJTC, YBD_DJTC, ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, NULL)
原文:http://www.cnblogs.com/ARX2008/p/4375141.html