GDL
About building parametric objects with GDL.
SOLVED!

How to constrain dynamic hotspots to set distance intervals?

Mats_Knutsson
Advisor

I'm creating an L support that have length from 1 to 2 m in increments on 0.1 m. I vaguely remember a list or array in the parameter script but I can't find the example I did (got helped by someone here) a long time ago. Anyone with a fresh mind?

/M

AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
DGSketcher
Legend

Checked syntax... try this instead

VALUES "My_Parameter" RANGE ( , 2.0] STEP 1.0, 0.1

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

View solution in original post

Solution
DGSketcher
Legend

And to take @Barry Kelly solution to it's inevitable conclusion...

Create an array containing the value list ( DIM ValList [11] ) above and then simply use...

VALUES "My_Parameter" ValList

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

View solution in original post

5 REPLIES 5
DGSketcher
Legend

@Mats_Knutsson Try adding this into your Parameter Script...

VALUES "My_Parameter" RANGE [ 1.0, 2.0 ] STEP 0.1 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Solution
DGSketcher
Legend

Checked syntax... try this instead

VALUES "My_Parameter" RANGE ( , 2.0] STEP 1.0, 0.1

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

You can also do it without the RANGE - although that is probably the better way to do it.

 

VALUES "My_Parameter" 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Solution
DGSketcher
Legend

And to take @Barry Kelly solution to it's inevitable conclusion...

Create an array containing the value list ( DIM ValList [11] ) above and then simply use...

VALUES "My_Parameter" ValList

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Mats_Knutsson
Advisor

Thanks again! Actual code snippets like this is king! I wonder why GS doesn't produce a bunch...? They describe the gdl in a very technical way in the manual. I'm not a programmer at all...barely survived the mandatory pascal at school back in 1989...but I can understand pretty much when I see the coding in a real example. I mean, look at the prism command... try to do a filled circle from reading the manual...hmmm...

Now I'll create a few tree symbols. Our landscapers (20 odd people) are going to change from Autocad+NovaPoint to Archicad+Land4 and they need some simple library parts to get going. Funny project :). We'll save huge amounts of money bu changing software and as icing on the cake we get better functionality.

AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.

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!