Is there a way to "purge" all the unreferenced documents in Inventor ?

Issue

I need a way to "purge" all the unreferenced documents. Is there a method available to do this?

Solution

The Documents.CloseAll() method has a Boolean parameter which indicates whether to close only the unreferenced documents. By default the value is false and closes all the documents. Following is the excerpt from the help file explaining the Boolean parameter UnreferencedOnly.

“Public Sub CloseAll( Optional ByVal UnreferencedOnly As Boolean = False)

UnreferencedOnly
Optional input Boolean that indicates whether to close only the unreferenced documents. If not specified, a value of False is assumed and all documents are closed.

Examples of unreferenced documents:

Create a new assembly, place an instance of a part "block.ipt" and then delete the instance in the assembly. At this point, block.ipt is an unreferenced document. Set the Suppressed property of a ComponentOccurrence to True within an API Transaction (or a ChangeProcessor). Assuming that the document that this occurrence was referencing is not referenced elsewhere, it becomes an unreferenced document.


Comments

One response to “Is there a way to "purge" all the unreferenced documents in Inventor ?”

  1. Hi,
    Do you know of a way to purge all the Unreferenced documents, but without clearing all past transactions?
    Using the CloseAll() method has the side effect of clearing the undo stack, and I havn’t found a workaround yet..
    Thanks,
    Alex.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading