Code block: views

Hi,

This is one way to get the view by name, the long and non-efficient way ofc.
I don’t know how would you get the view without a collector in design script.

doc = Document.Current;
view_Category = Revit.Category.ByName("Views");
col = Collector.ElementsOfCategoryInDocument(doc, view_Category);
filtered = ElementFilter.ByName(col,"Level 1","Equal",true);
cleaned = DSCore.List.Clean(filtered,false);
DSCore.List.Flatten(cleaned);

image

Hope it helps a bit.

2 Likes