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.