How to initiate Right Click Menu???

How to initiate Right Click Menu???

MattH_Work
Collaborator Collaborator
506 Views
4 Replies
Message 1 of 5

How to initiate Right Click Menu???

MattH_Work
Collaborator
Collaborator

Is it possible to initiate the relevant Right Click Menu ( as in the one you would get by RMB'ing within the browser ) by passing a Feature name to the browser

 

Cheers


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
507 Views
4 Replies
Replies (4)
Message 2 of 5

Frederick_Law
Mentor
Mentor

Each menu has different internal name.

If you know which one you need, you could bring them up.

0 Likes
Message 3 of 5

Curtis_Waguespack
Consultant
Consultant

HI @MattH_Work 

 

I was working through something similar a while back on these threads:

 

This one deals with the radial menu, but shows how to make it context driven ( only show parts list option if the object clicked on is a parts list) :

 

This thread has some discussion of how this works as well:

 

Here are direct links to the working example Visual Studio projects in zip files from those threads:

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 4 of 5

MattH_Work
Collaborator
Collaborator

Not looking to change any menus, just display them for the end user to interact with.

 

Psuedo Code

 

If oFeature.Type = "Extrude" then Show "Extrude" menu

If oFeature.Type = "Revolve" then Show "Revolve" menu

 

But as there are countless types of feature, I'm looking for a catch all

Show "oFeature.Type" menu

 

I just want to pass the name of the feature or type of feature, and get the relevant RMB menu

The same applies to double clicking a feature in the normal Inventor model browser, I want to replicate that in my browser

 

 


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
Message 5 of 5

Curtis_Waguespack
Consultant
Consultant

Hi @MattH_Work 

 

Regardless of adding to the menu or not, I think you would use the same methods illustrated in the example addins I posted, to interact with the OnSelectEvent to determine what has been clicked on, in combination with the OnLinearMarkingMenu event and/or the OnRadialMarkingMenu event to get the command controls of those menus.

 

So to right click on a feature in the browser and get the contents of the linear marking menu, I would do something like this:

 

        Private Sub Events_OnLinearMarkingMenu(ByVal SelectedEntities As Inventor.ObjectsEnumerator,
                                               ByVal SelectionDevice As Inventor.SelectionDeviceEnum,
                                               ByVal LinearMenu As CommandControls,
                                               ByVal AdditionalInfo As Inventor.NameValueMap)

            Dim sMsg As String = Nothing
            For Each oControl As CommandControl In LinearMenu
                sMsg = oControl.DisplayName & vbLf & sMsg
            Next

            MsgBox(sMsg)

        End Sub

 

which when right clicking on an Extrude feature, would result in something like this:

Curtis_Waguespack_0-1686587439238.png

 

However, the "my browser" part of your statement throws me a bit. 

 

Are you building a custom browser?

If so, is the right click context menu empty by default when you click on a feature in that custom browser? 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

EESignature

0 Likes