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

Is it possible to define Pens in GDL?

JGoode
Expert
Is it possible to define Pens in GDL?
ArchiCAD 23

Windows 10
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
JGoode
Expert
Hello,

Just to revisit this, how can I convert an RGB value into Graphisoft's 0-1 system?

Thanks
ArchiCAD 23

Windows 10

View solution in original post

7 REPLIES 7
runxel
Legend
JGoode wrote:
Is it possible to define Pens in GDL?
No.
You can only request a similar pen to a RGB color:
REQUEST ("PEN_OF_RGB", colorInRGB, pen)
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
JGoode
Expert
runxel wrote:
JGoode wrote:
Is it possible to define Pens in GDL?
No.
You can only request a similar pen to a RGB color:
REQUEST ("PEN_OF_RGB", colorInRGB, pen)
Do you have any example script of this? Thanks
ArchiCAD 23

Windows 10
runxel
Legend
rr = REQUEST("PEN_OF_RGB", "0 1 0.2", _greenishpen)
!!! color range 0 to 1  //  WTF GS?

pen _greenishpen

set line_type   1
line2           0,0,5,0
Whoever did the 0 to 1 thing was clearly effing around.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
It is 0-1 in all MacOS at least in early versions 😉
anyway it is more accurate BTW: 256 points vs _the_accuracy_You_need 😉
Not that I like it...and in any script I use X/255 to get the GDL needed value while any soft would rather give 0..255.

Best Regards,
Piotr
runxel
Legend
Piotr wrote:
It is 0-1 in all MacOS at least in early versions 😉
anyway it is more accurate BTW: 256 points vs _the_accuracy_You_need 😉
Not that I like it...and in any script I use X/255 to get the GDL needed value while any soft would rather give 0..255.

Best Regards,
Piotr
I know Piotr, but the accuracy is not the point.
It is about consistence and usability.
The implemented way is just total madness! 😉 It's like cooking by receipt with imperial units but living in Europe.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Solution
JGoode
Expert
Hello,

Just to revisit this, how can I convert an RGB value into Graphisoft's 0-1 system?

Thanks
ArchiCAD 23

Windows 10
Jochen Suehlo
Moderator
0 * 255 = 0 (black)
1 * 255 = 255 (white)
<< -- >>
0 / 255 = 0
255/255 = 1
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de