From 95e1c97bb161f84728c7f617373290e34c951d9f Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 21 Mar 2022 14:06:19 +0100 Subject: [PATCH] Arch: Fixed IFC export of rebars --- src/Mod/Arch/ArchRebar.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index 1d9804087e..89e9beb485 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -103,7 +103,7 @@ class _CommandRebar: return {'Pixmap' : 'Arch_Rebar', 'MenuText': QT_TRANSLATE_NOOP("Arch_Rebar","Custom Rebar"), 'Accel': "R, B", - 'ToolTip': QT_TRANSLATE_NOOP("Arch_Rebar","Creates a Reinforcement bar from the selected face of a structural object")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Rebar","Creates a Reinforcement bar from the selected face of solid object and/or a sketch")} def IsActive(self): @@ -114,7 +114,8 @@ class _CommandRebar: sel = FreeCADGui.Selection.getSelectionEx() if sel: obj = sel[0].Object - if Draft.getType(obj) == "Structure": + if hasattr(obj,"Shape") and obj.Shape.Solids: + # this is our host object if len(sel) > 1: sk = sel[1].Object if hasattr(sk,'Shape'): @@ -233,8 +234,8 @@ class _Rebar(ArchComponent.Component): if not obj.Host: return - if Draft.getType(obj.Host) != "Structure": - return + #if Draft.getType(obj.Host) != "Structure": + # return if not obj.Host.Shape: return if not obj.Base: