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: 

[VB.Net] INV 2011 Add-In - How to release document object correctley

2 REPLIES 2
Reply
Message 1 of 3
RPdAnjou
309 Views, 2 Replies

[VB.Net] INV 2011 Add-In - How to release document object correctley

Hi all,

 

I've created a Inventor 2011 Add-In using VB.Net with VS2008.

This add-in does all kinds of things, but it will not release some documents.

Well I don't know that for shure but it looks like that.

 

We use Productstream Pro and when changing state of a document it says the document is in use while there are no documents visibly open in Inventor. This only occures when I use my add-in.

 

Exact steps:

  • Load drawing document from PSP
  • Perform action with add-in which gets a custom iProperty from the Part file used on the Drawing and fills the display name of the Drawing with it
  • Save the drawing
  • Close the drawing
  • In PSP try to change state of the part file used on the drawing
  • Get message from PSP stating the part is in use

 

In my code I've tried some things to prevent this behavior but non of them work.

 

I've tried:

  • Setting unused objects to "= Nothing"
  • Releasing objects using "Marshal.ReleaseComObject(obj)"
  • Calling "m_inventorApplication.CloseAllUnreferencedDocs()" and "System.GC.Collect()" on the "m_appEvents_OnTerminateDocument" event.

 

What is going wrong?

2 REPLIES 2
Message 2 of 3
cean_au
in reply to: RPdAnjou

Maybe u need to wait for a few seconds after the drawing is closed.
Message 3 of 3
RPdAnjou
in reply to: cean_au

This waiting period after the close would be the same with and without add-in.

I don't think the two actions on terminate document would take more then a few CPU cycles and I've certainly waited more then a few seconds.

 

Thanks anyway

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

Post to forums  

Autodesk Design & Make Report