Skip to content

Commit

Permalink
Preflight checks: Rearranged the family collection part + added gener…
Browse files Browse the repository at this point in the history
…ic model count as a rectangle in the family section (#1162)

* fixed host adder and added 2020.2.3

* added 2020.1.1 to hosts

* added try/except to wipe collaboration cache tool to handle case when there is no cache folder in a version of revit

* Changed the way checker handles the unloaded links for rvtlinks and rvtlinks phases section

* Revert "added try/except to wipe collaboration cache tool to handle case when there is no cache folder in a version of revit"

This reverts commit f2fca00.

* rearranged the family collection part + added generic model count as rectangle

Co-authored-by: Ehsan Iran-Nejad <eirannejad@gmail.com>
  • Loading branch information
jmcouffin and eirannejad committed Feb 9, 2021
1 parent d0ec4d4 commit fe3935c
Showing 1 changed file with 68 additions and 59 deletions.
127 changes: 68 additions & 59 deletions extensions/pyRevitTools.extension/checks/modelchecker_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,11 @@ def DocPhases(doc, links = []):
familiesTres = 500
if familyCount < 500:
inPlaceFamilyTres = familyCount * 0.2
genericModelTres = familyCount * 0.2
else:
inPlaceFamilyTres = 500 * 0.2
notParamFamiliesTres = familyCount * 0.3
inPlaceFamilyTres = familiesTres * 0.2
genericModelTres = familiesTres * 0.2
notParamFamiliesTres = familyCount * 0.3
#TextNotes
textnoteWFtres = 0
textnoteCaps = 0
Expand Down Expand Up @@ -875,6 +877,64 @@ def DocPhases(doc, links = []):
# print Loadable Families section header
output.print_md("# Loadable Families")

# data for category graph
graphCatHeadings = []
graphCatData = []
elements = (
DB.FilteredElementCollector(doc)
.WhereElementIsNotElementType()
.ToElements()
)

catBanlist = [
-2000110,
-2003101,
-2005210,
-2009609,
-2000552,
-2008107,
-2008121,
-2008120,
-2008119,
-2001272,
-2001271,
-2008142,
-2008143,
-2008145,
-2008147,
-2008146,
-2008148,
-2000261,
]
generic_model_elements = []
generic_model_elements_count = 0
for element in elements:
try:
category = element.Category.Name
categoryId = element.Category.Id.IntegerValue
# filtering out DWGs and DXFs, categories from banlist
# filtering out categories in catBanlist
# DB.BuiltInCategory Ids are negative integers
if categoryId < 0 and categoryId not in catBanlist:
if category not in graphCatHeadings:
graphCatHeadings.append(category)
graphCatData.append(category)
if categoryId == -2000151:
generic_model_elements.append(category)
except:
pass
# Generic model count
generic_model_elements_count = len(generic_model_elements)
catSet = []
# sorting results in chart legend
graphCatHeadings.sort()
for i in graphCatHeadings:
count = graphCatData.count(i)
catSet.append(count)


graphCatHeadings = [x.encode("UTF8") for x in graphCatHeadings]

# Make row
htmlRowLoadableFamilies = (
dashboardRectMaker(familyCount, "Families", familiesTres)
Expand All @@ -888,9 +948,15 @@ def DocPhases(doc, links = []):
"Families <br>not parametric",
notParamFamiliesTres
)
+ dashboardRectMaker(
generic_model_elements_count,
"Generic models",
genericModelTres
)
)
dashboardLeftMaker(htmlRowLoadableFamilies)


if inPlaceFamilyCount != 0:
# INPLACE CATEGORY GRAPH
fCatSet = []
Expand Down Expand Up @@ -1031,63 +1097,6 @@ def DocPhases(doc, links = []):
# divider
print("\n\n\n\n")

# data for category graph
graphCatHeadings = []
graphCatData = []
elements = (
DB.FilteredElementCollector(doc)
.WhereElementIsNotElementType()
.ToElements()
)

catBanlist = [
-2000110,
-2003101,
-2005210,
-2009609,
-2000552,
-2008107,
-2008121,
-2008120,
-2008119,
-2001272,
-2001271,
-2008142,
-2008143,
-2008145,
-2008147,
-2008146,
-2008148,
-2000261,
]

for element in elements:
try:
category = element.Category.Name
categoryId = element.Category.Id.IntegerValue
# filtering out DWGs and DXFs, categories from banlist
# filtering out categories in catBanlist
# DB.BuiltInCategory Ids are negative integers
if categoryId < 0 and categoryId not in catBanlist:
if category not in graphCatHeadings:
graphCatHeadings.append(category)
graphCatData.append(category)
except:
pass

catSet = []
# sorting results in chart legend
graphCatHeadings.sort()
for i in graphCatHeadings:
count = graphCatData.count(i)
catSet.append(count)

graphCatHeadings = [x.encode("UTF8") for x in graphCatHeadings]

# for debugging
# print graphCatHeadings
# print catSet

# categories OUTPUT
chartCategories = output.make_doughnut_chart()
chartCategories.options.title = {
Expand Down

0 comments on commit fe3935c

Please sign in to comment.