Error Diagnosis - Model Clean Up


I’m trying to put together a script to open a file in the background and clean it, much like the post here.

Unfortunately the Collector.ElementsOfTypeInDocument [Rhythm Package] node gives me the following error…
“Warning: Collector.ElementsOfTypeInDocument operation failed.
The managed object is not valid.”

If I stick a watch note out of the Applications.OpenDocumentFile node it gives me “Autodesk.Revit.DB.Document” so I think it’s opening the file perfectly fine… but failing afterwards?

I’ve followed the linked script exactly…does anybody know what this error message means? or how to satisfy it?

Thanks in advance!


The example you linked to had both detach and audit set to true… does yours work with this?



Hi @Mark.Ackerley

Apologies for the late reply, I’ve only just had time to return to this.

I didn’t have any luck by setting the detach and audit values to true, however, I was able to get all views from the project using the Get All Views node from the Genius Loci package (see image).

It’s a great package with some very handy nodes.

Thanks for your help.

1 Like