VBA Program integrate in Context menu or mouse menu

VBA Program integrate in Context menu or mouse menu

matthias.richstein
Participant Participant
314 Views
3 Replies
Message 1 of 4

VBA Program integrate in Context menu or mouse menu

matthias.richstein
Participant
Participant

Hey,

does anyone in the community have an idea how to integrate VBA programs that are often needed into the context menu/mouse menu... who can help?

 

matthiasrichstein_0-1702900919669.png

 

I'm grateful for any helps.

 

Best regards

Matthias

 

0 Likes
315 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @matthias.richstein.  I am not so sure about customizing the right-click menu with VBA macros, but the 'Marking Menu' can easily be customized to include VBA macros.  When you open the Customize dialog (Tools tab, Optionsl panel), then go to the Marking Menu tab in that dialog, then on the right where it says 'All Commands' under the text box, use that drop-down list and choose 'macros' instead.  Now you can assign macros to those convenient places around your mouse in various environments and scenarios.  Just pay attention to the controls to the upper left for which Environment and sub-environment the currently showing Marking Menu is for, so you only effect the specific ones you want to effect.

WCrihfield_0-1702903288813.png

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

Frederick_Law
Mentor
Mentor

You can add them to ribbon:

Macro-04.jpg

 

I use a VB from to show my macros:

Macro-03.jpg

 

I've converted them to addin.

0 Likes
Message 4 of 4

Majjek
Advocate
Advocate

If you really want to integrate it into your contextmenu's, I would suggest creating an add-in.

I don't know if it's possible to do the stuff below via VBA.

 

You will need to handle the OnContextMenu event from the UserInputEvents.

In the event arguments, you will find the commandbar which is referenced.

And during your code handling, you can manipulate the commands in the context menu.

 

 

You can check this out as well, it seems like it's doing the same, but in VBA with another event:

https://adndevblog.typepad.com/manufacturing/2015/03/entity-specific-context-menu.html