framework/cad_generation/helper/is_solid.py
2023-06-30 21:47:53 +03:00

18 lines
347 B
Python

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