framework/cad_generation/helper/is_solid.py

19 lines
347 B
Python
Raw Normal View History

2023-06-30 21:47:53 +03:00
import FreeCAD
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
if not hasattr(obj.Shape, 'Solids'):
return False
if len(obj.Shape.Solids) == 0:
return False
return True