Convert VB.net Plug-in to Add-in

Convert VB.net Plug-in to Add-in

J_Dumont
Advocate Advocate
797 Views
2 Replies
Message 1 of 3

Convert VB.net Plug-in to Add-in

J_Dumont
Advocate
Advocate

I just finished my first Plugin for Inventor in VB.Net using Visual Studio 2015. I prefer that the program be an Add-in and I'm not sure if there's an easy way to convert my Plug-In to an Add-in. I've seen the Inventor template that gets installed with the SDK but it appears that what you use when you start from scratch. 

0 Likes
Accepted solutions (1)
798 Views
2 Replies
Replies (2)
Message 2 of 3

yan.gauthier
Advocate
Advocate
Accepted solution

You did an .exe that marshals the inventor Application ?

 

Basically, you use the AddinServer class (just like the example in the SDK). in the activate method of this class, Inventor passes its AddInSiteObject which contains the Inventor.Application. From that point, your code should be almost identical.

 

You then place your compiled .dll (class library) along with the .addin file in either 

 

C:\ProgramData\Autodesk\Inventor 2020\Addins

 

or

 

C:\%USERPROFILE%\AppData\Roaming\Autodesk\Inventor 2020\Addins

 

ProgramData bring the addin to every user on this computer, but requires Admin access, AppData is user specific.

 

When opening inventor, it will detect the new addin and ask you if you want to allow it (you can alway browse addins from the Environments ribbon later)

 

Note: Use the .addin file from the SDK example to guide you. It will help you understand to match ID, GUID and assembly name.

 

Also, if you wish to run in debug mode, go to your project properties: in the debug section, select Start external program and point to something like : C:\Program Files\Autodesk\Inventor 2020\Bin\Inventor.exe

 

in the build section, select the output path to be where the addin needs to be (if ProgramData you will need to run VS as admin). You need Inventor to be closed before starting to debug since it will overwrite the dll that would be otherwise write-protected by Inventor.

 

Message 3 of 3

J_Dumont
Advocate
Advocate

Thank you for your input.

I will try to follow your steps to create the add-in.

0 Likes