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: 

Addin won't load

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
snappyjazz
552 Views, 5 Replies

Addin won't load

Hello,

I have a similar issue to others on here, but their solutions won't help. I created an addin and on my computer it works fine. When I copied all files over to another users computer I can't get the addin to stay loaded. See the addin manager screen below; no matter what I do it won't "stay" loaded. They're using Inventor 2022. I used the autodesk provided template to create the addin in visual studio.


things I've tried

.addin -> C:\ProgramData\Autodesk\Inventor 2022\Addins <-- latest attempt

.addin -> C:\Program Files\Autodesk\Inventor 2022\Bin

.addin -> C:\ProgramData\Autodesk\Inventor Addins\MyInventorMenu 

 

.dll -> C:\ProgramData\Autodesk\Inventor Addins\MyInventorMenu

.dll -> C:\Program Files\Autodesk\Inventor 2022\Bin <-- latest attempt

 

The inventor interop I'm using is from:

C:\\Windows\Microsoft.NET\assembly\GAC_MSIL\Autodesk.Inventor.Interop\v4.0_26.0.0.0__d84147f8b4276564\autodesk.inventor.interop.dll

 

Supported software version is 25

 

Target framework:

.NET Framework 4.8

 

snappyjazz_2-1671219685212.png

 

 

snappyjazz_0-1671219286627.png

 

snappyjazz_1-1671219368585.png

 

snappyjazz_3-1671220420523.png

 

 

Tags (2)
Labels (2)
5 REPLIES 5
Message 2 of 6
JelteDeJong
in reply to: snappyjazz

The first thing you could check is if the addin is started at all. You can do this by adding a msgbox to your: StandardAddInServer.Activate(...)

Also, it's good practice to add a try/catch block around anything you do in that method. That way you will know if anything fails in your code.

Your method would something like this:

Public Sub Activate(AddInSiteObject As ApplicationAddInSite, FirstTime As Boolean) Implements ApplicationAddInServer.Activate
    Try
        MessageBox.Show("Debug message: The addin has been started!")


        ' All your code should go here

    Catch ex As Exception

        ' Show a message if any thing goes wrong.
        MessageBox.Show(ex.Message)

    End Try
End Sub

If you see the message box while starting inventor then your addin is at least loading which means you have most settings correct. And if an exception is thrown you might know where to start looking.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 6

The dll name contains points and may be the issue here.

What I can remember this sometimes gives errors.

Try a different naming.

 

Regards,

 

Arthur Knoors

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 4 of 6
snappyjazz
in reply to: JelteDeJong

Hi @JelteDeJong 

First of all thank you for your input. I put everything in try catches in the Activate sub as you suggested. When I ran it on my computer I got the dialog during startup. However when I copied the .addin, .dll, and .manifest to the uers computer; they did not get the dialog. They didn't get an exception either. Just because I'm curious I commented out all of the code I wrote and uncommented all of the default "Hello World" to run as a test. I got the same results (works on my computer, not on the other users computer).

Message 5 of 6

Hi @BradeneropeArthur
Thanks for taking the time to help me! I just double checked for periods in the dll name and I think what is shown in the screenshots above is the tail of the letter L. I should clarify what's hidden; its just letters, no numbers or special characters.
Message 6 of 6
snappyjazz
in reply to: snappyjazz

I watched Brian Ekins tutorial (Creating Add-Ins for Inventor) on Autodesk University. He makes a post build event, which is something other tutorials advise against. Anyway his build event embeds the manifest file into the dll. You can look into that for more details. But he also copies the files to a different location. After making these two adjustments It worked on the other users computer. The post build event is as follows:

WHERE MT.EXE

IF ERRORLEVEL 1 call "$(DevEnvDir)..\..\VC\Auxiliary\Build\vcvarsall.bat" amd64

mt.exe -manifest "$(ProjectDir)FileName.X.manifest" -outputresource:"$(TargetPath)";#2

xcopy "$(TargetPath)" "%AppData%\Autodesk\ApplicationPlugins\YouFileName\" /Y /R

xcopy "#(ProjectDir)Autodesk.YouFileName.Inventor.addin" "%AppData%\Autodesk\ApplicationPlugins\YouFileName\" /Y /R

 

This has so far worked on all the users so far.

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

Post to forums  

Autodesk Design & Make Report