I’ve noticed with some plugins that when you create something within them you can then right click on the object and plugin specific items are shown in that menu.
I would like to do something like that for the truss and foundation plugin where a user can right click and then be shown the option to edit the roof or foundation assembly.
Can someone point me in the right direction for adding this type of functionality.
Right Click Menu Items
3 posts
• Page 1 of 1
Re: Right Click Menu Items
Here's a simple example from part of my SectionCutFace tool's code.
That tool actually ONLY works from the right-click context-menu, when there's a suitable selection...
The TIG::SectionCutFace.ok() method returns true if the current selection contains just one Section-Plane. The MENUTXT is a Constant which I had set up earlier - so it can involve translations etc - you could just use a text-string. If that context-menu item is chosen, then the TIG::SectionCutFace.new() method runs [using the selected Section-Plane]... You can simply replace bits with your own methods etc. You can add several possible methods, each with their own 'tests', which can have multiple hits etc if needed... You can also add a menu item based on your tool-name, and add commands into that as they become appropriate - just like you do in the top menu bar with a sub-item set up... TIG
Re: Right Click Menu ItemsThank-you for the example and explanations.
3 posts
• Page 1 of 1
|