3 weeks ago
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...
3 weeks ago
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.
3 weeks ago
You would probably also want to include Hotlines for snapping, then if you are wanting to label the grids, you will need to link and update a second array.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2 weeks ago
Thank you so much for the help.