cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

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.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!