mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Fix NoneType error and missing argument in mirror_geometry operator
- Guard against `RepresentationMaps` being `None` for type products without geometry - Fix `assign_type()` call missing `tool.Model` argument Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -743,7 +743,7 @@ class TrueMirrorElements(bpy.types.Operator, tool.Ifc.Operator):
|
||||
builder = ifcopenshell.util.shape_builder.ShapeBuilder(tool.Ifc.get())
|
||||
builder.mirror(item, (1, 0), create_copy=False)
|
||||
elif element.is_a("IfcTypeProduct"):
|
||||
for representation_map in element.RepresentationMaps:
|
||||
for representation_map in (element.RepresentationMaps or []):
|
||||
for item in representation_map.MappedRepresentation.Items:
|
||||
builder = ifcopenshell.util.shape_builder.ShapeBuilder(tool.Ifc.get())
|
||||
builder.mirror(item, (1, 0), create_copy=False)
|
||||
@@ -801,7 +801,7 @@ class TrueMirrorElements(bpy.types.Operator, tool.Ifc.Operator):
|
||||
tool.Blender.Modifier.set_mirrored_type(type_element, inverted_type)
|
||||
inverted_type.Name = f"{inverted_type.Name}.Mirror"
|
||||
|
||||
bonsai.core.type.assign_type(tool.Ifc, tool.Type, element, inverted_type)
|
||||
bonsai.core.type.assign_type(tool.Ifc, tool.Model, tool.Type, element, inverted_type)
|
||||
|
||||
|
||||
def generate_box(usecase_path: str, ifc_file: ifcopenshell.file, settings: dict[str, Any]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user