- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I've been struggling with customizing a marking menu. I do not want to add some button to an existing marking menu but create a custom marking menu when I right click a certain object.
The object is now a sketchedsymbol, when I get the linearMarkingMenu my code starts and i want to add a radial menu with some custom commands. The problem is that the radial menu is not showing at all for this selection.
I use the following code for testing:
' Declare the event objects Private WithEvents oUserInputEvents As UserInputEvents ' Create a flag for when selecting is started or finished Private bSelecting As Boolean ' Initialize the class to start watching events Sub Init() ' Create an InteractionEvents object. Set oUserInputEvents = ThisApplication.CommandManager.UserInputEvents End Sub Private Sub oUserInputEvents_OnPreSelect(PreSelectEntity As Object, DoHighlight As Boolean, MorePreSelectEntities As ObjectCollection, ByVal SelectionDevice As SelectionDeviceEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View) ' Check if the preselected entity is a sketchsymbol If TypeOf PreSelectEntity Is SketchedSymbol Then bSelecting = True End If End If End Sub Private Sub oUserInputEvents_OnLinearMarkingMenu(ByVal SelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal LinearMenu As CommandControls, ByVal AdditionalInfo As NameValueMap) If bSelecting Then Call Create_MarkingMenu(SelectedEntities.Item(1)) End If End Sub Private Sub Create_MarkingMenu(SelectedEntity As Object) Dim rrm As RadialMarkingMenu Set rrm = ThisApplication.UserInterfaceManager.ActiveEnvironment.GetRadialMarkingMenu(ObjectTypeEnum.kSketchedSymbolObject) ' Define some test buttons Dim oDef1 As ButtonDefinition Set oDef1 = ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomAllCmd") Dim oDef2 As ButtonDefinition Set oDef2 = ThisApplication.CommandManager.ControlDefinitions.Item("AppIsometricViewCmd") Set rrm.NorthControl = oDef1 Set rrm.SouthControl = oDef2 End Sub
I've tried
ThisApplication.UserInterfaceManager.ActiveEnvironment.GetRadialMarkingMenu(), with this I do get a menu, so apparently it is present it is just not showing. How do I show this menu?
and
ThisApplication.UserInterfaceManager.ActiveEnvironment.RadialMarkingMenus.Add(), with this I've apparently added a new 'Sub-environment' to the customize marking menu, also great. How do I get this menu to show up for example after clicking a button or a different event? Or how do I add this to a linear markingmenu which does not have a radial menu?
Solved! Go to Solution.