mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
fix delete material operator
This commit is contained in:
@@ -250,7 +250,8 @@ class UnassignMaterial(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
if element:
|
if element:
|
||||||
material = ifcopenshell.util.element.get_material(element, should_inherit=False)
|
material = ifcopenshell.util.element.get_material(element, should_inherit=False)
|
||||||
inherited_material = ifcopenshell.util.element.get_material(element, should_inherit=True)
|
inherited_material = ifcopenshell.util.element.get_material(element, should_inherit=True)
|
||||||
if "Usage" in material.is_a():
|
print(material, inherited_material)
|
||||||
|
if material and "Usage" in material.is_a():
|
||||||
element_type = ifcopenshell.util.element.get_type(element)
|
element_type = ifcopenshell.util.element.get_type(element)
|
||||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type)
|
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type)
|
||||||
elif not material and inherited_material:
|
elif not material and inherited_material:
|
||||||
|
|||||||
Reference in New Issue
Block a user