Closing document if referenced by open assembly

Closing document if referenced by open assembly

johnster100
Collaborator Collaborator
334 Views
2 Replies
Message 1 of 3

Closing document if referenced by open assembly

johnster100
Collaborator
Collaborator

Hi,

is it ok to close a part a document using api:

 

oPart.Close()

 

if it is used in an open assembly in the same inventor session?

 

thanks a lot,

John 

0 Likes
335 Views
2 Replies
Replies (2)
Message 2 of 3

TA.Fehr
Advocate
Advocate

My program routinely calls that when cleaning up after an operation. I have not seen any ill effects. But you'd need to ensure the part is actually open before you call the close command, otherwise you'll get errors.

The assembly that references the part doesn't actually have the part itself open, merely referenced.

 

I'm open to being corrected, but this is my experience.

Message 3 of 3

chandra.shekar.g
Autodesk Support
Autodesk Support

@johnster100,

 

Yes, oPart (PartDocument) should be opened before using oPart.Close() API.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes