diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Last Edited By Me In Current View.pushbutton/script.py b/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Last Edited By Me In Current View.pushbutton/script.py index 43f0ff8b0..39e47a86f 100644 --- a/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Last Edited By Me In Current View.pushbutton/script.py +++ b/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Last Edited By Me In Current View.pushbutton/script.py @@ -4,20 +4,19 @@ from pyrevit import forms -filteredlist = [] -viewlist = [] +owned_by_me = [] +views = [] selection = revit.get_selection() if revit.doc.IsWorkshared: - viewlist.append(revit.active_view.Id) + views.append(revit.active_view.Id) if isinstance(revit.active_view, DB.ViewSheet): vportids = revit.active_view.GetAllViewports() for vportid in vportids: - viewlist.append(revit.doc.GetElement(vportid).ViewId) - for view in viewlist: - curviewelements = DB.FilteredElementCollector(revit.doc)\ - .OwnedByView(view)\ + views.append(revit.doc.GetElement(vportid).ViewId) + for view in views: + curviewelements = DB.FilteredElementCollector(revit.doc, view)\ .WhereElementIsNotElementType()\ .ToElements() @@ -27,9 +26,7 @@ el.Id) # wti.Creator, wti.Owner, wti.LastChangedBy if wti.LastChangedBy == HOST_APP.username: - filteredlist.append(el.Id) - selection.set_to(filteredlist) - else: - pass + owned_by_me.append(el.Id) + selection.set_to(owned_by_me) else: forms.alert('Model is not workshared.') diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Owned By Me In Current View.pushbutton/script.py b/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Owned By Me In Current View.pushbutton/script.py index 15a814e8d..42510a5ef 100644 --- a/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Owned By Me In Current View.pushbutton/script.py +++ b/extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools2.stack/Team.pulldown/Select Owned By Me In Current View.pushbutton/script.py @@ -4,21 +4,20 @@ from pyrevit import forms -filteredlist = [] -viewlist = [] +owned_by_me = [] +views = [] selection = revit.get_selection() if revit.doc.IsWorkshared: currentviewid = revit.active_view.Id - viewlist.append(currentviewid) + views.append(currentviewid) if isinstance(revit.active_view, DB.ViewSheet): vportids = revit.active_view.GetAllViewports() for vportid in vportids: - viewlist.append(revit.doc.GetElement(vportid).ViewId) - for view in viewlist: - curviewelements = DB.FilteredElementCollector(revit.doc)\ - .OwnedByView(view)\ + views.append(revit.doc.GetElement(vportid).ViewId) + for view in views: + curviewelements = DB.FilteredElementCollector(revit.doc, view)\ .WhereElementIsNotElementType()\ .ToElements() @@ -28,9 +27,7 @@ el.Id) # wti.Creator, wti.Owner, wti.LastChangedBy if wti.Owner == HOST_APP.username: - filteredlist.append(el.Id) - selection.set_to(filteredlist) - else: - pass + owned_by_me.append(el.Id) + selection.set_to(owned_by_me) else: forms.alert('Model is not workshared.')