hello Satish,
sorry for replying late, I have just come back from my holidays.
If you don't have an actual weight note on your drawings and you
need one, that's an ordinary tabular note containing reference
to the mentioned CACHED_MASS attribute, it just needs to be
updated before plotting, exporting, etc. (for the sake of simplicity I have
omitted the code for this in my previous example, but I can post that
if you want).
If you want to invoke a custom utility prior to save, this is Menuscripting and
you should modify your add-on .men file to add a
BUTTON UG_FILE_SAVE_PART
ACTIONS/PRE your custom utility
as in previous .men example.
I'm not sure I have understood your workflow though, would you explain that in detail ?