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

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

shastu
Advisor Advisor
640 Views
4 Replies
Message 1 of 5

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

shastu
Advisor
Advisor

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.

0 Likes
641 Views
4 Replies
Replies (4)
Message 2 of 5

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

LukeDavenport
Collaborator
Collaborator

 

And with image this time!

Luke

Capture.JPG

0 Likes
Message 4 of 5

shastu
Advisor
Advisor

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.

0 Likes
Message 5 of 5

xiaodong_liang
Autodesk Support
Autodesk Support

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. 

 

0 Likes