Skip to main content
13-Aquamarine
February 21, 2020
Question

Copy Masterdata Attribute to Drawing Attribute During Save

  • February 21, 2020
  • 1 reply
  • 1577 views

How can I fill in a Drawing_2d attribute with an existing Masterdata attribute automatically when a new drawing is created?

1 reply

14-Alexandrite
June 26, 2020

I had the same question and I solved it with a Model Manager custom code.
At save time, the ultimate occasion to setup attributes are to use preApplyListener.
I designed a drawing preApplyListener to detect the save from Annotation situation. The drawing.getPartUsedInSave() method gives access to the releavant masterdata to get attributes values from.
But beware the order of listener: model3d, drawing2d and masterdata.