Joint two macros

Hello.

I need your help guys. I found macros on this forums that I need to use. How I can joint it?

I would like to change mass from grams to kilograms on all my parts in attached macro with name: Set custom unit

Next I need add custom properties with values than picture:

For example:

Last part of macro must set custom properties values: Name part/assem and Drawing Number from filename.

My filename is: AC1025.01.01.01.00.001 name of part.SLDPRT

22 symbols from left is Drawing number, and all next symbols is Name of part.

I attached macro with name: Filename.swp

PLease, help me with my problem, How I can joint this two macros and add source code with automatic set custom properties than picture.

Thanks you very much guys for all your advices


SolidworksApi macros