Author Topic: Listing all registered commands(.NET acces to the CommandStack)  (Read 2646 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Is there a way in .NET to get access to CommandStack?
I was able to grab them through ObjectARX but was wondering if there was a way in .NET.
Code - C++: [Select]
  1.   AcEdCommandStack* pCmdStack = AcEdCommandStack::cast(acrxSysRegistry()->at(ACRX_COMMAND_DOCK));
  2.   AcEdCommandIterator *pcmdIter = pCmdStack->iterator();
  3.  
  4.   ofstream commandTxtfile (L"C:\\Testing\\commands.txt");
  5.  
  6.   if (commandTxtfile.is_open())
  7.   {  
  8.  
  9.     while (!pcmdIter->done())
  10.     {
  11.    const ACHAR* commandName = pcmdIter->command()->localName();
  12.    acutPrintf(L"\n%s", commandName);  
  13.    wstring ws(commandName);
  14.    commandTxtfile.write((char *)ws.c_str(), ws.length() *sizeof(wchar_t));
  15.    commandTxtfile << "\n";
  16.       pcmdIter->next();
  17.     }
  18.  
  19.    delete pcmdIter;
  20.   }
  21.   commandTxtfile.close();
  22.  

In case you are intrested attached were the registered commands and I am not sure how safe it is to try all them and besides the couple of MYCOMMANDLOCAL , MYDOCUMENTSPREFIX, etc.... that the arxWizard created & all the Lisp commands(prefixed with C:) that are Express Tools commands, I believe the rest are out of the box.
 
« Last Edit: May 29, 2012, 07:32:31 PM by Jeff H »

TheMaster

  • Guest
Re: Listing all registered commands(.NET acces to the CommandStack)
« Reply #1 on: May 30, 2012, 12:21:07 AM »
Is there a way in .NET to get access to CommandStack?
I was able to grab them through ObjectARX but was wondering if there was a way in .NET.
Code - C++: [Select]
  1.   AcEdCommandStack* pCmdStack = AcEdCommandStack::cast(acrxSysRegistry()->at(ACRX_COMMAND_DOCK));
  2.   AcEdCommandIterator *pcmdIter = pCmdStack->iterator();
  3.  
  4.   ofstream commandTxtfile (L"C:\\Testing\\commands.txt");
  5.  
  6.   if (commandTxtfile.is_open())
  7.   {  
  8.  
  9.     while (!pcmdIter->done())
  10.     {
  11.    const ACHAR* commandName = pcmdIter->command()->localName();
  12.    acutPrintf(L"\n%s", commandName);  
  13.    wstring ws(commandName);
  14.    commandTxtfile.write((char *)ws.c_str(), ws.length() *sizeof(wchar_t));
  15.    commandTxtfile << "\n";
  16.       pcmdIter->next();
  17.     }
  18.  
  19.    delete pcmdIter;
  20.   }
  21.   commandTxtfile.close();
  22.  

In case you are intrested attached were the registered commands and I am not sure how safe it is to try all them and besides the couple of MYCOMMANDLOCAL , MYDOCUMENTSPREFIX, etc.... that the arxWizard created & all the Lisp commands(prefixed with C:) that are Express Tools commands, I believe the rest are out of the box.

What do you need a list of all registered commands for?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Listing all registered commands(.NET acces to the CommandStack)
« Reply #2 on: May 30, 2012, 09:18:22 AM »
Have been doing some testing with accoreconsole and creates temporay scripts with a little scriptbuilder and batches drawings but was thinking of adding a little utility for creating common scripts and just as a little aid using the list for the AutoCompleteSource.