Iterating through the ARX-registered commands

By Balaji Ramamoorthy

This can achieved by using AcEdCommandIterator to iterate through all the AcEd-registered commands.

Here is a sample code fragment :

ACHAR cmdLocalName[133];   
ACHAR cmdGlobalName[133];   
ACHAR cmdGroupName[133];
 
AcEdCommandIterator *pCmdItr = acedRegCmds->iterator();
if(NULL == pCmdItr)  
    return;
 
for(;! pCmdItr->done(); pCmdItr->next())
{        
    wcscpy(cmdGlobalName, pCmdItr->command()->globalName()); 
    wcscpy(cmdLocalName, pCmdItr->command()->localName()); 
    wcscpy(cmdGroupName, pCmdItr->commandGroup());  
    acutPrintf
    (
        ACRX_T("n    Group name = %s, Local name = %s, Global name = %s"), 
        cmdGroupName, 
        cmdLocalName, 
        cmdGlobalName
    ); 
}
delete pCmdItr;

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading