Ribbon Customization-Can't find commands

Ribbon Customization-Can't find commands

Anonymous
Not applicable
3,919 Views
3 Replies
Message 1 of 4

Ribbon Customization-Can't find commands

Anonymous
Not applicable

I am trying to add a Ribbon Panel with commands from a .Net AutoCAD extension and I cannot find the commands in the command list area of the Customize User Interface Dialog.

I have loaded the extension using the netload command and the custom commands appear at the command line.

 

Where do I need to look to find these commands?

 

Thanks

0 Likes
3,920 Views
3 Replies
Replies (3)
Message 2 of 4

dgorsman
Consultant
Consultant

Unless the DLL adds the command references to the CUIx, you need to add them yourself.  As the phrase suggests the CUIx contains command references which define which AutoCAD command to call when the tool is clicked.  It doesn't define or contain the commands themselves.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 3 of 4

Balaji_Ram
Alumni
Alumni

Hi,

 

As "dgorsman" mentioned, you will need the CUI API to do this.

Here is a code snippet :

 

// AcCui.dll
using Autodesk.AutoCAD.Customization; 

[CommandMethod("MYTESTCOMMAND")]
public void MyTestCommandMethod()
{
    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
    ed.WriteMessage("MyTestCommand");
}

[CommandMethod("CreateCommand")]
public void CreateCommandMethod()
{
    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

    String mainCuiFile = String.Format("{0}.cuix", Application.GetSystemVariable("MENUNAME"));

    CustomizationSection cs = new CustomizationSection(mainCuiFile);

    MacroGroup macGroup = cs.MenuGroup.MacroGroups[0];

    MenuMacro menuMac;

    menuMac = macGroup.CreateMenuMacro("MYTESTCOMMAND", "^C^C_MYTESTCOMMAND ", "MYTESTCOMMAND", "My custom command", MacroType.Any, "RCDATA_16_LINE", "RCDATA_32_LINE", "ID_MYTESTCOMMAND");

    menuMac.ElementID = "ID_MYTESTCOMMAND";
    menuMac.macro.CLICommand = "MYTESTCOMMAND";

    cs.Save();
}

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 4 of 4

Anonymous
Not applicable

I had one of those "Duh" moments. after reading your reply.  I can't find the commands for my extension because I have to create them. I appreciate all of the replies.

 

Thanks, all

 

Toren

0 Likes