Limiting Range Of Parameter Arrays
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 04:05 AM
I am trying to figure out how to create a limit range for an object with parameter arrays, using a loop.
basically it is just a grid with adjustable grid line lengths controlled by loops:
for i = 1 to nGridLines
add2 gridLineX
gosub “Grid Line”
del 1
next i
however i want to limit the minimum & maximum spacing for the grid spacing:
this is what i would do if it was not an array:
VALUES "gridXPosition" Range [1, 5]
Help me please!
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 04:26 AM
VALUES gridlineX
NEXT i

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 10:50 AM
There are workarounds for 2 situations, though.
For parameters which appear in the parameter list and/or in the UI page, you should add a non-array parameter which represents only one element of the array and an integer or other chooser by which the user can control which array element to manipulate. In this case the non-array parameter can have a range. You can see this "one-from-many" interface in the 1st UI page of the Material Legend object of ArchiCAD Library 13.
For parameters which can be changed via hotspots, you can use the PARAMETERS command in the following fashion:
for i = 1 to nGridLines if gridXPosition < 1 then gridXPosition = 1 endif if gridXPosition > 5 then gridXPosition = 5 endif next i parameters gridXPosition = gridXPositionI hope one of these methods will help you.
Regards,
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 12:54 PM
Unfortunately, there is no way to define values for array type parameters:(
Zsolt, let me see this in another perspective:
If you change your parameters in the User Interface, you can define values for array type parameters as whole; but this is the only
Let me give you the long expected wish to make values available for single array parameters and for moveable hotspots as well in a future GDL version.
GDL object creation: b-prisma.de
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 01:17 PM
Thanks for the correction. It's been a long time since I did it and I thought I recalled using the VALUES statement. Now I remember that failing. Seeing your code reminded me of how I finally got it to work.
It would be nice to get the VALUES to work with with array parameters though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 01:27 PM
by the way I was wondering if there was a way for using dynamic arrays as input parameters.
If I'm not clear:
I can define a dynamic array like this in the script: dim myArray[][]
But if I wanted that myArray to be available as a parameter input (in the UI) then I can't. I have to give its dimensions, and they can't be changed.
Is that right or is there a workaround?
Thanks in advance,
Olivier

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 02:59 PM
You shouldn't put array parameters directly in the parameter list or in the interface anyway.
Which solves the dynamic sizing problem of Olivier, too. You can have a parameter for the size of the array (see Material Legend, again), which is usually a meaningful number not just the size of an abstract storing mechanism. And using that you can reset the array parameter having the new size via the PARAMETERS command.
Naturally, having VALUES for array members would make hotspot editing more straightforward. It is definitely a valid wish. Still, I think this new kind of VALUES won't come very soon.
I hope not to disappoint you! 🙂
Regards,
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-14 06:52 PM
Olivier wrote:Yes, you can do both.
Hello Zsolt,
by the way I was wondering if there was a way for using dynamic arrays as input parameters.
If I'm not clear:
I can define a dynamic array like this in the script: dim myArray[][]
But if I wanted that myArray to be available as a parameter input (in the UI) then I can't. I have to give its dimensions, and they can't be changed.
Is that right or is there a workaround?Olivier
1) Data can be entered into a parameter array using
UI_INFIELD{2}
2) A parameter array can resize dynamically. Again, from the manual:
...and furthermore:
Just be sure to use the
Central Innovation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-15 12:37 PM
You shouldn't put array parameters directly in the parameter list or in the interface anyway.Zsolt,
thank you for the tip; it is a very interesting method that will solve a lot of problems.
But if I want to have many parameters of one array parameter to be shown on a single UI-Page I have to use them directly.
GDL object creation: b-prisma.de
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-01-15 01:44 PM
I know both of these two points, the problem is to define the parameter to be filled in as a dynamic array. As far as I know for an array to be dynamic you have to initialize it by dim ar[][]. And you can't do that for paramaters input. You have to give them dimensions, and then your are limited.
Or did I miss something? can an array in param input with [1][1] become dynamic?