Draft: support object without shape in DraftLink

This commit is contained in:
Zheng, Lei
2020-10-19 08:43:12 +08:00
committed by Yorik van Havre
parent 4234e66796
commit 4d3ea2d850

View File

@@ -177,8 +177,10 @@ class DraftLink(DraftObject):
obj.Count = len(pls)
if obj.Base:
shape = Part.getShape(obj.Base)
if shape.isNull():
shape = getattr(obj.Base, 'Shape', None)
if not isinstance(shape, Part.Shape):
obj.Shape = Part.Shape()
elif shape.isNull():
_err_msg = ("'{}' cannot build shape "
"from '{}'\n".format(obj.Label, obj.Base.Label))
raise RuntimeError(_err_msg)