Interconnected Parameters a=b and b=a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-21
02:41 PM
- last edited on
‎2024-08-26
12:50 AM
by
Laszlo Nagy
Hi gdl wizards.
Can anybody help create (Parameter) script that will adjust the values in a way that if parameter "xx" changes then parameter "f1" will change accordingly - and then if paramter "f1" changes parameter "xx" will update accordingly.
I know how to do this:
f1=ATN(xx)
PARAMETERS f1=f1
xx=TAN(f1)
PARAMETERS xx=xx
But in this case "f1" becomes locked!
I need both parameters to be able to control the other one, at any given time!
Hope the information is sufficient enough ‌‌
Cheers
Thomas
AC 13 +
Solved! Go to Solution.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-22 03:21 AM
Yes GLOB_MODPAR_NAME is your friend here.
I would not use ...
if GLOB_MODPAR_NAME = "xx" then
f1 = xx * 2
parameters f1 = f1
else
xx = f1 / 2
parameters xx = xx
endif
That will work but means if 'xx' is modified,' f1' will update, but if any other parameter is changed 'xx' will be updated.
If you don't want that and only want 'xx' to update when 'f1' is changed then just use separate routines ...
if GLOB_MODPAR_NAME = "xx" then
f1 = xx * 2
parameters f1 = f1
endif
if GLOB_MODPAR_NAME = "f1" then
xx = f1 / 2
parameters xx = xx
endif
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-21 03:26 PM
If you look at the section titled "Connections between parameters" on this page it should explain how to do it.
https://gdl.graphisoft.com/gdl-basics/parameter-logic
I've not tried it myself, but it looks as though you check the value of GLOB_MODPAR_NAME to see which parameter is being changed and act accordingly. This prevents it getting into a circular loop.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-22 03:20 AM - edited ‎2024-08-22 03:22 AM
IF GLOB_MODPAR_NAME = "A" then
B = xA
PARAMETERS B = B
endIF
IF GLOB_MODPAR_NAME = "B" then
A = B/x
PARAMETERS A = A
endIF
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-22 03:21 AM
Yes GLOB_MODPAR_NAME is your friend here.
I would not use ...
if GLOB_MODPAR_NAME = "xx" then
f1 = xx * 2
parameters f1 = f1
else
xx = f1 / 2
parameters xx = xx
endif
That will work but means if 'xx' is modified,' f1' will update, but if any other parameter is changed 'xx' will be updated.
If you don't want that and only want 'xx' to update when 'f1' is changed then just use separate routines ...
if GLOB_MODPAR_NAME = "xx" then
f1 = xx * 2
parameters f1 = f1
endif
if GLOB_MODPAR_NAME = "f1" then
xx = f1 / 2
parameters xx = xx
endif
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-27 08:26 AM
Thanks Barry.
That did the trick. Much appreciated 🙂
AC 13 +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-08-27 08:27 AM
Thanks for that fast reply Lingwisyer. 🙂
AC 13 +