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.

Gdl unlimited copying

Bhtsz_pyd
Contributor

Hello Everyone
I am trying to create a grid layout with gdl. what I want is that the parameter I want is to be able to increase or decrease the number of grid lines and each time I add a grid line, a new parameter is created where I can adjust the distance between it and the previous grid line. At first I created 4 different grid lines and did the work in the program, but here I can create a maximum of 4 grid lines. what I want is to be able to create an infinite number of grid lines and I want to create a length parameter that I can change the value between each one I create. 

 

Thanks...


WhatsApp Image 2024-12-01 at 17.59.57.jpegWhatsApp Image 2024-12-01 at 17.59.04.jpeg

1 REPLY 1
runxel
Legend

For this kind of thing you will need loops in your code.

And arrays (because you can not make up Parameters on the fly, meaning you need to have solution that is actually extensible).

 

for i=1 to n_of_lines
    line2 0, 0, 0, B
    add2 distances[i], 0
next i

Take this very rudimentary example. (please mind that this still needs some more code to work, e.g. handling consistency between "n_of_lines" and the distances array, so you don't run into errors, because the array is too small)

"n_of_lines" is your number of grid lines you want to appear.

Then you draw the line, and "add2" the distances to the next grid line.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!