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)

 

posted @ 2012-11-12 09:59  游天居士  阅读(571)  评论(0编辑  收藏  举报