Right Click Modification

Right Click Modification

Anonymous
Not applicable
327 Views
3 Replies
Message 1 of 4

Right Click Modification

Anonymous
Not applicable
Is there a way to add 3d orbit to the right click menu? Thanks, Tom
0 Likes
328 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
You need to create a toolbutton and add it to the context menu, then you could run something like this Private Sub InventorCommand(sCommandName As String) Dim oControlDef As ControlDefinition Set oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item(sCommandName) oControlDef.Execute End Sub Public Sub rotate() Call InventorCommand("AppRotateViewCmd") End Sub -- Kent Keller Autodesk Discussion Forum Facilitator "Tom" wrote in message news:41c1b550$1_2@newsprd01... > Is there a way to add 3d orbit to the right click menu? > > Thanks, > Tom > >
0 Likes
Message 3 of 4

Anonymous
Not applicable
Kent, I like how you wrote a wrapper function for calling those InventorCommands. We need more wrappers like this! Bob "Kent Keller" wrote in message news:41c1ba92$1_3@newsprd01... > You need to create a toolbutton and add it to the context menu, then you > could run something like this > > > Private Sub InventorCommand(sCommandName As String) > > Dim oControlDef As ControlDefinition > Set oControlDef = > ThisApplication.CommandManager.ControlDefinitions.Item(sCommandName) > > oControlDef.Execute > > End Sub > > Public Sub rotate() > Call InventorCommand("AppRotateViewCmd") > End Sub > > > -- > Kent Keller > Autodesk Discussion Forum Facilitator > > > "Tom" wrote in message > news:41c1b550$1_2@newsprd01... >> Is there a way to add 3d orbit to the right click menu? >> >> Thanks, >> Tom >> >> > >
0 Likes
Message 4 of 4

Anonymous
Not applicable
I've attached some VBA code to demonstrate this. The code adds the 'Rotate' command to the context menu just before the 'Previous View' command. The Rotate command is not added if the 'Previous View' command is not found in the context menu. Sanjay- Put this code in a VBA module (say, Module1): ------------------------------------------------- Option Explicit Public oClass1 As Class1 Sub AddToContextMenu() Set oClass1 = New Class1 oClass1.Initialize End Sub ------------------------------------------------- Put this code in a class module (called Class1): ----------------------------------------------- Option Explicit Private WithEvents oUserInputEvents As UserInputEvents Public Sub Initialize() Set oUserInputEvents = ThisApplication.CommandManager.UserInputEvents End Sub Private Sub oUserInputEvents_OnContextMenu(ByVal SelectionDevice As SelectionDeviceEnum, ByVal AdditionalInfo As NameValueMap, ByVal CommandBar As CommandBar) Dim oControl As CommandBarControl Dim oPreviousViewControl As CommandBarControl Set oPreviousViewControl = Nothing For Each oControl In CommandBar.Controls If Not oControl.ControlDefinition Is Nothing Then If oControl.ControlDefinition.InternalName = "AppPreviousViewCmd" Then Set oPreviousViewControl = oControl Exit For End If End If Next If Not oPreviousViewControl Is Nothing Then Dim oRotateCmd As ControlDefinition Set oRotateCmd = ThisApplication.CommandManager.ControlDefinitions.Item("AppRotateViewCmd") Dim oRotateControl As CommandBarControl Set oRotateControl = CommandBar.Controls.AddButton(oRotateCmd, oPreviousViewControl.index) oRotateControl.GroupBegins = True oPreviousViewControl.GroupBegins = False End If End Sub ----------------------------------------------- And run the function AddToContextMenu. You should now see the Rotate command in the context menu. "Tom" wrote in message news:41c1b550$1_2@newsprd01... > Is there a way to add 3d orbit to the right click menu? > > Thanks, > Tom > >
0 Likes