BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

UI Button Double Action?

LGreen
Booster
Ok GDL geniuses, any ideas on this one?

I have set up some buttons in the UI which are to add / subtract 1 from a parameter. Sounds simple. The code itself is very simple (see below or attached object). However it seems to run it twice, each time you click the button, the parameter goes up or down by two not one. If you change the interval to 2, it will go up/down by 4. Unfortunately you can't set the interval to .5 as it rounds it.

A similar function, which relies on buttons, has the same issue. It re-orders the values in an array. It works fine, except again it does it twice, re-ordering the re-ordered array.

Does anyone have some suggestions as to what may be causing this? This is driving me nuts.
unID = 1
button_insert = unID : unID = unID +1
button_delete = unID : unID = unID +1
button_set = unID : unID = unID +1

IF GLOB_UI_BUTTON_ID = button_insert THEN
value = test +1
PARAMETERS test = value
ENDIF

IF GLOB_UI_BUTTON_ID = button_delete THEN
PARAMETERS test = test -1
ENDIF

IF GLOB_UI_BUTTON_ID = button_set THEN
PARAMETERS test = 2
ENDIF
Lachlan Green | Architect | Drafter
AusBuild
AC23 & 25 | Windows 10 | Intel 11Gen Core i7 | 2.5GHz | 32GB RAM | Nvidia T1200
2 REPLIES 2
Barry Kelly
Moderator
You should find your solution here ...
http://archicad-talk.graphisoft.com/viewtopic.php?t=48202

The parameter script gets run more than once.

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
LGreen
Booster
Thank you Barry! I can't believe how simple that was!

I had seen that post before when I was trying something different, but I completely forgot about it.

In case anyone else is interested I've attached the fixed object with the bit of code Michael Rensing put up almost 5 years ago!

Thanks again Barry.
Lachlan Green | Architect | Drafter
AusBuild
AC23 & 25 | Windows 10 | Intel 11Gen Core i7 | 2.5GHz | 32GB RAM | Nvidia T1200
Learn and get certified!

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!