Browse Source

fixed bug when a TechDraw view contains a variant link

master
Youen 2 years ago
parent
commit
bae89072be
  1. 3
      ahb_techdraw_extensions.py

3
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

Loading…
Cancel
Save