master
Drew Owens Move the Base Scaffold Panel into this page as a sub-readme (panel/), 3D view at the top, drop section-ownership lines:… 7e86d5c
# Read-only: why does the BUTTON HEAD_TOP v2 body not reach the STEP export?
import traceback
LINEAGE = 'urn:adsk.wipprod:dm.lineage:qYUGHjbdRKGe-Dwb6BSu6Q'
rep = {}
doc = None
try:
    doc = app.documents.open(app.data.findFileById(LINEAGE), False)
    des = adsk.fusion.Design.cast(doc.products.itemByProductType('DesignProductType'))
    for occ in des.rootComponent.allOccurrences:
        if occ.component.name == 'BUTTON HEAD_TOP v2':
            b = occ.component.bRepBodies.item(0)
            bb = occ.boundingBox
            rep = {'body': b.name, 'isSolid': b.isSolid, 'isVisible': b.isVisible, 'isLightBulbOn': b.isLightBulbOn,
                   'volumeCm3': b.volume, 'faces': b.faces.count, 'isReferenced': occ.isReferencedComponent,
                   'path': occ.fullPathName, 'zMm': [round(bb.minPoint.z * 10, 3), round(bb.maxPoint.z * 10, 3)],
                   'diaMm': round((bb.maxPoint.x - bb.minPoint.x) * 10, 3),
                   'appearance': b.appearance.name if b.appearance else None}
            break
except Exception:
    rep['error'] = traceback.format_exc()
finally:
    if doc is not None:
        doc.close(False)
rep['activeAfter'] = app.activeDocument.name if app.activeDocument else None
result = rep