Skip to content

Commit

Permalink
Get bounding box of symbol in case element has no bounding box
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Nov 4, 2020
1 parent 856a084 commit 6078cf4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions revitron/boundingbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ def __init__(self, element):
element (object): A Revit Element
"""
import revitron

self.bbox = False
if revitron._(element).get('Scope Box'):
self.bbox = revitron._(revitron._(element).get('Scope Box')).getBbox().bbox
else:
if revitron._(element).getClassName() == 'ViewPlan':
self.bbox = element.CropBox
else:
self.bbox = element.get_BoundingBox(None)

if not self.bbox:
try:
self.bbox = revitron.BoundingBox(element.Symbol).bbox
except:
pass
self.Min = self.bbox.Min
self.Max = self.bbox.Max

Expand Down

0 comments on commit 6078cf4

Please sign in to comment.