mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 03:37:21 +00:00
Fix bug where copying a class did not enforce mapped representations
This commit is contained in:
@@ -231,10 +231,11 @@ class CopyClass(bpy.types.Operator):
|
|||||||
self.file, {"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
self.file, {"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
||||||
).execute()
|
).execute()
|
||||||
IfcStore.link_element(result, obj)
|
IfcStore.link_element(result, obj)
|
||||||
if obj.data and obj.data.users == 1:
|
relating_type = ifcopenshell.util.element.get_type(result)
|
||||||
bpy.ops.bim.add_representation(obj=obj.name)
|
if relating_type and relating_type.RepresentationMaps:
|
||||||
else:
|
|
||||||
bpy.ops.bim.map_representations(
|
bpy.ops.bim.map_representations(
|
||||||
product_id=result.id(), type_product_id=ifcopenshell.util.element.get_type(result).id()
|
product_id=result.id(), type_product_id=ifcopenshell.util.element.get_type(result).id()
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
bpy.ops.bim.add_representation(obj=obj.name)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user