API to Addin build from template, not loading into inventor

API to Addin build from template, not loading into inventor

Mark_Wigan
Collaborator Collaborator
2,337 Views
14 Replies
Message 1 of 15

API to Addin build from template, not loading into inventor

Mark_Wigan
Collaborator
Collaborator
reading Brian Ekins tutorials just over recent days and had hoped to convert some API over to inventor Addin's.

i have deployed the template wizard from the new SDK files i downloaded last night and successfully generated a new project from visual studio off the inventor template therein. i have run a 'build' from studio successfully, but however so far been unable to get the new Addin to show up in the inventor Addin manaager.

just trying to get these new Addins to load into inventor is the completion of the first stage of which i have hit a brick wall. no doubt it is something small that i am overlooking?

thanks for any help you may offer.

-mark.

inv-pro 2010, windows 7, 64 bit.
best regards,
- Mark

(Kudo or Tag if helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

0 Likes
2,338 Views
14 Replies
Replies (14)
Message 2 of 15

Mike.Wohletz
Collaborator
Collaborator
Have you registered the application using something like this:
{code}

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase yourAddin.dll

{code}

I ask this because if you have and your problem was in your code most of the time it will display in the Addin manager as Loaded\Unloaded. from what you have said it does not show up at all..

{code}

i have run a 'build' from studio successfully, but however so far been unable to get the new Addin to show up in the inventor Addin manaager.

{code} Edited by: mike.wohletz on Jan 29, 2010 12:17 PM
0 Likes
Message 3 of 15

Mark_Wigan
Collaborator
Collaborator
thanks. you are correct.

i have success.

http://modthemachine.typepad.com/my_weblog/2008/10/converting-vba-auto-macros-to-an-add-in.html
best regards,
- Mark

(Kudo or Tag if helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

0 Likes
Message 4 of 15

kmiller
Collaborator
Collaborator
Hi there,

I am having the same issue as first noted above with the add-in not showing up. However I am just trying to go through Brian's handout step by step with a new project. Because I am new at this whole thing so I thought it would be a good start for learning. I am not sure how to check the registration as noted above for the fix to see if that is my problem. Also, I am running Inventor 2011 64-bit but I am pretty sure my VB 2008 express is installed as a 32-bit app on a 64-bit OS. Is that going to cause any additional errors? I have installed the dev tools and wizards as directed and started the project from the Autodesk Inventor Add-in Template as well as had a successful build. I am wondering too if maybe something in VB express or inventor app options may be messed up. Any help would be greatly appreciated.

Thanks from the newbie!
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 5 of 15

Mike.Wohletz
Collaborator
Collaborator
visual basic is always a 32bit application and that should not matter for your project, could you open inventor and look on the tools tab in the options panel click the add-ins button and see if your application shows up. if it does show up then does it show that it is loaded or not, if it is not loaded then you have some errors in your code that is causing it to be unloaded, if it is loaded and you do not have any buttons then the problem would be in the adding the buttons portion of the code. If you could post your code someone may be able to help more with your problem.
0 Likes
Message 6 of 15

kmiller
Collaborator
Collaborator
First off, Thank you for taking the time to respond.

Secondly, my addin doesn't show up at all in the add-in manager list. There isn't any custom code written yet in it. I basically just started a project from scratch with the template and hit the build option. However from the documents I am reading it gives me the impression that the add-in should still load up to show it's "connecting" with inventor.

Is there a certain spot that the add-in's/project files need to be saved in order to load in with inventor?

Maybe I am just not locating things correctly.
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 7 of 15

Mike.Wohletz
Collaborator
Collaborator
the build is only going to build the dll that is needed to register as the add-in, after you build the project you will have to register it by using the regasm from the .net framwork tools. if you are installing the dll on a 32bit system then create a bat file in the location of your dll (bin folder) that reads like this:

{code}

@echo off
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase yourappname.dll
PAUSE


{code}

for registering it on a 64bit machine the bat file will be like this:

{code}

@echo off
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase yourappname.dll
PAUSE


{code}

then when you start Inventor you will see it in the add-in manager..

hope that this helps....
Mike
0 Likes
Message 8 of 15

kmiller
Collaborator
Collaborator
Hey there, Yup I believe it all seemed to work. I made the batch file with the code you specified and placed it in the bin folder with the dll. I did get a warning when running the batch file about how registering an unassigned assembly with /codebase can cause interference with other assemblies but I am assuming this is a normal warning since everything worked good?

How does the exe know where the dll is located? Assuming it just searchs the computer's hard drive for it or does it recognize it because the batch is in the same location as the dll? If I am understanding it correctly, once it's registered it's set in the registry as an inventor application and then inventor knows to automatically load it?

Thanks for the help.
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 9 of 15

Mike.Wohletz
Collaborator
Collaborator
The batch file must be in the same folder as the .dll with the sample I gave you, and yes it is added to the registry as to how Inventor knows how to use it. now if you want to uninstall this app it is done like this for a 32 bit system.

{code}

@echo off
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister yourApplication.dll
PAUSE

{code}

for 64 bit systems change the framework path to match what was used to register the application.
keep reading Brians blog page and you will be set..

Mike
0 Likes
Message 10 of 15

Anonymous
Not applicable
Whether you are registering or unregistering you don't have to have the batch file in the same location as the dll if you spell out the path to the dll:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister "C:\My Path\yourApplication.dll"

Double quotes are necessary only if there is at least 1 space in the path and/or dll file name.
0 Likes
Message 11 of 15

kmiller
Collaborator
Collaborator
SWEET! Oh Thank You to you both!!! I appreciate everything, even the additional info. When you are starting out sometimes it's hard to even know what options are available or what questions to ask. So whiling advice from the guru's is the best!

Have a WONDERFUL DAY!

Katie
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 12 of 15

kmiller
Collaborator
Collaborator
Ok, dumb question but I just want to make sure I understand what is going on. When you register the add-in with the batch file is the batch file and using the regasm function what is actually pushing all the information needed into the necessary areas of the registry? (hence registering it).
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 13 of 15

Anonymous
Not applicable
Yes. I can't tell you where and how many registry entries it makes but if you somehow knew, you could create an application (VB6, VB.NET, C#, C++, etc) that could do the same thing as the batch file. VB6 would have to declare certain Window system DLL routines to do the work. Newer programming interfaces have this functionality built in.
0 Likes
Message 14 of 15

kmiller
Collaborator
Collaborator
Thanks, reading the comments again I figured the answer was yes but I do always have an excuse because I can just say I had a blonde moment! 🐵 hehehe... *winks*

Katie

PS - I am blonde, so apologies for those of you that actually take those jokes offensively. But there are some pretty good ones out there and I am sure some of them have been proven. ;o) Edited by: kmiller@coldspringgranite.com on May 4, 2010 9:51 AM
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Message 15 of 15

Anonymous
Not applicable

There's some good information here.  If I'm using VS2008, framework 3.5, do I have to change anything in the template (from addin wizard) that comes with Inventor 2011?  Inventor configuration file references 2.0.50727 and the system reference shows the same.  Is that OK?

 

JH

0 Likes