.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ribbon Customization-Can't find commands

3 REPLIES 3
Reply
Message 1 of 4
torentrue
3761 Views, 3 Replies

Ribbon Customization-Can't find commands

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

3 REPLIES 3
Message 2 of 4
dgorsman
in reply to: torentrue

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.


Message 3 of 4
Balaji_Ram
in reply to: torentrue

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

Message 4 of 4
torentrue
in reply to: torentrue

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost