link global variable to custom property via macro

Hello everyone,

I have succeeded in writing a macro that adds a custom property to my part and I want that property to be linked to a global variable. Now I wrote the follonwing code on the macro using Chr(34) and \$PRP: and it is accepted, but the custom property manager does not recognize the text as the variable, just as plain text:

Set CusPropMgr = swModel.Extension.CustomPropertyManager("")

CusPropMgr.Add2 "Mass [kg]", swCustomInfoText, ""

swModel.CustomInfo("Mass [kg]") = "\$PRP:" + Chr(34) + "Mass in kg" + Chr(34)

Any thoughts on what is happening here? Thanks!

Daniel

SolidworksApi macros