Skip to content

Commit

Permalink
Merge pull request #1870 from thumDer/develop
Browse files Browse the repository at this point in the history
hotfix for geometry query
  • Loading branch information
jmcouffin authored Jul 14, 2023
2 parents 96abf97 + f82d075 commit f793e9e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pyrevitlib/pyrevit/revit/db/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,10 +1576,14 @@ def get_geometry(element, include_invisible=False, compute_references=False):
geom_opts.IncludeNonVisibleObjects = include_invisible
geom_opts.ComputeReferences = compute_references
geom_objs = []
for gobj in element.Geometry[geom_opts]:
if isinstance(gobj, DB.GeometryInstance):
inst_geom = gobj.GetInstanceGeometry()
geom_objs.extend(list(inst_geom))
else:
geom_objs.append(gobj)
return geom_objs
try:
for gobj in element.Geometry[geom_opts]:
if isinstance(gobj, DB.GeometryInstance):
inst_geom = gobj.GetInstanceGeometry()
geom_objs.extend(list(inst_geom))
else:
geom_objs.append(gobj)
return geom_objs
except TypeError:
mlogger.debug("element %s has no geometry", element.Id.IntegerValue)
return

0 comments on commit f793e9e

Please sign in to comment.