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.

How to exchange value from 2d script to parameters script

Anonymous
Not applicable
Hello!
In AC18 I used in 2d script:
GLOB_USER_1 = 10
and in paramerers script reads this value.
Now it's not working in AC19-20.
Help me, please!
How to simple pass a value from the 2d script into the parameters script?
Thanks in advance.
6 REPLIES 6
sinceV6
Advocate
Hi.
There were some changes in GDL for AC19-20 that affect what you are trying to do: http://archicad-talk.graphisoft.com/viewtopic.php?t=49395

Depending on what you need and trying to do (because of these changes in GDL), if the value is a common value or calculation to 2D script and parameter script, place it in the master script. No need to use global variables.

Best regards.
Anonymous
Not applicable
In the course of the display in 2D (script execution) I have calculated the value of the variable.
I need this value to in the script parameters, to record its value in the parameter, so I could read it from my add-on.

Need something like this:

in the 2d script:
MyValue = 10

in the script parameters:
PARAMETERS MyParameter = MyValue
sinceV6
Advocate
If it is a calculation, move it to the master script.

Master script:
MyValue = 10

2D script:
ADD2 MyValue,0 (or whatever you need "MyValue" for)

Parameter script:
PARAMETERS MyParameter = MyValue
Anonymous
Not applicable
I can't do this.

It's my situation:

In master script:
MyValue = 10

In 2d script:

... long long long drawing with calc needed value
MyValue = result_long_hard_calculations_during_drawing

In parameter script:
PARAMETERS MyParameter = MyValue
!but in result = 10, that was assigned in master script (not result_long_hard_calculations_during_drawing)

I can't do calculations doubly with GDL interpreter (it's more long time).
sinceV6
Advocate
I understand. That's what I'm trying to tell you: move the calculation part to the master script, leave the 2D drawing commands in 2D script. So if you have
Tsepov wrote:
... long long long drawing with calc needed value
MyValue = result_long_hard_calculations_during_drawing
Move the "long long long calc" part to master script and leave the "drawing" part in the 2D Script. Does that make sense? If you calculate your variables in 2D Script you won't be able to use them elsewhere (for example, in 3D, even though your library part may not have a 3D script)

In simple terms... change your script structure: make all the calculations you need and then draw based on those calcs. Unless you are making something that can't be done this way, then you would need to give more information, a screenshot, what the object is doing, or anything other than hypothetic examples.
Anonymous
Not applicable
Code is too long.
Main point is that i need to calc to show the same on a 2d result and write it to parameter.
And calculations in main script slow down user work with object when hotspot editing and slowdown work my add-ons when i change more then 1000 paramerets of that object (subrotin in main script work any 1000 times).

Thank you, sinceV6!
I doplicate code on parameter script (in main script thay can't work).

I did another way.

I created parameter RefreshState and assign it to 1 from add-ons befor recalc all 1000 parameters.
In parameter script i put IF RefreshState... , and my calcs are work properly and no slow all.

Just 2 global variables had enough in AC18 to transfer value within one object scripts...

Else time Thank YOU!
Learn and get certified!