mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Fix error appending elements without type #5902
This commit is contained in:
@@ -465,11 +465,11 @@ class AppendLibraryElement(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
if element.is_a("IfcTypeProduct"):
|
if element.is_a("IfcTypeProduct"):
|
||||||
self.import_type_from_ifc(element, context)
|
self.import_type_from_ifc(element, context)
|
||||||
elif element.is_a("IfcProduct"):
|
elif element.is_a("IfcProduct"):
|
||||||
# NOTE: not used as UI doesn't allow appending non-types
|
# NOTE: Non-types are not exposed in UI directly
|
||||||
|
# but the code is still used when appending products by query.
|
||||||
self.import_product_from_ifc(element, context)
|
self.import_product_from_ifc(element, context)
|
||||||
element_type = ifcopenshell.util.element.get_type(element)
|
element_type = ifcopenshell.util.element.get_type(element)
|
||||||
obj = tool.Ifc.get_object(element_type)
|
if element_type is not None and tool.Ifc.get_object(element_type) is None:
|
||||||
if obj is None:
|
|
||||||
self.import_type_from_ifc(element_type, context)
|
self.import_type_from_ifc(element_type, context)
|
||||||
elif element.is_a("IfcMaterial"):
|
elif element.is_a("IfcMaterial"):
|
||||||
self.import_material_from_ifc(element, context)
|
self.import_material_from_ifc(element, context)
|
||||||
|
|||||||
Reference in New Issue
Block a user