Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I customize the Right Mouse Click options under the marking menu?

4 REPLIES 4
Reply
Message 1 of 5
shastu
504 Views, 4 Replies

How do I customize the Right Mouse Click options under the marking menu?

In 2012 the Open Drawing was available directly under the marking menus.  Now in 2014 it is under the component sub-menu.  How can I move it back?  See attachment for clarity.

4 REPLIES 4
Message 2 of 5
LukeDavenport
in reply to: shastu

Hi Shastu,
Nice and easy - see picture below:
[image: Inline image 2]
Message 3 of 5

 

And with image this time!

Luke

Capture.JPG

Message 4 of 5
shastu
in reply to: LukeDavenport

You are showing the marking menu.  That is not what I am talking about.  For example, when you do it from the browser, you don't see the marking menus at all.  Instead you just have the RMC options.

Message 5 of 5
xiaodong_liang
in reply to: shastu

Hi Acadmauto,

 

Normally, the RMB menu (called linear menu in API) can be customized at 

 

UserInputEvents.OnLinearMarkingMenu( SelectedEntities As ObjectsEnumerator,

                                                                     SelectionDevice As SelectionDeviceEnum,

                                                                       LinearMenu As CommandControls,

                                                                      AdditionalInfo As NameValueMap )

 

Where, LinearMenu tells the controls. You can add more controls, or remove controls.

 

So, what I thought is your requirement could be achieved by the code below:

 

Private Sub inputEvents_OnLinearMarkingMenu(ByVal SelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal LinearMenu As CommandControls, ByVal AdditionalInfo As NameValueMap)
      
          ‘remove the control, but get its control definition    
          Dim oContrlDefToMove As ControlDefinition
                    
           Dim eachCtrl As CommandControl
           Dim eachSubCtrl As CommandControl
           For Each eachCtrl In LinearMenu
            If eachCtrl.DisplayName = "Component" Then
                For Each eachSubCtrl In eachCtrl.ChildControls
                    If eachSubCtrl.DisplayName = "Open Drawing" Then
                        Set oContrlDefToMove = eachSubCtrl.ControlDefinition                        
                        eachSubCtrl.Delete
                    End If
                Next
                End If 
            Next
           
‘add the control definition to the location you want to put
           'Call LinearMenu.AddButton(oContrlDefToMove, , , LinearMenu.Item(1).InternalName, False)
           
       
End Sub

 but, when I tested,  most controls of UI are available in the LinearMenu, but no control for "Open Drawing" 😞  I have not got what happened with the method, but this is the only API way I can think of for your requirement. 

 

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

Post to forums  

Autodesk Design & Make Report