Open File, Delete Views, Close and Save

Hi guys,
As the title says - I’m looking to background open a revit doc, get all views which are not placed on sheets, delete these views, then close and save the document. The script runs fine with no errors, but when I open the file to check that unplaced views have been deleted, they are still there. Can anybody lead me on the right track? I think I’m 95% there. delete-unused.dyn (39.6 KB)


You’re auditing and detaching the Revit document, so the Revit document in your filepath will not be open.
Is it really what you want ?
Can you retry with audit and detach set to False ?

Hey - yup, when we get multiple files from another consultant, we always audit, detach, clean (purge), then reattached to our host model. I set to false and same result - the document is open throughout the graph, and it even saves as expected at the end - just no views are deleted! Do you think the “audit, detach, clean (purge), reattached” workflow is necessary?

The error was with the FilterByBoolMask node wich was connected to a list of parameters.

1 Like

Alban, thanks for picking out that error! I set up a few watch nodes and eventually disconnected the wait-passthrough node, and it seems it worked - but the only thing is that I need to order of operations to be the last thing that happens and apparently the wait node I’m using is causing something to go wrong. Would you have any insight into how to force the save to be after the delete part?


You were trying to delete elements in the active document with the “Tool.Eraser” node and not in the document Revit from the filePath.

I didn’t find a node to delete elements in another document so I made one.
You will find “Elements Delete from document” node in Genius Loci package.


in which package is the node Super Collect Views from Document?