From 1e9191897a23ba1fc3aef02f71883644d721bed5 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Fri, 8 Sep 2023 17:09:16 +0200 Subject: [PATCH] Update modelchecker_check.py --- .../checks/modelchecker_check.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/extensions/pyRevitTools.extension/checks/modelchecker_check.py b/extensions/pyRevitTools.extension/checks/modelchecker_check.py index dea4aec04..721b85e67 100644 --- a/extensions/pyRevitTools.extension/checks/modelchecker_check.py +++ b/extensions/pyRevitTools.extension/checks/modelchecker_check.py @@ -3,17 +3,13 @@ import datetime from pyrevit import coreutils -from pyrevit import script from pyrevit import revit, DB from pyrevit.preflight import PreflightTestCase -from pyrevit.compat import safe_strtype - # webpage with explanations of bad practices in revit maybe it could be configurable in the future? WIKI_ARTICLE = "https://www.modelical.com/en/gdocs/revit-arc-best-practices/" - # LISTS # COLORS for chart.js graphs - chartCategories.randomize_colors() sometimes # creates COLORS which are not distunguishable or visible @@ -1154,7 +1150,6 @@ def DocPhases(doc, links = []): print("\n\n\n\n") # elements by workset graph - worksetIds = [] worksetNames = [] graphWorksetsData = [] @@ -1169,9 +1164,11 @@ def DocPhases(doc, links = []): worksetKind = str(worksetTable.GetWorkset(worksetId).Kind) if worksetKind == "UserWorkset": worksetName = worksetTable.GetWorkset(worksetId).Name - if worksetName not in worksetNames: - worksetNames.append(worksetName) - graphWorksetsData.append(worksetName) + if element.Name not in ('DefaultLocation', '', None) or element.Category.Name not in ('', None): + # Removes the location objects from the list as well as empty elements or proxies + if worksetName not in worksetNames: + worksetNames.append(worksetName) + graphWorksetsData.append(worksetName) # print worksetNames # sorting results in chart legend worksetNames.sort()