BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Wishes
Post your wishes about Graphisoft products: Archicad, BIMx, BIMcloud, and DDScad.

Define pen colours in GDL.

JGoode
Advocate
On multiple occasions now it would have saved a lot of time and bugs if it was possible to be able to define pen colours in GDL script. Surely if you're able to define fills and you can define pens for pen sets then it must be possible to define pens using GDL. I feel like this should be possible but it isn't. Thoughts?
ArchiCAD 23

Windows 10
10 REPLIES 10
DGSketcher
Legend
Why do you need to define the pen colour? AC's options on pens is ridiculously complex as it is. If you are defining a custom pen in GDL what about the line weight, how will AC know how to display it?

If you are just trying to simplify your pens for consistency then I am a big fan of Graphic Overrides and a single pen set.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
JGoode
Advocate
DGSketcher wrote:
Why do you need to define the pen colour? AC's options on pens is ridiculously complex as it is. If you are defining a custom pen in GDL what about the line weight, how will AC know how to display it?

If you are just trying to simplify your pens for consistency then I am a big fan of Graphic Overrides and a single pen set.
The first example I can think of is 2D symbols. If they have to be a specific colour to suit standards of some sort, it would be much easier to define the pen colour for whenever that object is used rather than having to change pen sets about and have colours that won't be used all of the time. I have had to resort to using image fills which are okay until the MVO's starts changing around and it isn't no longer showing the image fill but it will show the background/foreground pen. Which is where is would be very useful. If you can define image fills then why not be able to define pens. It's extremely useful if you need it and not an inconvenience if you don't.
ArchiCAD 23

Windows 10
DGSketcher
Legend
Have a look at the GOs, it looks ideal for your problem. You can create a rule that would modify the display of your symbol object using layer and/or name to filter the symbol and display with pens and fill to suit.

I guess this won't work if you need to use multiple different pens in your symbol but then again I would ask why so many colours? You can read this text without multiple colours, so simply highlighting your objects so they are identifiable and readable on your drawings e.g. electrical / fire symbols in red with a white fill background on a black & white drawing should enough to convey what is required?

Just trying to help!
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
JGoode
Advocate
DGSketcher wrote:
Have a look at the GOs, it looks ideal for your problem. You can create a rule that would modify the display of your symbol object using layer and/or name to filter the symbol and display with pens and fill to suit.

I guess this won't work if you need to use multiple different pens in your symbol but then again I would ask why so many colours? You can read this text without multiple colours, so simply highlighting your objects so they are identifiable and readable on your drawings e.g. electrical / fire symbols in red with a white fill background on a black & white drawing should enough to convey what is required?

Just trying to help!
The current object I'm working on has a need for 4 different colours as it includes multiple variations of the object. It's not the most important thing needed in ArchiCAD I agree, however it would be extremely useful and I can see myself having to create similar objects again.
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
JGoode wrote:
...Surely if you're able to define fills and you can define pens for pen sets then it must be possible to define pens using GDL....
You can define a fill in GDL but you can't define a pen for a pen set.
You can set the pen number to be used - but that is all.

However I could see the need to be able to set the RGB colour and thickness of a user definable pen (that is not part of a pen set) so that could be used in an object.
Then regardless of the pen set chosen that pen colour would never change in the object (unless altered in the parameter settings).

Zones already have an RGB pen colour that is not part of the pen sets.
If you save a zone as an object you will get an strange pen number (i.e. 1008) and it will just appear white (with an error message to say pen exceeds range) rather than the original zone colour (at least it does for me).
But there is no way to define this pen colour - which would be nice.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Advocate
Barry wrote:
JGoode wrote:
...Surely if you're able to define fills and you can define pens for pen sets then it must be possible to define pens using GDL....
You can define a fill in GDL but you can't define a pen for a pen set.
You can set the pen number to be used - but that is all.

However I could see the need to be able to set the RGB colour and thickness of a user definable pen (that is not part of a pen set) so that could be used in an object.
Then regardless of the pen set chosen that pen colour would never change in the object (unless altered in the parameter settings).

Zones already have an RGB pen colour that is not part of the pen sets.
If you save a zone as an object you will get an strange pen number (i.e. 1008) and it will just appear white (with an error message to say pen exceeds range) rather than the original zone colour (at least it does for me).
But there is no way to define this pen colour - which would be nice.

Barry.
Sorry, I phrased it incorrectly. I meant that you can choose pens from a pen set. Defining RGB pens would be extremely useful in my opinion.
ArchiCAD 23

Windows 10
Laszlo Nagy
Community Admin
Community Admin
If I remember correctly this whole Pen thing in ARCHICAD originated in the age of Pen Plotters, maybe this is why they came to be called Pens (just guessing). And maybe this is why a Pen defines both the Color and the Width, because specific Pens in Pen Plotters always had specific thicknesses.
Pens differ from other types of attributes such a Line Types, Fill Types, etc. in that there is always a set number of Pens (from 1 to 255).

I agree with the wish, but I think the way Pens are handled would have to be completely overhauled. I think the best thing would be to have the ability to define as many Pens (or Colors?) as needed (by specifying RGB values), and we should also have the ability to define Line Thicknesses, so Color and Thickness would be two separate settings for elements. This may even make the need for Pen Sets obsolete. Just thinking loudly...
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
DGSketcher
Legend
The problem I see with it comes when the object is used beyond the originator. Somebody will have an issue with the pen colour and/or pen weight in which case they will be looking to change those values, which is how things work just now with pens & pen sets. If you can't change the values then use of the object may be limited. Where the colours of the object are critical then perhaps using images would be a more reliable solution.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
JGoode
Advocate
DGSketcher wrote:
The problem I see with it comes when the object is used beyond the originator. Somebody will have an issue with the pen colour and/or pen weight in which case they will be looking to change those values, which is how things work just now with pens & pen sets. If you can't change the values then use of the object may be limited. Where the colours of the object are critical then perhaps using images would be a more reliable solution.
The image fills aren't very reliable due to the model view options. Being able to set the background and foreground on different symbols means that there is a lot more flexibility with the MVO's. The idea of defining pens is that they are precise to a colour. There wouldn't be a case where the user of the object would be changing the pen. Company logo's are a good example of a use as most company's will have a specific colour for their logo and it is unlikely that you would want it in a pen set 24/7 unless it was your own company's logo.
ArchiCAD 23

Windows 10
Learn and get certified!