-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Obsolete IntegerValue property in Revit2024 and higher - Replaced by Value #2380
Obsolete IntegerValue property in Revit2024 and higher - Replaced by Value #2380
Conversation
replaced by Value
Can I offer a suggestion to avoid code repetition? value_func = lambda x: x.Value if HOST_APP.is_newer_than(2023) else x.IntegerValue or a more verbose, but maybe clearer, function to put in def get_value_func():
def get_value_2024(item):
return item.Value
def get_value_2003(item):
return item.IntegerValue
return get_value_2024 if HOST_APP.is_newer_than(2023) else get_value_2003 so that one can do, for example value_func = get_value_func()
sheet_revids = {value_func(x) for x in self.revit_sheet.GetAllRevisionIds()}
add_sheet_revids = {value_func(x) for x in self.revit_sheet.GetAdditionalRevisionIds()} |
Great advice @sanzoghenzo |
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.
This is not properly in-scope, but while you're at it.... 😉
Just a question: why there were lines like I'm not a Revit API guru, but I expect that Obviously I don't have the full picture, and I didn't check it, but I can see the Equals operator for ElementId in revitapidocs |
@sanzoghenzo would you mind having a quick look. |
I may have broken a thing or two. Time will tell. if isinstance(element, DB.ElementId.InvalidElementId): |
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.
You did a hell of a job!
some of the variables are enum items, so we should use the value to compare them.
I suggested only one place in which to use DB.ElementId.InvalidElementId (it's not a type so we should use comparison operators and not isinstance
), but there may be other places it can be used.
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...anel/select.stack/Select.pulldown/Find And Select Entities Without Tags.pushbutton/script.py
Show resolved
Hide resolved
...anel/select.stack/Select.pulldown/Find And Select Entities Without Tags.pushbutton/script.py
Outdated
Show resolved
Hide resolved
Argh, I was going to suggest you to do a merge with squash to avoid all those commits in the git log 😅 It's getting harder and harder browse the commit history with all those single file commits.... |
📦 New work-in-progress (wip) builds are available for 5.0.0.24242+0910-wip |
📦 New work-in-progress (wip) builds are available for 5.0.0.24246+1410-wip |
Did you test this PR? It is broken since you used I'll fix it after lunch |
|
That error is the one I'm trying to fix on my PR 😉 I'll factor out the version number retrieval from the |
You were not kidding! @sanzoghenzo Nice! |
📦 New work-in-progress (wip) builds are available for 5.0.0.24253+1920-wip |
📦 New work-in-progress (wip) builds are available for 5.0.0.24254+1158-wip |
📦 New work-in-progress (wip) builds are available for 5.0.0.24254+1351-wip |
📦 New work-in-progress (wip) builds are available for 5.0.0.24261+0647-wip |
replaced by Value
https://discourse.pyrevitlabs.io/t/release-date-pyrevit-2025/3083/60?u=jean-marc
@acco-jpitts