Add layer and insert text

Hi in drawing I'm trying to make a macro that will check if layer if not create it then insert a text change it's color and size.

I have written one that will insert the text at the right color and size but I have not managed to add a layer.

If you can point me to documentation or show me an exemple that add a layer I should be able to adapt it to my macro

Other info:

Layer name is always the same

Layer color and style is not important

Text box content is always the same

SolidworksApi macros