BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
GDL
About building parametric objects with GDL.

What is the first position in the STEP command?

Mats Knutsson
Enthusiast

I'm just testing basic stuff and I have an auto scripted slab and wanted to restrict the A-dimension between 1 and 2 meters and allow only even decimeters and the script below works great no matter what I write...0, 3, 3000... in the parameter script.

values "A" range [1,2] step 0,0.1

values "A" range [1,2] step 3,0.1

etc... I get that the second position (in my case 0.1=1 decimeter) is the incremental move) but the first position beats me...

4 REPLIES 4
runxel
Legend

It's the start value.

Let's imagine this: values "foo",  sin(30), 4, range(5, 10], 12, range(,20] STEP 14.5, 0.5, custom

All possible numbers for the parameter "foo" now are:
0.5, 4, 5 til 10 (without 5.00), 12, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

the first position in the range/step command is the reference point for the range, the second is the stepping value.

 

the reference point does not have to be within the range of the RANGE() values.

your 0, 3, 3000 all happen to be multiples of the stepping value so you didn't see any change

 

 

Round brackets "(" means don"t include this value in the range , i.e. < or >

Square brackets "[" means include this value in the range , i.e. <=  or  =<

 

 

fill fillAttribute_1
poly2_b{5}       5,      3,      1,      3, penAttribute_2, penAttribute_3,
                 0,      0,      1,      0,              0,              1,      0,
        0,       0,      1,
        A,       0,      1,
        A,       B,      1,
        0,       B,      1,
        0,       0,     -1
values "A" range[1,2] step 1,0.2
values "B" range[1,2] step 1,0.2

 

note: my working units are mm for this example.

Note: Archicads coding units are meters.

 

AllanP_2-1705549523121.png

 

for "A"  you have values in meters of

1.0  <- reference point

1.2

1.4

1.6

1.8

2.0

 

for "B"  you have values in meters of

1.0 <- reference point

1.2

1.4

1.6

1.8

2.0

 

 

change the range to a starting point for A to 1.110

change the range to a starting point for B to 1.333

values "A" range[1,2] step 1.110,0.2

values "B" range[1,2] step 1.333,0.2

(now this offsets the vales of A by 0.111 and offsets the values of B by 0.133)

 

AllanP_3-1705549561969.png

AllanP_4-1705550304065.png

 

for "A"  you have values in meters of

1.111 <- reference point

1.311

1.511

1.711

1.911

 

for "B"  you have values in meters of

1.133

1.333 <- reference point

1.533

1.733

1.933

 

I hope this helps

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)
AllanP
Advocate

The first value of the STEP value is the reference point for the range numbers.

with a reference point of  0 or 3 or 3000 then the values will be the same for a stepping value of 0.1, as the are multiples of the stepping number.

 

the reference point does not have to be within the "RANGE" values.

 

Script example

 

values "A" range[1,2] step 1,0.2
values "B" range[1,2] step 1,0.2

fill "25%"
poly2_b{5} 5, 3, 3, 3, 1, 1,
0, 0, 1, 0, 0, 1, 0,
0, 0, 1,
A, 0, 1,
A, B, 1,
0, B, 1,
0, 0, -1

 

AllanP_1-1705553163288.png

 

you get values for A of

1m <-reference point

1.2m

1.4m

1.6m

1.8m

2m

 

you get values for B of

1m <-reference point

1.2m

1.4m

1.6m

1.8m

2m

 

 

 

 

 

 

if you change the reference point, and step values to:

values "A" range[1,2] step 1.5,0.15
values "B" range[1,2] step 1.333,0.123

 

AllanP_2-1705553238030.png

AllanP_3-1705553269145.png

 

you get values for A of

1.05m

1.2m

1.35m

1.5m <-reference point

1.65m

1.8m

1.95m

 

you get values for B of

1.087m

1.21m

1.333m <-reference point

1.456m

1.579m

1.702m

1.825m

1.948m

 

I hope this helps.

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)
Mats Knutsson
Enthusiast

I'm kind of getting it. Don't really see (well...understand) the usefulness right now. I'll keep the reference point as my first point in the array. Thanks for your extensive answers trying to guide the blind.

Learn and get certified!