VBNet code required for closing 'Open Documents in Session'

VBNet code required for closing 'Open Documents in Session'

Anonymous
Not applicable
732 Views
5 Replies
Message 1 of 6

VBNet code required for closing 'Open Documents in Session'

Anonymous
Not applicable

Hi all,

Using VB.Net 2010 I am able to create/copy a new 'Standard' Project (silent operation).
My Standard Project has some sub-assemblies and parts. In the new 'Standard' Project some sub-assemblies are replaced with the new sub-assemblies using silent operation. The new sub-assemblies are also created/copied with VB.Net. When the replacements are done Inventor opens the new 'Standard' Project. All works fine no challenges here.

The challenge is that when I close the new 'Standard' Project there are still 'Open Documents in Session' and therefore I am unable to start the program again unless I close and restart Inventor. My guess is that I am not cleaning up Inventor's memory.

Can someone please point me in the right direction.
Many thanks in advance.

0 Likes
733 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

Hi again,

 

InvCompOcc = Nothing

InvComOccEnum = Nothing

docFile = Nothing

 

do not give me the result I am looking for, there are still 'Open Documents in Session'

0 Likes
Message 3 of 6

nagwani
Alumni
Alumni

Hi There,

 

Have you tried Documents.CloseAll().

 

-Ishwar

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi Ishwar,


Thanks for your suggestion but I was a bit unclear. The program is not closing the assembly, it is the user who closes the assembly, that where this issue occures.

 

JJ

0 Likes
Message 5 of 6

amitnkukanur
Collaborator
Collaborator

Hi,

 

Did you find the way to close all documents, because i am also dealing with same issue.

 

 

rgds

Amit

Senior Software Engineer
0 Likes
Message 6 of 6

Anonymous
Not applicable
0 Likes