Hi there
I have made a gadget to add layers into a job. I am wanting to know if it is possible to assign each of those layers its own colour via the script also.
If it is possible how would I go about this?
Thanks
Layer Gadget
-
- Posts: 4
- Joined: Thu Jun 16, 2016 8:05 am
- Model of CNC Machine: Ascent pro
- Adrian
- Vectric Archimage
- Posts: 14655
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Layer Gadget
Colour (and Color) is a read/write property of CadLayer. Page 47 in the SDK documentation.
-
- Posts: 4
- Joined: Thu Jun 16, 2016 8:05 am
- Model of CNC Machine: Ascent pro
Re: Layer Gadget
Thanks for you reply.
I am new to Lua and not sure how to execute this,
I have managed to get my gadget to add the Layers to vcarve but struggling to get the code right to add the colour to them.
I have tried the :SetColour() but must be doing something wrong because it just throws errors.
I am new to Lua and not sure how to execute this,
I have managed to get my gadget to add the Layers to vcarve but struggling to get the code right to add the colour to them.
I have tried the :SetColour() but must be doing something wrong because it just throws errors.
- Adrian
- Vectric Archimage
- Posts: 14655
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Layer Gadget
The following should work for you. The first two hex bytes are red, then green then blue. So for white you would use 0xFFFFFF and for black 0x000000. The example I've given is red.
Code: Select all
local layer = job.LayerManager:GetLayerWithName("Layer 1")
layer.Color = 0xFF
-
- Posts: 4
- Joined: Thu Jun 16, 2016 8:05 am
- Model of CNC Machine: Ascent pro
Re: Layer Gadget
Thanks Adrian
That worked,
I was very close with it but just had it the coding slightly wrong.
That worked,
I was very close with it but just had it the coding slightly wrong.