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
Solved! Go to Solution.
Solved by snappyjazz. Go to Solution.
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.
Blog: hjalte.nl - github.com
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 !
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).
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.