Debuging Inventor Add-In Without restarting program

Debuging Inventor Add-In Without restarting program

Anonymous
Not applicable
1,466 Views
5 Replies
Message 1 of 6

Debuging Inventor Add-In Without restarting program

Anonymous
Not applicable

Hi
I'm starting to write my first Add-In to Inventor.
I went through API tutorial in help.
As I see, when I want to debug my add-in, VS starts new instance of Inventor.
Is there any way to avoid this. Is there any way to connect to existing of Inventor process, and debug the add-in.
Also, when I will build new version of the plugin, will it automaticly reloaded in inventor?

0 Likes
Accepted solutions (2)
1,467 Views
5 Replies
Replies (5)
Message 2 of 6

etaCAD
Advocate
Advocate
Accepted solution

Hi,

in Visual Studio in the menu you click on DEBUG and then on 'Attach to process'. Select the process 'Inventor.exe' and confirm. Then your code stops at break points for debugging..

Andreas

Andreas
etaCAD

0 Likes
Message 3 of 6

pball
Mentor
Mentor
Accepted solution
For your second question. You will have to close Inventor to rebuild the addin but when Inventor is started again it will load the new version automatically.
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 4 of 6

Anonymous
Not applicable

I was afraid of that. I knew that there is an option, to connect to existing thread. But i was thinking that it's not necessary to restart Inventor.
I think, that for developing purpose i will be writing stand alone application, and on the end I will make from it a built in add-in. What do you think about that?

0 Likes
Message 5 of 6

pball
Mentor
Mentor
If you think that work flow will be easier give it a shot. I haven't done anything with stand alone applications for Inventor though. I personally just close and restart Inventor when rebuilding my addin. It doesn't bother me since when I'm working on my addin I'll only be testing things so restarting Inventor doesn't mean anything to me.

Also the reason Inventor needs to restart is because once an addin is loaded Inventor is accessing the dll file and you can't swap that without either unloading it or closing Inventor.
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 6 of 6

Anonymous
Not applicable

Since now, I was writing only Ilogic Rules. But lastly they become much bigger. I wrote rule for creating sheet  numbers for whole project and for counting sheet with the same parts. Now I'm want to write rule for sheet sorting (based on sheet number).

As i have read (I have also tested it), creating standalone rule is much easier than creating an add-in. For example, you are crating any desktop app. In this app yiu can connect to inventor by:

Dim inventorApp As Inventor.Application = Nothing
Try
            inventorApp = Marshal.GetActiveObject("Inventor.Application")
Catch ex As Exception
            MsgBox("Lunch inventor first",, "No inventor instance")
End Try

If you have inventor object, you can do everything with fast debuging. After you will develop all the code, you can move heart of the app to add-in template (and add all the necessary user interface). 

I have created this topic, because I was hoping, that there is a trick for fast debuging an add-in.

Thank you very much for your responses.

0 Likes