From bae89072be90a893b8b70eb2528910df3df2042e Mon Sep 17 00:00:00 2001 From: Youen Date: Sat, 22 Oct 2022 17:51:31 +0200 Subject: [PATCH] fixed bug when a TechDraw view contains a variant link --- ahb_techdraw_extensions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ahb_techdraw_extensions.py b/ahb_techdraw_extensions.py index 2f54ff5..2ac4deb 100644 --- a/ahb_techdraw_extensions.py +++ b/ahb_techdraw_extensions.py @@ -419,6 +419,9 @@ class TechDrawExtensions: if obj.TypeId == 'App::Link': partLink = obj 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: objectCenterWorld = obj.Shape.CenterOfGravity