Macro to launch Marking Menu?

Macro to launch Marking Menu?

amarcoc
Advocate Advocate
551 Views
2 Replies
Message 1 of 3

Macro to launch Marking Menu?

amarcoc
Advocate
Advocate

Hi.

 

I need a macro to launch the Marking Menu ("Radial Menu Only" verion, if possible, as the picture attached)

 

I have tried this, but didn't work:

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppViewMarkingMenuCmd ").Execute

Any suggestion?

 

It would be almost same as a right click on window.

 

Thanks in advance.

 

imagem.jpg

0 Likes
552 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk

If your purpose is to set the Overflow Menu to Radial Menu Only, currently no API to do this, you can log a wish to IdeaStation. But a workaround is to use the APIs to hide the linear marking menu, below is a VBA code sample:

' Copy below to a module
Sub test()
    Dim oCls As New clsMarkingMenu
    oCls.Init
End Sub

' Copy below to a Class Module, and rename the class module to clsMarkingMenu
Private WithEvents mUserInputEvents As UserInputEvents


Public Sub Init()
    Set mUserInputEvents = ThisApplication.CommandManager.UserInputEvents
    
    Do
        ThisApplication.UserInterfaceManager.DoEvents
    Loop
    
End Sub

Private Sub mUserInputEvents_OnLinearMarkingMenu(ByVal SelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal LinearMenu As CommandControls, ByVal AdditionalInfo As NameValueMap)
    ' clear the linear marking menu
    Dim oControl As CommandControl
    For Each oControl In LinearMenu
        oControl.Delete
    Next
End Sub

Run the VBA code you can see only the radial menu is displayed. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

amarcoc
Advocate
Advocate

Hi.

 

Thanks you for the reply.

 

On line:

Dim oCls As New clsMarkingMenu

I get error:

Compile error:
User-defined type not defined.

How can this be fixed?

 

Thanks!

0 Likes