The type manager now switches to the type when clicking on the "select type" button. Duplicating a type also changes the active type in the type manager

This commit is contained in:
Gorgious
2023-05-13 20:35:52 +02:00
parent 62f2144245
commit db283eb137
@@ -147,6 +147,8 @@ class SelectType(bpy.types.Operator):
tool.Blender.select_and_activate_single_object(context, obj)
else:
self.report({"INFO"}, "Type object can't be selected : It may be hidden or in an excluded collection.")
context.scene.BIMModelProperties.ifc_class = element.is_a()
context.scene.BIMModelProperties.relating_type_id = str(self.relating_type)
return {"FINISHED"}
@@ -464,6 +466,8 @@ class DuplicateType(bpy.types.Operator, tool.Ifc.Operator):
tool.Blender.select_and_activate_single_object(context, new_obj)
else:
self.report({"INFO"}, "Type object can't be selected : It may be hidden or in an excluded collection.")
context.scene.BIMModelProperties.ifc_class = new.is_a()
context.scene.BIMModelProperties.relating_type_id = str(new_obj.BIMObjectProperties.ifc_definition_id)
return {"FINISHED"}