(Really) Dynamic arrays as parameters of GDL objects

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-04-05
01:06 PM
- last edited on
2023-05-24
11:54 AM
by
Rubia Torres
2010-04-05
01:06 PM
The GDL docs says that parameter arrays are dynamic by default, that is they can be extended, and it works. But the parametric arrays' stored size cannot be changed, and I cannot change in the parameter window.
Is it possible to change the parameter array's size somehow?
GDL/Python/C++ dev
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-04-09 04:43 PM
2010-04-09
04:43 PM
You definitely cannot do out of bounds indexing of array parameters for reading in the 2D/3D scripts.
But you absolutely can do the following in the parameter script:
In other words: you can extend your array parameters by simply setting the last item to create.
Decreasing the size of the array (which is a much rarer need) can be done by creating a new smaller array, copying the necessary values and setting the array parameter to the new array using the PARAMETERS command.
But you absolutely can do the following in the parameter script:
if max (gs_sh, gs_sho, gs_shu) > vardim2(gs_horGridY) then parameters gs_horGridY[1][max (gs_sh, gs_sho, gs_shu)] = 0 parameters gs_horGridBegX[1][max (gs_sh, gs_sho, gs_shu)] = 0 parameters gs_horGridEndX[1][max (gs_sh, gs_sho, gs_shu)] = 0 endif(the code snipplet is from the standard German AC windows)
In other words: you can extend your array parameters by simply setting the last item to create.
Decreasing the size of the array (which is a much rarer need) can be done by creating a new smaller array, copying the necessary values and setting the array parameter to the new array using the PARAMETERS command.
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-05-05 09:52 PM
2010-05-05
09:52 PM
Try
http://archicad-talk.graphisoft.com/object_depository.php
Free form Window in Windows category
Needs time and effort to understand.
Free form Window in Windows category
Needs time and effort to understand.
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.