Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Define Pen Colour?

derekjackson
Expert
Hi,
does anyone know if there's a way of defining a pen colour in RGB with GDL?

We need to make a 2d object with predefined background colours (red, yellow and green) so we don't want to give the user choice over which pen to use.

Can it be defined in script? It seems odd that we can define Materials but not Pen colours (which are much simpler).

It's not listed here, but there may be a workaround or something I'm missing?
gdl.graphisoft.com/gdl-docs/gdl-guide/chapter-8-attributes/inline-attribute-definition/

Thanks
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb
2 REPLIES 2
Barry Kelly
Moderator
I don't think you can define a pen colour because there is a finite number of pens and these are defined in your pen sets (I may be wrong).
Unlike materials and fills where you can have as many as you want.

If you already have the red, green and yellow pens in your pen set then you can use them in your script by hard coding them and not allowing them as a parameter that the user can change.
However changing pen sets may change those colours.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
derekjackson
Expert
Thanks, hard-coding the pen number is the solution I went with - we just have to hope the user doesn't change the pen set when using the object.

It's surprising that the RGB of a poly2_b fill can't be defined in script though - I understand about a limited number of pen numbers, but the purpose bypasses the need to refer to a specific pen. I just want to lock the colour of a fill!
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb