Inventor Customization

Inventor Customization

Reply
Mentor
ebuckner
Posts: 525
Registered: ‎10-20-2006
Message 1 of 10 (474 Views)

Add custom Panel to all Tabs

474 Views, 9 Replies
10-03-2011 11:22 AM

Just digging into 2012 and I can't seem to locate a custom toolbar UI. I have a set of customizations that I distribute to my group thru a shared drive and we are used to them all being in one place, in every environment. It appears that in order to do this I have to customize the ribbon tabs for each environment individually and manually???? That can't be the case though, very counterproductive, there must be another way.

 

Any hints would be appreciated and thanks!

 

Thanks

 

Eric

Inventor 2012 Pro 64bit
Vault Manufacturing 2010 Admin (2012 soon)
Windows 7 Pro 64bit
Quad Core processor 2.26 Ghz
16 GB DDR3 RAM
1.5 GB Nvidia Quadro FX 4800
2 – 320 GB SATA drives

Distinguished Contributor
robmatthews
Posts: 385
Registered: ‎07-12-2007
Message 2 of 10 (421 Views)

Re: Add custom Panel to all Tabs

11-29-2012 05:22 PM in reply to: ebuckner

Has this been reolved? Is there an answer? We also want a persistent toolbar, irrespective of environment and tab, per screenshot.

=============================================
This is my signature, not part of my post.
Valued Contributor
binuvarkey
Posts: 64
Registered: ‎09-18-2006
Message 3 of 10 (414 Views)

Re: Add custom Panel to all Tabs

11-29-2012 07:29 PM in reply to: robmatthews

I have created user commands on ipt, iam and idw environments and then undocked the user commands  and repositioned off the ribbon. It worked for me. See attached. Couldn't find any other way.

Autodesk Product Design Suite Premium 2014
Vault Workgroup 2014
Microsoft Windows 7 Professional 64bit SP1
Gigabyte P67A-UD3R-B3, Core i7-2600K CPU
8.00GB DDR3, NVIDIA Quadro 2000
*Expert Elite*
Mark_Wigan
Posts: 460
Registered: ‎03-07-2006
Message 4 of 10 (401 Views)

Re: Add custom Panel to all Tabs

11-30-2012 07:49 AM in reply to: ebuckner

autodesk has had requests submitted to improve the functionality of the ribbon.

 

it is a bit of a sad pity to say the least that we have to carry out work arounds to get some of the functionality back that we used to have...

best regards,
- Mark

(Kudo or Tag if Solved - it may help others)

PDSU 2015 Windows 8.1, 64bit.

Distinguished Contributor
robmatthews
Posts: 385
Registered: ‎07-12-2007
Message 5 of 10 (388 Views)

Re: Add custom Panel to all Tabs

12-02-2012 01:17 PM in reply to: binuvarkey

Thanks for the ieda, Binuvarkey, but we still want to have environment and tab-specific user commands panels available. I guess that we don't have the possibility of two user commands panels?

 

And Mark, Yes, it is a pity. I can understand the move away from toolbars in general (or at least accept it) but surely we should be able to create custom toolbars for such a requirement as environment-non-specific tools.

Good to hear from you too, hope you're doing well.

=============================================
This is my signature, not part of my post.
*Expert Elite*
Mark_Wigan
Posts: 460
Registered: ‎03-07-2006
Message 6 of 10 (359 Views)

Re: Add custom Panel to all Tabs

12-06-2012 04:36 AM in reply to: robmatthews

one small thing that seems to help in our new improved interface is just to make a form using the API and arrange all the custom API commands on that...

 

then fire that form from a button on the quick access toolbar. at least that way we don't have to spend all day arranging custom ribbon commands., Just load the one button & we are back to work again.

 

no this is not as good as we had available to us a few versions ago i know.

best regards,
- Mark

(Kudo or Tag if Solved - it may help others)

PDSU 2015 Windows 8.1, 64bit.

ADN Support Specialist
ekinsb
Posts: 351
Registered: ‎07-21-2006
Message 7 of 10 (341 Views)

Re: Add custom Panel to all Tabs

12-06-2012 12:01 PM in reply to: Mark_Wigan

It is still possible, through the API, to create a toolbar.  You'll need to set your development environment to show hidden functions, but they're still there and do work.



Brian Ekins
Developer Technical Services
Autodesk Developer Network
Autodesk, Inc.
*Expert Elite*
Mark_Wigan
Posts: 460
Registered: ‎03-07-2006
Message 8 of 10 (320 Views)

Re: Add custom Panel to all Tabs

12-08-2012 06:53 AM in reply to: ekinsb

Thanks mate.

 

not sure how to go about it but will attempt to investigate.

 

most of us are trying to get work done not have so spend more time doing work arounds. Why is AD making life hard for us?

best regards,
- Mark

(Kudo or Tag if Solved - it may help others)

PDSU 2015 Windows 8.1, 64bit.

Distinguished Contributor
robmatthews
Posts: 385
Registered: ‎07-12-2007
Message 9 of 10 (310 Views)

Re: Add custom Panel to all Tabs

12-09-2012 01:29 PM in reply to: Mark_Wigan

Hey Gents. Here is where I am so far.  I have created the button definitions, and the toolbar, and turned on the visibility.  I have no functionality or images to the buttons yet, but it's a start. (Plus its probably a bit cobbled together from the help, as I am no expert programmer.)

 

One part that I am struggling with is destroying the button definitions. How do I do that? (If i have run the routine, and generated the toolbar, and then deleted it with the other routine, I can't re-build it, because the button definition names still exist.)

 

Plus I'm not sure what you mean, Brian, when you say to show hidden functions.

 

Please excuse any poor form you see, and feel free to correct me.

=============================================
This is my signature, not part of my post.
ADN Support Specialist
ekinsb
Posts: 351
Registered: ‎07-21-2006
Message 10 of 10 (284 Views)

Re: Add custom Panel to all Tabs

12-11-2012 02:35 PM in reply to: robmatthews

Here's some simple code that demonstrates the process in VB.Net.  This would typically be in the Activate method of an add-in where it would be executed once every time Inventor starts up.  There are a couple of things to point out. 

 

  • It always re-creates the button definition.  This is because Inventor does not remember custom control definitions from one session to the next.
  • It attempts to first get an existing command bar, and if it doesn't find one, then it creates it.  This is because Inventor does remember the command bars from one session to the next.  It also remembers the buttons on the command bar so you don't need to recreate those either.

 

def1 = invApp.CommandManager.ControlDefinitions.AddButtonDefinition("Test", "test1", Inventor.CommandTypesEnum.kQueryOnlyCmdType)

Dim cBar As Inventor.CommandBar = Nothing

' Attempt to get the existing command bar.
Try
    cBar = invApp.UserInterfaceManager.CommandBars.Item("My Bar")
Catch ex As Exception
End Try

' Check to see if the existing bar was found.
If cBar Is Nothing Then
    ' Create a new command bar.
    cBar = invApp.UserInterfaceManager.CommandBars.Add("My Bar", "My Bar")

    ' Add the buttons.
    cBar.Controls.AddButton(def1)
End If

cBar.Visible = True

 

Another approach is to create if from scratch each time.  When calling the CommandBars.Add method there is an optional argument for the ClientId that I didn't use above.  If that is provided, then Inventor will not remember the command bar from one session to another.

 

Finally, what I meant by hidden functions is that there are methods in the API that are marked as hidden.  By default they won't show up in the Object Browser or Intellisense.  These are typically for functionality that is now obsolete or has been replaced by a more powerful function.  In VBA you can right-click in the Object Browser and specify that hidden objects and functions should be shown.  In .Net there is similar functionality in its Object Browser.  However, I haven't found a way to have them show up in Intellisense.  You can still use them but you have to now what to type in.  I did some searching online and found a couple of articles but no solution.  Seems it inconsistent because they referred to it working on some computers but not others.



Brian Ekins
Developer Technical Services
Autodesk Developer Network
Autodesk, Inc.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.