Skip to content

Commit

Permalink
Merge pull request #2396 from pyrevitlabs/fix/2381
Browse files Browse the repository at this point in the history
Fix/2381
  • Loading branch information
jmcouffin committed Sep 10, 2024
2 parents edeeb3e + 694f943 commit 372cc6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
if HOST_APP.is_exactly('2022'):
ut = str(p.GetSpecTypeId().TypeId)
tp = str(p.ParameterType)
pg = str(p.ParameterGroup)
elif HOST_APP.is_newer_than('2022'):
ut = str(p.GetDataType().TypeId)
tp = str(p.GetDataType().TypeId.split('.')[-3])
pg = str(p.GetGroupTypeId().TypeId)
else:
pg = str(p.ParameterGroup)
ut = str(p.UnitType)
tp = str(p.ParameterType)
pg = str(p.ParameterGroup)

print('\n')
print('-' * 100)
Expand Down
2 changes: 2 additions & 0 deletions pyrevitlib/pyrevit/revit/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def __init__(self, param_def, param_binding=None, param_ext_def=False):
if HOST_APP.is_exactly(2021):
# Revit >2021 does not have the UnitType property
self.unit_type = self.param_def.GetSpecTypeId()
self.param_type = self.param_def.ParameterType
self.param_group = self.param_def.ParameterGroup
elif HOST_APP.is_newer_than(2022, or_equal=True):
# GetSpecTypeId() Removed in Revit 2022
self.unit_type = self.param_def.GetDataType()
Expand Down

0 comments on commit 372cc6c

Please sign in to comment.