Macro controling on/off of layers

I am new to this macro writing and so do not know much, but I would like to be able to write a macro that control the on/off properties of layers based upon the custom properties of the configuration that is shown in the viewson the sheet.

SolidworksApi macros