Possible to change material based on Custom Property?

I am trying to make a temporary work around to update my Part's material based on a custom property. I need to do this since I am creating models through DriveWorks but I cannot get the functionality for DW and SW correct when selecting from custom materials. I can still drive the Custom Property "DWMaterial" from DW and I can also setup DW to run a macro before finishing the part. The only problem being I do not understand macros enough to write my own... any help?

Basically => Part Material = Custom Property DWMaterial

SolidworksApi macros