I am having issues with a macro that creates a configuration specific custom property for material that is then used in BOMs and drawings. Currently I am doing the following where I pull the material name as a string and then pass the string to the custom property:
'******** Material ********
' Get material used for default configuration
strMaterial = swModel.GetMaterialPropertyName2(vConfNameArr(i), strMatDB)
' Set Material property to current material
swCustPropMgr.Add2 "Material", swCustomInfoText, strMaterial
swCustPropMgr.Set "Material", strMaterial
However, what I have noticed is that this means the material value is not "live updating" in the sense that in order to get the correct material, I have to re-run the macro. I know that you can manually link a custom property to the part file material and it will update as you change the material in the model, but is there a way to do that using the API?