Skip to content
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

Full audit #2503

Draft
wants to merge 35 commits into
base: develop
Choose a base branch
from
Draft

Full audit #2503

wants to merge 35 commits into from

Conversation

jmcouffin
Copy link
Contributor

@jmcouffin jmcouffin commented Jan 7, 2025

Preflight audit of all models, including linked models.

⚠️ Links must be loaded

This QC tools returns the following data:

  • project name, number, client, phases, worksets
  • element count
  • purgeable elements count
  • all warnings count
  • critical warnings count
  • rvtlinks count
  • activated analytical model elements count
  • rooms count
  • unplaced rooms count
  • sheets count
  • views count
  • views not on sheets
  • schedules not sheeted count
  • copied views count
  • view templates count
  • unused view templates count
  • filters count
  • unused view filters count
  • materials count
  • line patterns count
  • dwgs count
  • linked dwg count
  • inplace family count
  • not parametric families count
  • family count
  • imports subcats count
  • generic models types count
  • detail components count
  • text notes types count
  • text notes types with width factor != 1
  • text notes count
  • text notes with allCaps applied
  • detail groups count
  • detail groups types count
  • model group count
  • model group type count
  • reference planes count
  • unnamed reference planes count
  • detail lines count
  • dimension types count
  • dimension count
  • dimension overrides count
  • revision clouds count

@jmcouffin jmcouffin requested a review from sanzoghenzo January 7, 2025 23:46
Copy link
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick first review, I didn't check the query module yet.
Just thinking out loud: I get that you wanted to separate the data collection from the output, but since the logic is already in the query module, wouldn't it be better to group the the data variables to the related frame and then split each group to its own function?

@jmcouffin
Copy link
Contributor Author

I still need to review the numbers outputed and maybe get to solve why the document is not properly stored / cached

Copy link
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's time to roast the config module 😅

Copy link
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another quick go at the main script.

Since this is a new file, I would start to enforce a bit of formatting rules.
black has good defaults and it is already installed in the pipenv, so you just need to

pipenv run black extensions/pyRevitTools.extension/checks/audit_all_check.py

jmcouffin and others added 5 commits January 9, 2025 21:00
Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
…eflight Checks.pushbutton/config.py

Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
…eflight Checks.pushbutton/config.py

Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
…eflight Checks.pushbutton/config.py

Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
Copy link
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments on the query, but this is because it's late...

In general, I have a few points to make:

  • why return a list of item and it's count instead of using len(items) where it is needed?
  • the ToElement() should never be None, at most it is an empty list, so all the is None checks are useless. Or am I missing something?
  • use pyrevit.revit.db.query module more 😉 like get_elements_by_class... and if there are missing functionality, add it there

pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/preflight/query.py Outdated Show resolved Hide resolved
Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
@jmcouffin
Copy link
Contributor Author

pipenv run black extensions/pyRevitTools.extension/checks/audit_all_check.py

And this is how, once again, you made my day.
Why wasn't using this before... ?
Thanks
@sanzoghenzo

@jmcouffin
Copy link
Contributor Author

pipenv run black extensions/pyRevitTools.extension/checks/audit_all_check.py

And this is how, once again, you made my day. Why wasn't using this before... ? Thanks @sanzoghenzo

I get it why you want to make it part of the CI actions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants