10-21-2022
05:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-21-2022
05:42 AM
Hi @filippo.costantin3HZMT. If you just need to open the document so you can read or edit its iProperty, then close it again, there is an easier, and more logical way to do that.
Instead of:
Call AddComponent(file)
...use this:
Dim oFileDoc As Document = ThisApplication.Documents.Open(file, False)
...then, instead of this:
Call DeleteComponent()
...use this:
oFileDoc.Close(True) 'True = skip save
Or, instead of the oFileDoc.Close, you might also be able to use the following routine:
oFileDoc.ReleaseReference
...but then, after the end of the loop, if you used the ReleaseReference method, you can use this:
ThisApplication.Documents.CloseAll(True) 'True = only close all unreferenced documents
Wesley Crihfield
(Not an Autodesk Employee)