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.

GDL: Values Stepping

Lingwisyer
Guru

Hi All,

 

I have an integer array of myvalue equals 1 or -1. For purpose this worked fine, but I was wanting to add hotspots to toggle these values. It is at this point that the rounding of AC messes things up. Given 2 values, you would think that it would swap between them around the median point, but instead the rounding ignores the range, then rounds up to the nearest allowed value. In this situation, this means that the flip from -1 to 1 occures at -0.5 rather than 0... Using range[-1,1] step 1, 2, instead of static values, has the same issue.

 

I have sort of gotten around this by changing to a length type array instead of integer and using the flag 1024, though this means I will need to use a dud array parameter for visual feed back or find some way to hide the display parameter.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
6 REPLIES 6
julienK
Advocate

You can try using the parameter script to force myvalue to only be 1 or -1. hotspot should then snap from one to the other

in parameter script:

VALUES "myvalue" -1,1

That was how I defined myvalue to those numbers XD

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

In your post you say you're using range, which allows for all values between -1 and 1.

Oh. That was just noting that I had also tried using range with step verse using static values to see if that would change the flip point... Sorry for the confusion.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Barry Kelly
Moderator

I am not sure if this is of any help.

It is not for an array, but I am sure you can adapt it.

 

It is an on/off hotspot that uses a prescribed distance (can be what ever you want) for the stretchy part.

But it is linked to an on/off boolean parameter (that does the on/off bit) and also an "On/Off" text parameter that the user sees if they go into the object settings.

 

I think the text parameter is better for users to understand and it is also the value shown in the hotspot as you move it.

 

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

Yeah, that is basically what I figured I would have to do. It just means I need to initiallise another dynamic array... Some other day...

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Learn and get certified!