arx 怎么得到当前的选择集

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)

 

转载于:https://www.cnblogs.com/happy123/archive/2012/11/12/2765836.html

你可能感兴趣的:(arx 怎么得到当前的选择集)