Purge Views

Hello Dyno Users!

I’m writing a script for my upper classmates, however I am getting stuck towards the end? The intention is to filter through all the views, and check if each view has three parameters filled out. If not, they are deleted in order to keep browser organization, and remove ??? folders.

Please help me figure out how to filter a list of repeated items into a Bool filter the views that have the parameters, and the ones that don’t.


Purge Views.dyn (33.7 KB)

image

You need to check for String.Empty or “” as well because string parameters can have a “value” of nothing which is what you are seeing.

Then you can use a List.AnyFalse to find the ones that are missing any value within the 3 parameters.

Keep in mind that deleting views is an unrecoverable action in Revit (workshared models) for some reason.
If you end up deleting the wrong views because perhaps someone forgot to fill in the parameters the view is lost and cant be recovered, unless you rollback with a backup revit file…

1 Like