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 models audit #2503

Merged
merged 86 commits into from
Jan 31, 2025
Merged

Full models audit #2503

merged 86 commits into from
Jan 31, 2025

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

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
@jmcouffin jmcouffin marked this pull request as ready for review January 28, 2025 11:05
@jmcouffin
Copy link
Contributor Author

Hi @sanzoghenzo
That puppy is ready for your review. I put a lot of love into this one. Hoping this won't be too painful to look at 😄

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.

I may have gone too hard on some things, feel free to pick whatever advice you want 😉

pyrevitlib/pyrevit/output/cards.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/output/cards.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/output/cards.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/revit/db/query.py Outdated Show resolved Hide resolved
@jmcouffin
Copy link
Contributor Author

I may have gone too hard on some things, feel free to pick whatever advice you want 😉

Never mad. This is all constructive criticism.
Will look at it later
Thanks

@jmcouffin
Copy link
Contributor Author

I went through the whole thing! Damned... a beast of a refactoring. I learned a lot. Thanks @sanzoghenzo

I am ready to merge except for that one SOB groups counting... for the life of me, I spend way too much time on this.
in a very simple homemade sample, the count is right, in the revit arch sample it is off...

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.

Last one: since there are no None checks in place, avoid having the function arguments default to it

pyrevitlib/pyrevit/revit/db/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/revit/db/query.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/revit/db/count.py Outdated Show resolved Hide resolved
pyrevitlib/pyrevit/revit/db/count.py Show resolved Hide resolved
@sanzoghenzo sanzoghenzo self-requested a review January 30, 2025 18:02
sanzoghenzo
sanzoghenzo previously approved these changes Jan 30, 2025
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.

Looks good to me!

@jmcouffin jmcouffin merged commit aad57e1 into pyrevitlabs:develop Jan 31, 2025
@jmcouffin jmcouffin deleted the full-audit branch January 31, 2025 16:56
@jmcouffin
Copy link
Contributor Author

The puppy is out in the wild.
Thank you so much @sanzoghenzo for the comments!

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25031+1700-wip

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