fixed bug when a TechDraw view contains a variant link

This commit is contained in:
Youen 2022-10-22 17:51:31 +02:00
parent dd3044dbb6
commit bae89072be

View File

@ -419,6 +419,9 @@ class TechDrawExtensions:
if obj.TypeId == 'App::Link': if obj.TypeId == 'App::Link':
partLink = obj partLink = obj
objectCenterWorld = partLink.LinkPlacement.Matrix.multiply(partLink.LinkedObject.Shape.CenterOfGravity) objectCenterWorld = partLink.LinkPlacement.Matrix.multiply(partLink.LinkedObject.Shape.CenterOfGravity)
elif obj.TypeId == 'Part::FeaturePython' and hasattr(obj, 'LinkedObject'): # variant link
partLink = obj
objectCenterWorld = partLink.LinkedObject.Shape.CenterOfGravity
else: else:
objectCenterWorld = obj.Shape.CenterOfGravity objectCenterWorld = obj.Shape.CenterOfGravity