-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#975 new tool pyRevit Health Check #1014
Conversation
The fact that the threshold are hardcoded is an issue. They are very subjective.
Maybe in a separate process. One that you need to launch to setup the threshold choice once for the project. and stored in the project file as a parameter like ThresholdSpecId. |
another thing that needs some fixing in the code: you are using the lookup parameter function twice, therefore some of the model check do not work properly when using Revit in another language. |
Ok, I will try to fix these issues. Thanks for the review :) |
I would have fixed it, but did not have time. Excellent tool Davide.
Le sam. 24 oct. 2020 12:24, davidvadkerti <notifications@github.com> a
écrit :
… Ok, I will try to fix these issues. Thanks for the review :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1014 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4B4A45PUIEWIL22BHWGSLSMKTORANCNFSM4R5BEEKA>
.
|
check that in the remarks section. |
from line 157:
line 334:
|
Thanks for the help, I will try to finally fix it this week. |
I just edited the line numbers. I messed up ;p |
I have issue drawing the Chart.js chart with any accented values. I think there should be some smarter workaround but I was just happy using my crappy workflow with function removing accents - Try to uncomment line 423 if it makes any change: Another issue is filtering out categories which I find not usefull to show. I should probably rather compare BuiltInCategories instead of Category.Names. - line 414 |
yep the accents issue is huge, the names of parameters also., uncommenting did not work |
a |
|
and
after the for loop on # INPLACE CATEGORY GRAPH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added all the stuff I left in the comments. It now works in Revit in French and I am guessing in many other languages
for i in graphFCatHeadings: | ||
count=graphFCatData.count(i) | ||
fCatSet.append(count) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
graphFCatData = [x.encode('utf8') for x in graphFCatData]
graphFCatHeadings = [x.encode('utf8') for x in graphFCatHeadings]
for i in graphCatHeadings: | ||
count=graphCatData.count(i) | ||
catSet.append(count) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
graphCatHeadings = [x.encode('UTF8') for x in graphCatHeadings]
for view in view_elements: | ||
viewName = view.LookupParameter('View Name') | ||
try: | ||
viewNameString = viewName.AsString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewNameString = revit.query.get_name(view)
textNoteType_collector = FilteredElementCollector(doc).OfClass(TextNoteType).ToElements() | ||
textnoteWFcount = 0 | ||
for textnote in textNoteType_collector: | ||
widthFactor = textnote.LookupParameter('Width Factor').AsDouble() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
widthFactor = textnote.get_Parameter(DB.BuiltInParameter.TEXT_WIDTH_SCALE).AsDouble()
… critical warning list changed to list of GUID, catBanlist changed to list of IDs
'Area is not in a properly enclosed region', | ||
"Rectangular opening doesn't cut its host", | ||
'Elements have duplicate "Number" values',] | ||
# citical warnings Guids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed Critical warning list to list of GUIDs. Now it is compatible to other laguages than english. I am not sure if there is some better identifier than GUIDs.
# catBanlist = ['Shared Site','Project Information','Structural Load Cases','Sun Path','Color Fill Schema','HVAC Zones','HVAC Load Schedules','Building Type Settings', | ||
# 'Space Type Settings','Survey Point','Project Base Point','Electrical Demand Factor Definitions','Electrical Load Classifications','Panel Schedule Templates - Branch Panel', | ||
# 'Panel Schedule Templates - Data Panel','Panel Schedule Templates - Switchboard','Electrical Load Classification Parameter Element','Automatic Sketch Dimensions',] | ||
catBanlist = [-2000110,-2003101,-2005210,-2009609,-2000552,-2008107,-2008121,-2008120,-2008119,-2001272,-2001271,-2008142,-2008143,-2008145,-2008147,-2008146,-2008148,-2000261,] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catBanlist - list of categories not show is changed to list of category IDs
worksetsSet=[] | ||
for i in worksetNames: | ||
count=graphWorksetsData.count(i) | ||
worksetsSet.append(count) | ||
worksetNames = [x.encode('utf8') for x in worksetNames] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added encoding also for worksets, if there was an accent in Workset name it caused an error
I remember I tried x.encode() not in the list comprehension but inside the loop and it didn't work. I must have done something wrong. Thanks for the correction :) |
I've tested french, czech, russian and japaneese versions of Revit and it seemed the accents issue should be fixed now. But I can't speak these languages except of czech. I've just looked for glitches in the text. You mentioned I should store threshold values in the project. I was trying to find out how to create new Shared Parameter using Revit API but haven't succeed yet. I've tried to use rsparam module but I've managed just to create new empty Shared Parameter file. Do you have some reference which could I use? Thanks for the help and for the patience with me :) |
That is a great tool that has a great potential and will attract people to pyrevit imho @davidvadkerti @eirannejad it should have its own push-button visible in the ui, I think |
Working on merging the PRs today and publishing the v4.8.4 |
Merged for review |
@jmcouffin @davidvadkerti Thanks a lot for all the work on this. I merged this for review and ended up combining it with another idea I had that never got around to implement. The Preflight Checks Switch to the pyRevit extensions, can now define any checks ( Run the preflight checks tool from here: You should see the selection window popup with your test listed in there: I moved the model checker to class ModelChecker(PreflightTestCase):
"""Revit model quality check"""
name = "Model Checker"
author = "David Vadkerti"
def setUp(self, doc, output):
pass
def startTest(self, doc, output):
timer = coreutils.Timer()
checkModel(doc, output)
endtime = timer.get_time()
endtime_hms = str(datetime.timedelta(seconds=endtime))
endtime_hms_claim = "Transaction took " + endtime_hms
print(endtime_hms_claim)
def tearDown(self, doc, output):
pass
def doCleanups(self, doc, output):
pass I moved all the test logic tentatively to Let's do a good cleanup on this script (split the code into logical functions, comment the code, etc.) and prepare for the feature release 👍 PS |
Let's cleanup the script and I'll improve the Preflight user interface meanwhile. Please checkout this branch, make your changes and send a PR to this branch as well. |
Would it be possible to add the following Preflightchecks? Location: Files: Duplication Marks:
Areas:
Links:
Misc
|
The list in itself makes sense, but it feels like a grocery list anyway. |
I've finally found some time to add the Model Checker tool.
Unfortunatelly I am sure few things are not done the best way. I wrote them also in the comments: