<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RETURNED_PARAMETERS in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284025#M3446</link>
    <description>By the way, where do you normally place the CALL in the parent object? &lt;BR /&gt;
&lt;BR /&gt;
The object I'm calling is actually a chair so I am calling it in the 3D script. And since I need the dimensions, I am returning the parameters in the macro from the Parameter script.&lt;BR /&gt;
&lt;BR /&gt;
Does the placement of these in a particular script in both the parent &amp;amp; macro affect in anyway?</description>
    <pubDate>Thu, 15 Jul 2021 04:53:29 GMT</pubDate>
    <dc:creator>dushyant</dc:creator>
    <dc:date>2021-07-15T04:53:29Z</dc:date>
    <item>
      <title>RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284019#M3440</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;
&lt;PRE&gt;CALL 'childObject' PARAMETERS RETURNED_PARAMETERS param1&lt;/PRE&gt;
Then if I try, say
&lt;PRE&gt;PRINT param1&lt;/PRE&gt;
it gives an error: "Unitialised variable"&lt;BR /&gt;&lt;BR /&gt;I tried calling the object in the 3D script, Master script, and the Parameter script, and get the same error.&lt;BR /&gt;&lt;BR /&gt;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..&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:59:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284019#M3440</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-09-14T06:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284020#M3441</link>
      <description>As you described, in another scripts this method is working. Try to search error in your macro. The error can be the reason why macro is not passing parameter. This the most annoying part in programming. Sometimes it can be some silly misspelling, that ruined the whole script.</description>
      <pubDate>Wed, 14 Jul 2021 14:51:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284020#M3441</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-07-14T14:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284021#M3442</link>
      <description>I checked all scripts, and there's no error prompted...</description>
      <pubDate>Wed, 14 Jul 2021 15:49:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284021#M3442</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-14T15:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284022#M3443</link>
      <description>Publish your objects here - maybe someone will figure out where is the problem.</description>
      <pubDate>Wed, 14 Jul 2021 19:15:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284022#M3443</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-07-14T19:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284023#M3444</link>
      <description>&lt;BLOCKQUOTE&gt;dushyant wrote:&lt;BR /&gt;
Then if I try, say &lt;PRE&gt;PRINT param1&lt;/PRE&gt; it gives an error: "Unitialised variable"
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
Uninitialised variable just means it does not know what type of variable it is, number, string, etc.&lt;BR /&gt;
&lt;BR /&gt;
Try adding ...&lt;BR /&gt;
&lt;BR /&gt;
param1 = 0&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
&lt;BR /&gt;
param1 = "" (if it is a string)&lt;BR /&gt;
&lt;BR /&gt;
Before the CALL command.&lt;BR /&gt;
&lt;BR /&gt;
That way you are initialising the parameter before you use it.&lt;BR /&gt;
I think also if you set the parameter in the parameter list of your parent object, that will do the same thing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 15 Jul 2021 00:36:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284023#M3444</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2021-07-15T00:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284024#M3445</link>
      <description>Barry,&lt;BR /&gt;
&lt;BR /&gt;
Initialising the variable before the macro call does avoid that error of 'unitialised variable'. But then the value is still not changed.. meaning the macro is not returning it perhaps.&lt;BR /&gt;
&lt;BR /&gt;
Yes, I had set the parameter in the parent object same as the RETURNED_PARAMETERS. Since it didn't work, I removed them to check if that was clashing with it. &lt;BR /&gt;
&lt;BR /&gt;
Anyway, I'll check the macro object again.</description>
      <pubDate>Thu, 15 Jul 2021 04:35:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284024#M3445</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T04:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284025#M3446</link>
      <description>By the way, where do you normally place the CALL in the parent object? &lt;BR /&gt;
&lt;BR /&gt;
The object I'm calling is actually a chair so I am calling it in the 3D script. And since I need the dimensions, I am returning the parameters in the macro from the Parameter script.&lt;BR /&gt;
&lt;BR /&gt;
Does the placement of these in a particular script in both the parent &amp;amp; macro affect in anyway?</description>
      <pubDate>Thu, 15 Jul 2021 04:53:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284025#M3446</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T04:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284026#M3447</link>
      <description>I just tried with another test object as macro, and returned a value from it in the Parameter script. Then I called it in the Parameter script of the caller and its returned-params are successfully received. &lt;BR /&gt;
But when I called the same macro in the 3D script, the returned params are not received it seems.. &lt;BR /&gt;
&lt;BR /&gt;
So again, I would like to know if it matters from which script we return the params in the macro and in which script we call it in the caller.</description>
      <pubDate>Thu, 15 Jul 2021 05:14:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284026#M3447</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T05:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284027#M3448</link>
      <description>If you are looking at setting parameter values, then I would CALL in the master or parameter script.&lt;BR /&gt;
Ideally master - then all scripts will have access to this returned parameter value.&lt;BR /&gt;
If you CALL in the 3D script, that parameter value can only be used in the 3D script.&lt;BR /&gt;
At least that is my understanding of how it works.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 15 Jul 2021 05:36:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284027#M3448</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2021-07-15T05:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284028#M3449</link>
      <description>Ok Barry.&lt;BR /&gt;
&lt;BR /&gt;
So far I observed it just does not retrieve the returned parameters in the 3D script. Anyone, please let me know if it &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;is&lt;E&gt;&lt;/E&gt; possible to get the returned parameters from a macro called in the 3D script.</description>
      <pubDate>Thu, 15 Jul 2021 05:40:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284028#M3449</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T05:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284029#M3450</link>
      <description>have you tried to look up &lt;A href="http://gdl.graphisoft.com/gdl-basics/subroutines-macros" target="_blank"&gt;AC example?&lt;/A&gt; They even have there object available for downloading</description>
      <pubDate>Thu, 15 Jul 2021 07:49:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284029#M3450</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2021-07-15T07:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284030#M3451</link>
      <description>&lt;BLOCKQUOTE&gt;A. wrote:&lt;BR /&gt;have you tried to look up &lt;A href="http://gdl.graphisoft.com/gdl-basics/subroutines-macros" target="_blank"&gt;AC example?&lt;/A&gt; They even have there object available for downloading&lt;/BLOCKQUOTE&gt;

A. Smith, I had referred that page, but didn't download the example. I'll check it out.</description>
      <pubDate>Thu, 15 Jul 2021 07:53:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284030#M3451</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T07:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284031#M3452</link>
      <description>&lt;BLOCKQUOTE&gt;dushyant wrote:&lt;BR /&gt;
Ok Barry.&lt;BR /&gt;
&lt;BR /&gt;
So far I observed it just does not retrieve the returned parameters in the 3D script. Anyone, please let me know if it &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;is&lt;E&gt;&lt;/E&gt; possible to get the returned parameters from a macro called in the 3D script.
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
It does work - I just tested it.&lt;BR /&gt;
So long as it is an actual parameter in the parameter list of the CALLed macro, and you have an ... END parameter_name ... in the 3D script.&lt;BR /&gt;
&lt;BR /&gt;
But be careful, as you are returning the value of that parameter as it is in the 3D script.&lt;BR /&gt;
i.e. you can change its value in the 3D script of the macro and it will return that value.&lt;BR /&gt;
But the value in the 3D script is not necessarily the value of that parameter in the parameter list of the macro - you can not set that from the 3D script - only override it.&lt;BR /&gt;
Changing the value of a parameter in the 3D script will not affect the 2D script&lt;BR /&gt;
&lt;BR /&gt;
So if you are using the macro to calculate a parameter value - that is best done in the master script.&lt;BR /&gt;
Both the CALL and the parameter calculations that is.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 15 Jul 2021 08:36:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284031#M3452</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2021-07-15T08:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284032#M3453</link>
      <description>Barry,&lt;BR /&gt;
Thanks for the info. &lt;BR /&gt;
So to get the returned parameters in the 3D script, the macro must return it from its 3D script.</description>
      <pubDate>Thu, 15 Jul 2021 09:06:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284032#M3453</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T09:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284033#M3454</link>
      <description>Upload your problematic script here - give pips chance to take a look. Maybe you do some logical mistake - and getting troubles, don't understand something in GDL structure... You will save a lot of your time by showing your script. Otherwise I'm out of this conversation.</description>
      <pubDate>Thu, 15 Jul 2021 09:21:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284033#M3454</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-07-15T09:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284034#M3455</link>
      <description>Podolsky,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Thanks all for your help!</description>
      <pubDate>Thu, 15 Jul 2021 09:36:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284034#M3455</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T09:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284035#M3456</link>
      <description>&lt;BLOCKQUOTE&gt;dushyant wrote:&lt;BR /&gt;
So to get the returned parameters in the 3D script, the macro must return it from its 3D script.
&lt;/BLOCKQUOTE&gt;

Yes, but as I say be careful.&lt;BR /&gt;
If you return a parameter value in the 3D script, you can only use it in the 3D script of the parent object.&lt;BR /&gt;
It will not be available in the 2D script and you can not set the actual value of the parameter in the parameter list (i.e. PARAMETERS param_1 = param_1 ... only works in the master or parameter scripts).&lt;BR /&gt;
&lt;BR /&gt;
Return a parameter in the master script and it is available for all of the other scripts in the parent object.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 15 Jul 2021 09:49:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284035#M3456</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2021-07-15T09:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284036#M3457</link>
      <description>Yes, got it. I'm not returning params from the 3D script now. &lt;BR /&gt;
Thanks Barry.</description>
      <pubDate>Thu, 15 Jul 2021 11:05:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284036#M3457</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-15T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284037#M3458</link>
      <description>The best way to handle returned parameters routine is:&lt;BR /&gt;
&lt;BR /&gt;
1. Make all necessary calculations / formulas in master script and define all variables (arrays) there.&lt;BR /&gt;
2. Finish 2D, 3D, UI and parameter scripts with END and list of returned parameters - especially if this macro can be used multiply times with different objects.&lt;BR /&gt;
3. In parameter script try to avoid using any mathematical calculations in command PARAMETERS. For example in parameter script instead of using PARAMETERS A=B+C, move A=B+C into master script and leave in parameter script only PARAMETERS A=A. Use mathematical computations in PARAMETER only if it happens in case of GLOB_MODPAR_NAME='something'.&lt;BR /&gt;
&lt;BR /&gt;
Another good practise to get good working library of macros/objects is to start development from one object with core features. After save a copy of it, delete all scripts (keeping the same parameters) and make macro requests to the first object. Add additional parameters and infill it with scripts, adding to that secondary features. Make copy again and repeat steps as with first copy.&lt;BR /&gt;
Then let say your third object will be visible for ArchiCAD and two previous non-placeable macros.&lt;BR /&gt;
&lt;BR /&gt;
Let say I have such a matrioshka of macros: first macro is finding the path of curve, draw the lines, arches and hotspots in 2D and 3D space. Second macro is building 3D body based on first defined curve. Setting pens and materials. Third object - visible to user, controlling different parameters entered by user in UI.</description>
      <pubDate>Thu, 15 Jul 2021 17:44:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284037#M3458</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-07-15T17:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: RETURNED_PARAMETERS</title>
      <link>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284038#M3459</link>
      <description>Thanks for sharing that Podolsky!</description>
      <pubDate>Fri, 16 Jul 2021 05:33:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/RETURNED-PARAMETERS/m-p/284038#M3459</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-07-16T05:33:04Z</dc:date>
    </item>
  </channel>
</rss>

