We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

RETURNED_PARAMETERS

dushyant
Enthusiast
Hi

I'm trying to return some parameters from an object called in the parent object. I have placed the parameter names after the 'END' in the parameter script. In the caller, I'm doing as:
CALL 'childObject' PARAMETERS RETURNED_PARAMETERS param1
Then if I try, say
PRINT param1
it gives an error: "Unitialised variable"

I tried calling the object in the 3D script, Master script, and the Parameter script, and get the same error.

How do I access the returned parameter? I have tried in a similar way for another set of objects calling another macro, and it worked there. Don't understand what's wrong here..

Thanks
23 REPLIES 23
Peter Baksa
Graphisoft
Graphisoft
That could be also done by setting the parameter in the macro directly, not using returned_parameters.
Depends on whether you can use a fixed parameter name, or need to set different parameters conditonally.
dushyant wrote:
I had managed it, by returning params from the Parameter script of the macro, and retrieving them in the caller's Parameter script and setting callers params, when I used in the 3D.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
dushyant
Enthusiast
Peter wrote:
That could be also done by setting the parameter in the macro directly, not using returned_parameters.
Depends on whether you can use a fixed parameter name, or need to set different parameters conditonally.
Okay, I see. So then the parameter (of macro) would be available directly in the caller in all the scripts?
Peter Baksa
Graphisoft
Graphisoft
You have to add it to the parameter list of the macro and the object too. But it's enough to set in the macro, the object will see the changed value too.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
dushyant
Enthusiast
Peter wrote:
You have to add it to the parameter list of the macro and the object too. But it's enough to set in the macro, the object will see the changed value too.
Okay, thanks!