Skip to content

Commit

Permalink
Merge pull request #1844 from jmcouffin/1796-revit-2024-api-breaking-…
Browse files Browse the repository at this point in the history
…changes-elementid-storage-type

fixed ElementId.IntegerValue to ElementId.Value for 2024 and above
  • Loading branch information
jmcouffin authored Jun 15, 2023
2 parents 1df3dfa + 2c51796 commit d6803d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Selects elements with no associated dimensions in current view."""
#pylint: disable=import-error,invalid-name
from pyrevit import revit, DB
from pyrevit import revit, DB, HOST_APP
from pyrevit import forms

categories = {
Expand Down Expand Up @@ -45,7 +45,10 @@
dimmed_ids = set()
for dim in all_dims:
for ref in dim.References:
dimmed_ids.add(ref.ElementId.IntegerValue)
if HOST_APP.is_newer_than(2023):
dimmed_ids.add(ref.ElementId.Value)
else:
dimmed_ids.add(ref.ElementId.IntegerValue)

# find non dimmed
not_dimmed_ids = all_ids.difference(dimmed_ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@
untagged_elements = []
for eltid in target_tags:
elt = revit.doc.GetElement(eltid)
if HOST_APP.is_newer_than(2022, or_equal=True):
if HOST_APP.is_newer_than(2023):
if elt.GetTaggedLocalElementIds() != DB.ElementId.InvalidElementId:
tagged_elements.append(List[DB.ElementId](elt.GetTaggedLocalElementIds())[0].Value)
elif HOST_APP.is_newer_than(2022, or_equal=True):
if elt.GetTaggedLocalElementIds() != DB.ElementId.InvalidElementId:
tagged_elements.append(List[DB.ElementId](elt.GetTaggedLocalElementIds())[0].IntegerValue)
else:
Expand Down

0 comments on commit d6803d1

Please sign in to comment.