Changing feature colour API

Hi.

I'm pretty new to API and have been trying to make a macro to modify a feature's colour. I'd like the macro to change any selected feature's colour.

I've been looking for examples but have only found something to change face colour.

Can someone point me in the right direction?

Thanks

Asaf

SolidworksApi macros
Answers 4
AT
SF
SF 2013-12-31

Thanks for the quick response!

As I said I'm new to API so just wondering, if I only want to change the feature color do I need to first get the current variables such as transparency etc and then plug those variables in as well or is there a quicker way?

Cheers.

Asaf

AT
AT 2013-12-31

Please find the macro in the attachment. It changes the color of selected feature to green. You can change the color by changing these values (RGB - from 0 to 1) in main sub:

<p>        vMatPrps(0) = <span style="color: #ff0000;"><strong>0</strong></span></p><p>        vMatPrps(1) = <span style="color: #008000;"><strong>1</strong></span></p><p>        vMatPrps(2) = <span style="color: #0000ff;"><strong>0</strong></span></p>
SF
SF 2013-12-31

Perfect! thanks so much for your help.