-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Preflight checks hackathon 2024 #2454
Open
jmcouffin
wants to merge
30
commits into
develop
Choose a base branch
from
Preflight-Checks_Hackathon_2024
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+959
−37
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This Error has been lingering for a while, I decided to give it a shot. Causes: 1- Document is not workshared, OR 2- The script is trying to get the .Name and .Category of document objects that doesn't own these attribute objects, this is typical for dependent elements such as sketchplanes, graphicOverrides, roomboundaries. Solution: Filter out element that doesn't have a name or a category and sort them under a seperate list called "Unassigned" Give it a try.
This Model Checker swiftly verifies the extents of the Revit model. Placing model extents more than 10 miles from the project's internal origin can lead to issues with accuracy, tolerance, performance, and viewport display. This check ensures that the model remains within a 10-mile radius of the internal origin.
Fix Model Checker Attribute Error
Create radar_check.py
Made the changes below per Jean-Marc's feedback. 1- you may want to present digits results in a tabular form for readability and ease in comparison. Response: Added output.print_table 2- the project base point cannot be placed at more than 10 miles in more recent version of Revit Response: Good to know! I removed the report for the location of the project basept. 3- you may want to use the convert unit util to display the distances in the same units as in the UI Response: I used the unitutils to convert the internal distances to the model distances, however in metric I am having hard time to show the suffix (mm, M, km)....etc 4- you may want to limit the amount of objects output in the output windows using linkify as it may greatly slow the tool Response: Set the limit of linkify to 10 prints per category, if there are more violating objects, then it will show a message "Manual investigation is required" 5- I tend to prefer print_md over print_html as it is more efficient and improves readability Response: I switched most of them to use print_md. also I used pyrevit emojis instead of html colors. please take a look and let me know if this makes sense.
Update radar_check.py - Rev1
My proposal for a comprehensive audit of cad instances. See details described in the ModelChecker class comments. It would replace the old LISTDWGs by F. Beaupere, from the Project panel, link tools. Bonus: It also extends the basic functionality of RPW by adding radio buttons and a cancel button.
Updated the script for better compliance and fixed issues reported by @jmcouffin and @dosymep
Update radar_check.py - Code Cleanup, expanding tabulated info
This code is based on a true story. Naming conventions are the foundation of a project. Naming is essential for model checks, filters, and view settings. Until now, I created my checks using Revit export text files with Power-BI. PyRevit enables continuous checking of all categories against their predefined names with just a click.
Added basic rounding for coordinates for better readability,
A template for a loadable .json file. Just a list of strings.
update extionsion.py added. file.json template list-template added.
replace static path by select_file(*.json)
add rpw module
add a default path, just for having more confort
Update radar_check.py - Rounding Coordinates
…/checks/wall_list.json
walltypes_naming_convention_check
Create CADAUDIT_check.py
jmcouffin
added
the
Extension Checks
Issues related to pyRevit extension checks [subsystem]
label
Nov 4, 2024
jmcouffin
requested review from
sanzoghenzo,
dosymep,
eirannejad,
GiuseppeDotto and
thumDer
November 4, 2024 21:18
I'm not qualified to judge this since I never used the model checker and I don't use Revit/pyRevit - i just develop code for my colleagues! I just can give an opinion on the code itself
PS: I realize just now that the notion page example has unneeded lines (all the methods that have only a |
Hi Jean-Marc!
I'm still on holiday this week but next week I can also take a look at them on monday, or tuesday the latest.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Andrea Ghensi ***@***.***>
Sent: Tuesday, November 5, 2024 9:21:53 PM
To: pyrevitlabs/pyRevit ***@***.***>
Cc: Tamás Déri ***@***.***>; Mention ***@***.***>
Subject: Re: [pyrevitlabs/pyRevit] Preflight checks hackathon 2024 (PR #2454)
I'm not qualified to judge this since I never used the model checker and I don't use Revit/pyRevit - i just develop code for my colleagues!
I just can give an opinion on the code itself
1. radar check: it needs a lot of love! in order of importance
* the doc global variable is used inside the function that have the document argument; while not a problem in this specific case, it results in functions that are not portable;
* one of the function returns a constant (INTERNAL_ORIGIN) that is then rewritten to itself; this is unneeded cognitive load.
* there's a class with a single method that never accesses self, so it should be a function!
* some functions are too long and returns many variables; it is more or less trivial to split them into smaller, simpler functions
* some functions are called twice or more with the same parameters, the result should be stored in a variable and reused
* other un-pythonic things here and there, formatting needs some fixes
2. cad audit: medium complexity, medium code quality 😅
* collect_cadinstances gets called two times, the second time just to get the length of the list... wasted CPU cycles here
* the timer is initialized above the function that needs to be timed, but this means that it is started when the file is loaded and not when the function is actually called! I would put it either inside of the function or move the timing inside the startTest method
* there's a bunch of appends one after another, it is better to just create the list with the elements in it at once
* (not sure on this one, but couldn't the two static methods of ButtonClass just be functions?)
* there are a bit of repeated code, that can also use more calls to the pyrevit library
* other un-pythonic things here and there
3. walltypes: the simplest and cleanest one, but there are still some design choices I would have avoided:
* uses a json file just for a list of strings, it might be just a plain text file
* lists are used where generators or sets would be better choices (less memory usage and faster membership checks)
* hardcoded path that couls pose a problem for clones not in the default location
* the found key is not used, it wastes memory
* the value of the wrong key could be computed with a difference between sets and stored in a variable by its own for easier access
PS: I realize just now that the notion page example has unneeded lines (all the methods that have only a pass statement should be removed) that propagated to all the contestant's code 😅
—
Reply to this email directly, view it on GitHub<#2454 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANAHQJEM3ONASHCJQPCKX43Z7EZHDAVCNFSM6AAAAABRFEISKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJYGE3TGOBVHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys,
@dosymep @sanzoghenzo @eirannejad @GiuseppeDotto @thumDer
@dnenov @davidvadkerti @dariaivanciucova
Would you give care to give me your evaluation of the work done by the few preflight checks hackathon participants?
It should not take you long, I hope to collect your input to provide the results by next monday.
set the order and add comments following my template to evaluate: