Fix bug where you could create mapped representations without having a type product

This commit is contained in:
Dion Moult
2021-02-07 19:08:34 +11:00
parent 7d5ac99f34
commit 686ba2536b
2 changed files with 15 additions and 29 deletions
@@ -243,13 +243,7 @@ class MapRepresentation(bpy.types.Operator):
old_representation = None
target_representation = self.file.by_id(obj_data.BIMMeshProperties.ifc_definition_id)
obj.data = obj_data
result = map_representation.Usecase(
self.file,
{
"product": product,
"representation": target_representation,
},
).execute()
result = map_representation.Usecase(self.file, {"representation": target_representation}).execute()
assign_representation.Usecase(self.file, {"product": product, "representation": result}).execute()
if old_representation:
bpy.ops.bim.remove_representation(ifc_definition_id=old_representation.id())