Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

ArchiCAD 13 GDL "feature"?

Ralph Wessel
Mentor
If the interface script for an object creates a button (ui_button) of type ui_function, the parameter script is called with the global variable GLOB_UI_BUTTON_ID set to the button ID when the user clicks on it. The parameter script can then respond to that button click and update all parameters as required in response to that click.

However, a change was made in ArchiCAD 13. Up to a point, everything works in the same way; the user clicks a button, the global variable GLOB_UI_BUTTON_ID is set to the button ID, the parameter script is run, and everything is updated according to the button click. But then - only in AC13 - the same sequence is repeated exactly as if the user clicked on the button again. GLOB_UI_BUTTON_ID is set to the button ID and the parameter script run.

No variable or flag indicates whether the parameter script has run because the user clicked on a button or if it is a subsequent 'echo', which means that the button function will be repeated as many times as the parameter script is run. I've been advised that developers should not count on it running a specific number of times either.

Apparently this isn't a bug, but I'm at a loss to understand why this change has been made and how it could be beneficial. Has anyone been asking for this, or found it to be helpful in some way?

As an aside, the Modular Joinery object has been updated to work around this problem - otherwise clicking 'Add Row'/'Delete Row'/etc adds/removes more than 1 row at a time. Existing users should ask their reseller for the AC13 update
Ralph Wessel BArch
Software Engineer Speckle Systems
9 REPLIES 9
Afair it was the same in 12...I mean "worked twice"

In some of my objects I used a normal "icon- parameter" instead.
but I think I soleved it some way - I do not remember now...I will paste it later today if You are interested.

Best Regards,
Piotr
Ralph Wessel
Mentor
Piotr wrote:
Afair it was the same in 12...I mean "worked twice"
In some of my objects I used a normal "icon- parameter" instead.
but I think I soleved it some way - I do not remember now...I will paste it later today if You are interested.
No, I have objects developed many versions ago that changed their behaviour radically under AC13. And GS has confirmed this is new in AC13.

I've already implemented a work-around, but my question is, "why has this changed?" and more importantly, "has anyone benefited from this change?". If there's no benefit or reason for this change, it can only be a bug (and should be fixed).
Ralph Wessel BArch
Software Engineer Speckle Systems
In this case I have to check my table editor in 13...same usage (adding and removing rows/columns)...

Best Regards,
Piotr
ztaskai
Graphisoft Alumni
Graphisoft Alumni
Hi guys,

Both of you are right.

1. All AC versions execute parameter script as many times as needed to create implied changes iteratively.
2. The value of GLOB_MODPAR_NAME and GLOB_BUTTON_ID are kept in these 'echo' runs. They always were.
3. There is a change in AC13: you cannot change the value of the global variable in the first run. This killed the usual workaround.

There is a solution though. (And I'm owing Ralph an answer about it in private for a few days now, sorry.) We added an APPLICATON_QUERY option for this purpose. A call looks like this:
n = APPLICATON_QUERY  ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", isFirstRun)
isFirstRun will contain the Boole value showing if it's the first run.

Since this function was added in the beta phase it isn't documented yet. I'll update the online documentation of APPLICATON_QUERY tomorrow.

Sorry for the poor communication of this change...

Regards,
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
Ralph Wessel
Mentor
ztaskai wrote:
We added an APPLICATON_QUERY option for this purpose. A call looks like this:
n = APPLICATON_QUERY  ("PARAMETER_SCRIPT", "FIRSTOCCASION_IN_PROGRESS", isFirstRun)
Thanks Zsolt - that's exactly what I needed.
Ralph Wessel BArch
Software Engineer Speckle Systems
ztaskai
Graphisoft Alumni
Graphisoft Alumni
ztaskai wrote:
I'll update the online documentation of APPLICATON_QUERY tomorrow.
I updated the doc. Basic Library is available from the usual URL: http://www.graphisoft.com/support/developer/documentation/LibraryDevKit/

Direct link to this chapter:
http://www.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/13/LibDevGuid...

Regards,
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
vistasp
Advisor
Ralph wrote:
Existing users should ask their reseller for the AC13 update
Got it! Thank you Ralph for such a fine object.
= v i s t a s p =
bT Square Peg
https://archicadstuff.blogspot.com
https://www.btsquarepeg.com
| AC 9-27 INT | Win11 | Ryzen 5700 | 32 GB | RTX 3050 |
Anonymous
Not applicable
Hello,
ztaskai wrote:
3. There is a change in AC13: you cannot change the value of the global variable in the first run. This killed the usual workaround.
Does this mean all the globals
ztaskai
Graphisoft Alumni
Graphisoft Alumni
Juha wrote:
Hello,
ztaskai wrote:
3. There is a change in AC13: you cannot change the value of the global variable in the first run. This killed the usual workaround.
Does this mean all the globals :shock: :?: :!:
Yes. Definitely. You can change them in one run for the current run itself but not between elements or between runs. Your changes to the AC globals are dropped after your run. This fix was very important to increase stability and speed. This change doesn't affect scripts which don't communicate with other objects or later executions via globals.

Regards,
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...