Customizing item contextual drop down menu

alexisDVJML
Collaborator

Customizing item contextual drop down menu

alexisDVJML
Collaborator
Collaborator

Is is possible to programmatically add items to this contextual menu:

Contextual Menu.png

 

Even if only at the end, this would be EXTREMELY useful 😉

 

Thanks for any tips.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes
Reply
Accepted solutions (1)
778 Views
4 Replies
Replies (4)

geethat
Contributor
Contributor
Accepted solution

[PluginAttribute("HelloWorld_ContextMenu",//Plugin name
"ADSK",//Developer ID or GUID
//The tooltip for the item in the ribbon
ToolTip = "Hello World Plugin in AddIn Tab in Context Menu",
//Display name for the Plugin in the Ribbon
DisplayName = "HelloWorld ContextMenu")]

[AddInPlugin(AddInLocation.CurrentSelectionContextMenu)]
public class HelloWorldContextMenu : AddInPlugin
{
public override int Execute(params string[] parameters)
{
MessageBox.Show("Hello World");

//Can do whatever required.
return 0;
}

}

 

I hope this helps.

 

alexisDVJML
Collaborator
Collaborator

Magnificent,

 

Many Thanks @geethat. Time to play with AddInPlugin CanExecute CommandState content 😀

 

Important Note: this works only for the main window, not for the Saved ViewPoints, which is what I wanted 😢, but great help anyway 👌

 

Here in main pane, my command is there, yeah:

 

alexisDVJML_0-1680713688555.png

 

Here in Saved ViewPoints pane, my extra command is missing 😶:

alexisDVJML_2-1680713752120.png

 

Thanks again @geethat .

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go

eduardo_salvador02
Enthusiast
Enthusiast

Hello, how were you able to access the menu and create a custom option? I'm having the same problem.

Do you have any example code?

0 Likes

eduardo_salvador02
Enthusiast
Enthusiast

Ignore the message above, I got it LOL

0 Likes