Fix #3471. Allow to select hidden types (except if the type is excluded).

This commit is contained in:
Dion Moult
2023-07-28 23:42:02 +10:00
parent 2843d86ad4
commit 4176bfa7d2
@@ -143,14 +143,18 @@ class SelectType(bpy.types.Operator):
element = tool.Ifc.get().by_id(self.relating_type)
obj = tool.Ifc.get_object(element)
if obj:
if obj in context.selectable_objects:
try:
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.")
except:
self.report({"INFO"}, "Type object is hidden.")
# IfcTypeProducts are only used for annotations and not part of the model interface.
if element.is_a() != "IfcTypeProduct":
context.scene.BIMModelProperties.ifc_class = element.is_a()
context.scene.BIMModelProperties.relating_type_id = str(self.relating_type)
try:
context.scene.BIMModelProperties.ifc_class = element.is_a()
context.scene.BIMModelProperties.relating_type_id = str(self.relating_type)
except:
# Potentially our BIM Tool is filtered to a specific element.
pass
return {"FINISHED"}