Menu Item Positioning

Menu Item Positioning

Anonymous
Not applicable
346 Views
6 Replies
Message 1 of 7

Menu Item Positioning

Anonymous
Not applicable
Using the new R9 format I Now have my toolbar item on the Tools menu however it is at the bottom. How do specify the position in the order of the flyout? I see we should use Call oMenuPopupCmdBar.Controls.AddPopup(oFlyOutCmdBar, 10) But how do you identify the index of the other controls (to figure out where to place your new control)? Thanks, -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager
0 Likes
347 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Sean, There is an Index property on CommandBarControl that might help. You will first need to identify the control you want to place your new control next to. Use CommandBarControl.InternalName - which is the internal name of the underlying definition of the control (either a ControlDefinition or a CommandBar). For instance, the internal name of the command bar control representing the extrude feature should be "PartExtrudeCmd". Sanjay- "Sean Dotson" wrote in message news:41c6c7a4_2@newsprd01... > Using the new R9 format I Now have my toolbar item on the Tools menu however > it is at the bottom. How do specify the position in the order of the > flyout? > > I see we should use > > Call oMenuPopupCmdBar.Controls.AddPopup(oFlyOutCmdBar, 10) > > But how do you identify the index of the other controls (to figure out where > to place your new control)? > > Thanks, > > -- > Sean Dotson, PE > www.sdotson.com > Autodesk Inventor Certified Expert > Sidel, Engineering & Manufacturing Manager > > >
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks Sanjay, I'll have a look. -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager "Sanjay Ramaswamy (Autodesk)" wrote in message news:41c70e77$1_1@newsprd01... > Sean, > > There is an Index property on CommandBarControl that might help. You will > first need to identify the control you want to place your new control next > to. Use CommandBarControl.InternalName - which is the internal name of the > underlying definition of the control (either a ControlDefinition or a > CommandBar). For instance, the internal name of the command bar control > representing the extrude feature should be "PartExtrudeCmd". > > Sanjay- > > "Sean Dotson" wrote in message > news:41c6c7a4_2@newsprd01... > > Using the new R9 format I Now have my toolbar item on the Tools menu > however > > it is at the bottom. How do specify the position in the order of the > > flyout? > > > > I see we should use > > > > Call oMenuPopupCmdBar.Controls.AddPopup(oFlyOutCmdBar, 10) > > > > But how do you identify the index of the other controls (to figure out > where > > to place your new control)? > > > > Thanks, > > > > -- > > Sean Dotson, PE > > www.sdotson.com > > Autodesk Inventor Certified Expert > > Sidel, Engineering & Manufacturing Manager > > > > > > > >
0 Likes
Message 4 of 7

Anonymous
Not applicable
How do I find out what the index is of the 'Add-ins' in the Tools menu?
Actually, how to find this out in general?
0 Likes
Message 5 of 7

Anonymous
Not applicable
Here is some sample code to get the index of the Add-Ins control in the
tools menu (the idea is to obtain the controls using their internal names).

Sub GetAddInsControlIndex()

'Get the menu bar
Dim oMenuBar As CommandBar
Set oMenuBar =
ThisApplication.UserInterfaceManager.ActiveEnvironment.DefaultMenuBar

'Get the 'Tools' control
Dim oToolsControl As CommandBarControl
Set oToolsControl = oMenuBar.Controls.Item("PartToolsMenu")

'Get the 'Add-Ins...' control
Dim oAddInsControl As CommandBarControl
Set oAddInsControl =
oToolsControl.CommandBar.Controls.Item("AppAddInManagerCmd")

'Get index of Add-Ins control within tools menu
Dim AddInsIndex As Long
AddInsIndex = oAddInsControl.index

End Sub

Sanjay-


wrote in message news:4909465@discussion.autodesk.com...
How do I find out what the index is of the 'Add-ins' in the Tools menu?
Actually, how to find this out in general?
0 Likes
Message 6 of 7

Anonymous
Not applicable
Thanks, this will help me out in this case!
Only thing is that this works for this problem, but how do we find out
about the internal names of the other menu items? Can I find that in the
help somewhere? Whould save me questions on the Autodesk forum!

Sanjay Ramaswamy (Autodesk) wrote:
> Here is some sample code to get the index of the Add-Ins control in the
> tools menu (the idea is to obtain the controls using their internal names).
>
> Sub GetAddInsControlIndex()
>
> 'Get the menu bar
> Dim oMenuBar As CommandBar
> Set oMenuBar =
> ThisApplication.UserInterfaceManager.ActiveEnvironment.DefaultMenuBar
>
> 'Get the 'Tools' control
> Dim oToolsControl As CommandBarControl
> Set oToolsControl = oMenuBar.Controls.Item("PartToolsMenu")
>
> 'Get the 'Add-Ins...' control
> Dim oAddInsControl As CommandBarControl
> Set oAddInsControl =
> oToolsControl.CommandBar.Controls.Item("AppAddInManagerCmd")
>
> 'Get index of Add-Ins control within tools menu
> Dim AddInsIndex As Long
> AddInsIndex = oAddInsControl.index
>
> End Sub
>
> Sanjay-
>
>
> wrote in message news:4909465@discussion.autodesk.com...
> How do I find out what the index is of the 'Add-ins' in the Tools menu?
> Actually, how to find this out in general?
0 Likes
Message 7 of 7

Anonymous
Not applicable
The name of a CommandBarControl is essentially the name of its underlying
ControlDefinition or CommandBar. Look for the sample titled "Control
Definitions (Inventor Command Names)" under the "UI Customization" folder in
Programming Help/Samples. The sample prints out the internal names of all
the Inventor commands (ControlDefinitions) along with their descriptions to
a text file. You can then search the file, with perhaps the description of
the command that you see on the status bar.

You will not find the internal names of controls such as "PartToolsMenu" in
the list, since these are not Inventor commands. For such items you will
need to put a VB watch of the owning toolbar and check the InternalName
property of the control.

Sanjay-


"JakeNL" wrote in message
news:4910530@discussion.autodesk.com...
Thanks, this will help me out in this case!
Only thing is that this works for this problem, but how do we find out
about the internal names of the other menu items? Can I find that in the
help somewhere? Whould save me questions on the Autodesk forum!

Sanjay Ramaswamy (Autodesk) wrote:
> Here is some sample code to get the index of the Add-Ins control in the
> tools menu (the idea is to obtain the controls using their internal
> names).
>
> Sub GetAddInsControlIndex()
>
> 'Get the menu bar
> Dim oMenuBar As CommandBar
> Set oMenuBar =
> ThisApplication.UserInterfaceManager.ActiveEnvironment.DefaultMenuBar
>
> 'Get the 'Tools' control
> Dim oToolsControl As CommandBarControl
> Set oToolsControl = oMenuBar.Controls.Item("PartToolsMenu")
>
> 'Get the 'Add-Ins...' control
> Dim oAddInsControl As CommandBarControl
> Set oAddInsControl =
> oToolsControl.CommandBar.Controls.Item("AppAddInManagerCmd")
>
> 'Get index of Add-Ins control within tools menu
> Dim AddInsIndex As Long
> AddInsIndex = oAddInsControl.index
>
> End Sub
>
> Sanjay-
>
>
> wrote in message news:4909465@discussion.autodesk.com...
> How do I find out what the index is of the 'Add-ins' in the Tools menu?
> Actually, how to find this out in general?
0 Likes