Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Call macro and parameters all

Manuel
Newcomer
Hi,
I try to understand macros. Some elements from Graphisoft include this part of the script.
call "macro",
parameters all alpha = alpha
Why do I need "alpha = alpha", when the name of the variable is the same in the caller object and in the macro?

Thanks for your support.
Manuel Emmenegger / Digital Construction
www.hunold-architekten.ch
AC24 CH • iMac 27" 3.6 GHz Intel Core i9 | 64 gb ram • OSX 10.14.6
4 REPLIES 4

Dominic Wyss
Booster
Hi Manuel

Maybe the value of alpha was modified in the caller script. So its actual value has to be passed with
alpha = alpha
In this situation the first "alpha" is a variable and the second "alpha" is the name of the parameter in the called macro.


if you don't do that the original value will be passed to the macro:

!parameter list:
!alpha = 90

!masterscript:
alpha = 270

!2d-script:
call "macroname" parameters all ! <= alpha in macro = 90
call "macroname" parameters all alpha = alpha ! <= alpha in macro = 270
HTH Dominic
AC23 CHE - macOS Catalina

Anonymous
Not applicable
Hi Dominic,

Can I use CALL from macro parameter become to other parameter in call object?
Example: I want to call Resize_A_B macro (A, B parameter for resize) but in my object I want to resize difference parameters (e.g. width & height parameter)

Thanks in advance

Peter Baksa
Graphisoft
Graphisoft
No, a macro can only change parameters (parameter script, hotspots) that the placeable object has, GDL doesn't have the concept of passing parameters by reference.
Péter Baksa
Software Engineer, Library as a Platform
GRAPHISOFT SE, Budapest

Peter Baksa
Graphisoft
Graphisoft

!parameter list:
!alpha = 90

!masterscript:
alpha = 270

!2d-script:
call "macroname" parameters all ! <= alpha in macro = 90
call "macroname" parameters all alpha = alpha ! <= alpha in macro = 270
That's not the case, both calls will give alpha = 270 to the macro.
Writing any <param> = <param> after all is just an emphasis.
It has to be written only in case when the placeable object doesn't have a parameter that the macro has (when it's only a variable in the caller object).
Péter Baksa
Software Engineer, Library as a Platform
GRAPHISOFT SE, Budapest

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!