Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add custom Panel to all Tabs

9 REPLIES 9
Reply
Message 1 of 10
ebuckner
919 Views, 9 Replies

Add custom Panel to all Tabs

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

9 REPLIES 9
Message 2 of 10
robmatthews
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.
Message 3 of 10
binuvarkey
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.

Message 4 of 10
Mark_Wigan
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 helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

Message 5 of 10
robmatthews
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.
Message 6 of 10
Mark_Wigan
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 helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

Message 7 of 10
ekinsb
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
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 8 of 10
Mark_Wigan
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 helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

Message 9 of 10
robmatthews
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.
Message 10 of 10
ekinsb
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
Inventor and Fusion 360 API Expert
Mod the Machine blog

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report