Can't Delete Views

I can’t for the life of me figure out how to get this to work. I can delete views if I use the code block named, “Seatch Terms - Change per Discipline” located in the blue group named “Remove Views 1”

If I use the dictionary to the left or another code block it will not delete it. I get this error on the element.delete node:

Warning: Element.Delete operation failed. ElementId cannot be deleted. Parameter name: element Id.

Revit Dev - Project Startup.dyn (177.7 KB)

I think I just figured it out. I forgot to include the standards sub-discipline which I use for the open page. Anything special about that view which make it stop the element.delete node from working?

If you could show us the results drop down from the Bool Mask we may be able to better trouble shoot. There are a few things like groups or phasing that may cause issues sometimes, or pinned elements even.

1 Like

Might not be able to delete a view if it is referenced by a viewport (aka placed on a sheet). Total guess though.

It was definitly me not including the Open page, or default view in the views not to delete. Once I did that it works.

1 Like