BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.

Masterend in Macro does not allow to pass parameters

Joachim Suehlo
Advisor

I created a simple Macro, where I needed to define different variables which should be passed to the Caller. This works fine with the following Script:

 

! Macro
butter = "Apple"
END butter 

! Caller
CALL "var_define" PARAMETERS RETURNED_PARAMETERS butter
TEXT2 0, 0, butter

 

But I need to write different other scripts as well in the macro (UI, 2D, Parameter, etc.)
For this reason I have to define a "MASTEREND" in the Master-Script, because otherwise the other scripts would not be executed, because of the "END" in the Master-Script.
But now the following script does not work: the variable "butter" and its value is not passed to the Caller.

 

! Macro
butter = "Apple"
GOTO "Masterend"
END butter 
"Masterend":

! Caller
CALL "var_define" PARAMETERS RETURNED_PARAMETERS butter 
TEXT2 0, 0, butter

 

Any ideas to solve this problem?

Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
2 REPLIES 2
Peter Baksa
Graphisoft
Graphisoft

Hi,

 

the end statements need to be duplicated in each script which wants to return a value.

! Macro master
butter = "Apple"

! Macro 2D
! no code
END butter 

! Macro 3D
! lots of code
END butter 

! Macro UI
! no code, return value not used in caller - leave empty

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Joachim Suehlo
Advisor

Thank You Peter, I will test it.

Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
Learn and get certified!