Browse Source

fixed error when a document is being loaded (balloons source object are not available yet)

master
Youen 2 years ago
parent
commit
20895bbf4b
  1. 13
      ahb_techdraw_extensions.py

13
ahb_techdraw_extensions.py

@ -521,14 +521,15 @@ class TechDrawExtensions:
obj = self.getBalloonSourcePart(balloon)
path = self.getBalloonSourcePartPath(balloon)
partDisplayName = 'Inconnu' if obj is None else self.getPartDisplayName(obj)
if obj is not None:
objectCenterView = workbench.techDrawExtensions.computePartCenter(view, obj, path)
objectCenterView = workbench.techDrawExtensions.computePartCenter(view, obj, path)
balloon.OriginX = objectCenterView.x + balloon.Assembly_handbook_OriginOffsetX
balloon.OriginY = objectCenterView.y + balloon.Assembly_handbook_OriginOffsetY
balloon.OriginX = objectCenterView.x + balloon.Assembly_handbook_OriginOffsetX
balloon.OriginY = objectCenterView.y + balloon.Assembly_handbook_OriginOffsetY
partDisplayName = 'Inconnu' if obj is None else self.getPartDisplayName(obj)
balloon.Text = partDisplayName
balloon.Text = partDisplayName
balloon.ViewObject.Font = 'DejaVu Sans'
balloon.ViewObject.Fontsize = 4
balloon.BubbleShape = 'Inspection'

Loading…
Cancel
Save