framework/cg/freecad/Frames/newLabel.py

17 lines
No EOL
360 B
Python

import FreeCAD as App
def is_object_solid(obj):
"""If obj is solid return True"""
if not isinstance(obj, FreeCAD.DocumentObject):
return False
if not hasattr(obj, 'Shape'):
return False
return obj.Shape.isClosed()
def addProperty():
for obj in App.ActiveDocument().Objects:
if is_object_solid(obj):