License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
GDL
About building parametric objects with GDL.

Issue: Pen Array Parameters - bug

Nader Belal
Mentor
Hi there,

I'm writing this post to announce that GDL's pen Array parameter can not and will not accept pen number -1.

For my point of view, if I´m capable of selecting a PEN parameter with the value of "-1", then the Pen Array Parameter should accept the value of "-1".
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
3 REPLIES 3
Barry Kelly
Moderator
Pen 0 and pen -1 are only available for use with a fill background.
It will give an error if you try to use it for any other purpose.

But I think what you are trying to say is that if you create a parameter for a text pen colour, then the user should not be able to select pen 0 or -1 from the list.
The only way I know to prevent this is to create a VALUE list for the pen parameter that can limit the pens to just the ones you want to use.


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
Peter Baksa
Graphisoft
Graphisoft
Hi, I added this to our bug database.
One workaround that I can think of is creating an UI where first the array index is selected, then a non-array pen parameter can be set, which you put in the array using GLOB_MODPAR_NAME.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Nader Belal
Mentor
@Barry Kelly

Although I understand your statement, but I really meant what I have written previously, and that is, if a GDL programmer or an ArchiCAD user can choose the Pens of 0 and -1 with a Pen Parameter, then the same user should be able to choose those same pens in a Pen Array Parameter

The application of the case (long story short), I have made an intricate GDL object, were I have put all my pens' numbers in a Pen Parameter Array, were the application of the specific pen in the array is dependent on previous selections made by the user, but as Pen Array Parameter can't save the value of -1, I had to revise every line of the script to make sure it wouldn't cause the inconvenience (Master Script alone 3,000 lines approx).

I know that it may appear more complicated than it really is, but the benefit is that when the firm's users want to change those pens knowing an absolute minimum of GDL (below a novice level), s/he can change them quickly and efficiently from one place in the code, without messing the rest of the script, and with comments that guide his/her choices.

I can't say more than that because of the NDA that I have signed with the firm.

@Peter Baksa
Thank you very much, and thank you again for the advice, lucky it only affected one portion of the script that was easy to fix for the time being.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.