- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @tmathieson
@tmathieson wrote:
but, of course, i now have another issue...
basic program is...
- input parameters
- delete components from assembly (save assembly)
- insert new components
- delete component from directory if it exists
- rename and save component
- adds mates, etc, repeat
the program works fine the first time thru. but if i go to run it again, i get an error with the 1st component 'SaveAs' as shown here. if i save the assembly, close it and open it up again, it runs the way it should. any idea what the issue might be, something stuck in memory that gets cleared out when i close the file...
Hi @tmathieson
I think I've run into this in the past. The issue might be due to deleting the file on disk, but it still exists in the active document's referenced document collection. Try something like this to unload the document's from memory.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'remove document references from memory For Each xDoc In ThisDoc.Document.AllReferencedDocuments Logger.Info(xDoc.FullFileName) Try xDoc.close Catch 'Logger.Info(xDoc.FullFileName) End Try Next