Hi. I just assembled a small test app to check Inventor's AddIn integration, but I'm strugling in having the app display anything in the interface.
Normally, it should add a button inside an "Update" panel located in the "Tools" tab (in the PART environment).
Nothing happens...
Should anyone have the courage to dive in my VB.NET (VisualStudio 2017) project, it is attached herein.
Code is based on this Autodesk sample code.
Many thanks
Solved! Go to Solution.
Solved by AlexFielder. Go to Solution.
I would check these lines (highlighted below):
The activate is what happens when the add-in loads. It looks like your add-in would load if you reset the ribbon without uncommenting these lines.
Thanks Alex for giving it a try... i'm not an API newbie, but rather a dumbie !
Still, commenting out only the if statement, but leaving the AddToUserInterface() uncommented does not change anything (at least on my dev platform). The interface keeps exactly unchanged in the Tools tab.
I just built your addin and loaded it into Inventor 2019 for debugging and it errors at this line:
Basically, what this error means is that the "ThisApplication" object needs assigning to before we reach this stage.
You were almost there and a couple of simple changes is all that was required. You can see the differences between mine & your files here:
https://www.diffchecker.com/RxEa7zRb
I renamed some things because I have a lot of add-ins loaded and the default "StandardAddinServer" plays havoc when debugging inside Visual Studio. The main changes were to rename this:
g_inventorApplication = addInSiteObject.Application
to this:
ThisApplication = addInSiteObject.Application
and this:
Public g_inventorApplication As Inventor.Application
to this:
Public ThisApplication As Inventor.Application
I also commented out this line:
Public Property ThisApplication As Object
as it wasn't doing anything.
And here is the finished article running in-place:
🙂
Thank you so much Alex. I corrected my errors and panel is now showing in the tools menu.
I post the full working solution, would anyone need a working demo when diving into Inventor SDK.
Just a small concern though, eachtime I generate the solution, the MY UPDATE panel moves one position to the right in the ribbon... strange.
That's an interesting "feature".
On closer inspection, it seems like it may be because your AddPanelToToolsTab() sub has the "RibbonPanels.add" method but without the optional "InsertBeforeTargetPanel" alluded to here:
http://help.autodesk.com/view/INVNTOR/2019/ENU/?guid=GUID-50B0D94D-ADB4-442F-844F-6EA339F8237A
Assuming that the missing boolean is the issue, you'll obviously need to change the panelId of the panel that it's loaded before
🙂
Hi, Alex,
I put a "False" at the end of code as follows, intending to put the panel after the "id_PanelP_ToolsMeasure".
oPanel = oTab.RibbonPanels.Add("MY UPDATE", "ToolsTabUpdatePanel", "SampleClientId", "id_PanelP_ToolsMeasure", False)
But it does not work. The same phenomenon as described by Brigitte happened. Actually, I have define some custom tab with panels under it. The way as above to control sequence of panels does not work either.
Do you have any clue?
Thanks
Can't find what you're looking for? Ask the community or share your knowledge.