Message 1 of 4
go to view - "faster"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've read a topic about the section - go to view which works but is slow. or perhaps I don't get it.
Goal:
I select a section and when the script runs, I want to make that section the active view.
Problem:
The section you select is a DB.Element (with category OST_VIEWERS) not a view.
So I have to get the proper view.
Solution:
Suggested in an other topic was: get the corresponding view through FilteredElementCollector.
My approach (python but you get the point):
s = the selected section
if s.Category.Name == "Views":
viewer_name = s.Name
collector = DB.FilteredElementCollector(revit.doc).OfCategory(DB.BuiltInCategory.OST_Views).WhereElementIsNotElementType().ToElements()
for view in collector:
if view.Name == viewer_name:
revit.activeview = view
break
This works, BUT it is slow or at least: it is slower compared to select view, right mouse click, go to view.
So my question: how to improve this?
love python coding