First time using GDL (I was brave after a masters of archiCAD video)
im trying to do a if and repeat command.
if (no_pan_0-sla_pan_0)>0 then
i=1
repeat
gosub 20
add2 pan_m,0
i= i+1
until i>(no_pan_0-sla_pan_0)
endif
it works perfectly in 2D as left hand side of image shows but in 3D it doesn't. The object is for a kit of parts that the client has designed and so it can have a comination of panel types. Hence the if and repeat.
You are just showing the 2D script, right? (I only see ADD2)
Remember that 2D script and 3D script are different things. You might get by with one REPEAT cycle in 2D, but in 3D you may need more to accomplish what you want. You may be missing some coordinate transformations to correctly position the panels in each iteration.
Other than that, is difficult to know how you want the object to work.
i=1
repeat
gosub 20
addx pan_m
i= i+1
until i>(no_pan_0-sla_pan_0)
endif
the transformations to the next screen works otherwise the slatted panel would be over or further from the solid one.
I have a sub set for each type (slatted or solid) and I want the script to be able to repeat that sub for however many times it needs. So if in the future we can have a 6 panel long leg then I just change one small bit of code.