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: 

My VB.NET Inventor AddIn is launched successfully, but not functionning...

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
brigitte.nader
848 Views, 6 Replies

My VB.NET Inventor AddIn is launched successfully, but not functionning...

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

6 REPLIES 6
Message 2 of 7

I would check these lines (highlighted below):

2019-02-01 13_27_35-C__Users_Alex.Fielder_AppData_Local_Temp_7zO8D16D5AB_StandardAddInServer.vb - No.png

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.

Message 3 of 7

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.

 

Message 4 of 7

Hi @brigitte.nader 

 

I just built your addin and loaded it into Inventor 2019 for debugging and it errors at this line:

 

2019-02-04 09_04_41-InventorAddIn5 (Debugging) - Microsoft Visual Studio  (Administrator).png

 

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:

 

2019-02-04 09_20_11-Autodesk Inventor Professional 2019 - [Part1].png

 

🙂

Message 5 of 7

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.

Message 6 of 7

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 

 

🙂

Message 7 of 7
liminma8458
in reply to: AlexFielder

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

Thanks
Limin
Inventor pro 2023 64 bit update 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit

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

Post to forums  

Autodesk Design & Make Report