mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
See #7166. Only show total thickness for layer sets.
This commit is contained in:
@@ -323,12 +323,15 @@ class ObjectMaterialData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def total_thickness(cls):
|
def total_thickness(cls):
|
||||||
if cls.material:
|
if not cls.material:
|
||||||
|
return
|
||||||
layers = []
|
layers = []
|
||||||
if cls.material.is_a("IfcMaterialLayerSetUsage"):
|
if cls.material.is_a("IfcMaterialLayerSetUsage"):
|
||||||
layers = cls.material.ForLayerSet.MaterialLayers
|
layers = cls.material.ForLayerSet.MaterialLayers
|
||||||
elif cls.material.is_a("IfcMaterialLayerSet"):
|
elif cls.material.is_a("IfcMaterialLayerSet"):
|
||||||
layers = cls.material.MaterialLayers
|
layers = cls.material.MaterialLayers
|
||||||
|
if not layers:
|
||||||
|
return
|
||||||
thickness = sum([l.LayerThickness for l in layers or []])
|
thickness = sum([l.LayerThickness for l in layers or []])
|
||||||
prefs = tool.Blender.get_addon_preferences()
|
prefs = tool.Blender.get_addon_preferences()
|
||||||
assert bpy.context.scene
|
assert bpy.context.scene
|
||||||
|
|||||||
Reference in New Issue
Block a user