Arch: Fixed IFC import of Rebars

This commit is contained in:
Yorik van Havre
2022-04-05 16:06:22 +02:00
parent 48deb6ae3e
commit 651f6d871f
2 changed files with 9 additions and 7 deletions

View File

@@ -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(

View File

@@ -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