Skip to content

Commit

Permalink
feat(geometry): add getCurves function
Browse files Browse the repository at this point in the history
  • Loading branch information
yschindel committed Jul 12, 2022
1 parent 24427c1 commit d7a4722
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions revitron/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ def getSolids(self):
pass
return solids

def getCurves(self, curveType='Line'):
"""
Get a list of all curves by type of a given element.
Note:
Child classes of Autodesk.DB.Curve can be used.
Args:
curveType (str, optional): The type of curve to return.
Defaults to 'Line'.
Returns:
list: A list of curve objects
"""
curves = []
for geo in self._geometry:
try:
for item in geo.GetInstanceGeometry():
if item.GetType().Name == curveType:
curves.append(item)
except:
pass
return curves

class GeometryUtils:
"""
Expand Down

0 comments on commit d7a4722

Please sign in to comment.