<?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: Subroutine with variables in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160190#M13791</link>
    <description>OK, didn't realise a macro is a separate GDL part&lt;BR /&gt;
I have created a test&lt;BR /&gt;
&lt;BR /&gt;
!TestMacro 3D GDL Script&lt;BR /&gt;
 block xx1,yy1,zz1 &lt;BR /&gt;
 add xx1,0,0&lt;BR /&gt;
&lt;BR /&gt;
!Main Object 3D GDL Script&lt;BR /&gt;
call "testMacro" parameters xx1=1, yy1=1, zz1=1&lt;BR /&gt;
addx 1&lt;BR /&gt;
call "testMacro" parameters xx1=2, yy1=2, zz1=2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Works a treat. Now I just need to use this concept in reality.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Karl</description>
    <pubDate>Thu, 20 Jun 2013 01:54:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-06-20T01:54:37Z</dc:date>
    <item>
      <title>Subroutine with variables</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160187#M13788</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi All,&lt;BR /&gt;
I am trying to work out if I can use the same subroutine (I hope Im using the right terminology) with different variables within an object.&lt;BR /&gt;
I am using this for a reasonably complex custom door for my office, but I will give a basic example below what I mean&lt;BR /&gt;
&lt;BR /&gt;
!block1&lt;BR /&gt;
&lt;BR /&gt;
xx1 = 1&lt;BR /&gt;
yy1 = 1&lt;BR /&gt;
zz1 = 1&lt;BR /&gt;
&lt;BR /&gt;
gosub 200:&lt;BR /&gt;
&lt;BR /&gt;
!block2&lt;BR /&gt;
xx1 = 2&lt;BR /&gt;
yy1 = 2&lt;BR /&gt;
zz1 = 2&lt;BR /&gt;
&lt;BR /&gt;
gosub 200:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
200:&lt;BR /&gt;
block xx1,yy1,zz1&lt;BR /&gt;
add xx1,0,0&lt;BR /&gt;
&lt;BR /&gt;
I understand this is a nasty script as an example, but is there a way I can get this concept to work?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Tom&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 May 2023 08:12:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160187#M13788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-24T08:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subroutine with variables</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160188#M13789</link>
      <description>Yes, that's how you would do it... assuming there was a way of getting to block2 (block1 and block2 might be the branches of an if-then-else, for example) and that there is a return after the 200: sub code.&lt;BR /&gt;
&lt;BR /&gt;
You can do a similar thing calling macros, which are separate GDL objects rather than in-line code as in a gosub.  With macros, you give the parameter values in the call statement.</description>
      <pubDate>Thu, 20 Jun 2013 00:52:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160188#M13789</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2013-06-20T00:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subroutine with variables</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160189#M13790</link>
      <description>Thanks Karl,&lt;BR /&gt;
Im a bit new to this subroutine idea.&lt;BR /&gt;
My current door script is huge and I need to simplify it.&lt;BR /&gt;
Macros seem pretty useful&lt;BR /&gt;
&lt;BR /&gt;
Currently trying to investigate macros and struggling trying to find simple examples.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have a basic example I could use?</description>
      <pubDate>Thu, 20 Jun 2013 01:36:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160189#M13790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-20T01:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subroutine with variables</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160190#M13791</link>
      <description>OK, didn't realise a macro is a separate GDL part&lt;BR /&gt;
I have created a test&lt;BR /&gt;
&lt;BR /&gt;
!TestMacro 3D GDL Script&lt;BR /&gt;
 block xx1,yy1,zz1 &lt;BR /&gt;
 add xx1,0,0&lt;BR /&gt;
&lt;BR /&gt;
!Main Object 3D GDL Script&lt;BR /&gt;
call "testMacro" parameters xx1=1, yy1=1, zz1=1&lt;BR /&gt;
addx 1&lt;BR /&gt;
call "testMacro" parameters xx1=2, yy1=2, zz1=2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Works a treat. Now I just need to use this concept in reality.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Karl</description>
      <pubDate>Thu, 20 Jun 2013 01:54:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Subroutine-with-variables/m-p/160190#M13791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-20T01:54:37Z</dc:date>
    </item>
  </channel>
</rss>

