From 19749740713583534254b621409db286091a81f6 Mon Sep 17 00:00:00 2001 From: Gorgious56 Date: Thu, 19 Sep 2024 14:03:56 +0200 Subject: [PATCH] Fix #5410 : bim.enable_adding_presentation_style no longer throws an error in a file with no ifc project when launching the search operator (F3) --- src/bonsai/bonsai/bim/module/style/operator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/style/operator.py b/src/bonsai/bonsai/bim/module/style/operator.py index 0a1bc04598..d808fdf0f4 100644 --- a/src/bonsai/bonsai/bim/module/style/operator.py +++ b/src/bonsai/bonsai/bim/module/style/operator.py @@ -547,6 +547,8 @@ class EnableAddingPresentationStyle(bpy.types.Operator): @classmethod def poll(cls, context): + if not tool.Ifc.get(): + return False style_type = tool.Style.get_active_style_type() if style_type != "IfcSurfaceStyle": cls.poll_message_set(f"Adding {style_type} is not currently supported.")