From 651f6d871ff5f1133e89b80d4b1b2bb7446ec5ea Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 5 Apr 2022 16:06:22 +0200 Subject: [PATCH] Arch: Fixed IFC import of Rebars --- src/Mod/Arch/ArchRebar.py | 12 +++++------- src/Mod/Arch/importIFC.py | 4 ++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index de824dc3ad..bf0bbf45a1 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -317,14 +317,12 @@ class _Rebar(ArchComponent.Component): if self.clone(obj): return - if not obj.Base and ((not obj.Shape) or (not obj.Shape.isNull())): - # let pass without error if we already have a shape - return if not obj.Base: - FreeCAD.Console.PrintError( - "No Base, return without a rebar shape for {}.\n" - .format(obj.Name) - ) + # let pass without error so that object can receive a shape directly + #FreeCAD.Console.PrintError( + # "No Base, return without a rebar shape for {}.\n" + # .format(obj.Name) + #) return if not hasattr(obj.Base,"Shape") or (not obj.Base.Shape) or obj.Base.Shape.isNull(): FreeCAD.Console.PrintError( diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 461b3795ca..1ff2d6caa1 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -708,6 +708,10 @@ def insert(srcfile, docname, skip=[], only=[], root=None, preferences=None): obj.Height = 0 obj.Width = 0 obj.Length = 0 + if (freecadtype in ["Rebar"]) and baseobj: + # TODO rebars don't keep link to their baee object - we can remove it + bn = baseobj.Name + doc.removeObject(bn) if store: sharedobjects[store] = obj