<?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 Macro not called in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337131#M2853</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have defined a set of values on the parameters tab and to make it easier to use subroutines in the 3D I have a variable in Master to do it, the problem is when I test it, the call is not made and I get and error in the 3D script saying that there is a uninitialized variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The exact problem is in the 3D script, if I call the subroutine +dort which is defined in the Master, the macro is not called, but the other calls are working.&lt;/P&gt;&lt;P&gt;If I delete the +dort then the macro is called if I set gosub 202&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is just an extract of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parameters tab:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VALUES "ls" "Empty", "Flush", "1-panel"&lt;/LI-CODE&gt;&lt;P&gt;Master:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;lw=A-2*frw
lh=B-frw

IF opa3&amp;gt;90 THEN opa3=90
IF opa3&amp;lt;0 THEN opa3=0

IF ls="Empty"		THEN dort=0
IF ls="Flush"		THEN dort=1
IF ls="1-Panel"		THEN dort=2&lt;/LI-CODE&gt;&lt;P&gt;3D script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ADDx lw/2
ROTy -opa3
GOSUB 200+dort
DEL 2

DEL TOP
END

200:
!!! EMPTY WHOLE
RETURN

201:
MATERIAL lmat1
PUT 0,0,15,
0,lh,15,
-lw,lh,15,
-lw,0,15,
0,0,-1
PRISM_ NSP/3,lt,GET(NSP)
RETURN

202:
CALL door01_macro PARAMETERS lmat1=lmat1, lmat2=lmat2, lw=lw, lh=lh, lt=lt
RETURN&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Juan.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 12:32:11 GMT</pubDate>
    <dc:creator>jc4d</dc:creator>
    <dc:date>2022-04-27T12:32:11Z</dc:date>
    <item>
      <title>Macro not called</title>
      <link>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337131#M2853</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have defined a set of values on the parameters tab and to make it easier to use subroutines in the 3D I have a variable in Master to do it, the problem is when I test it, the call is not made and I get and error in the 3D script saying that there is a uninitialized variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The exact problem is in the 3D script, if I call the subroutine +dort which is defined in the Master, the macro is not called, but the other calls are working.&lt;/P&gt;&lt;P&gt;If I delete the +dort then the macro is called if I set gosub 202&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is just an extract of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parameters tab:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VALUES "ls" "Empty", "Flush", "1-panel"&lt;/LI-CODE&gt;&lt;P&gt;Master:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;lw=A-2*frw
lh=B-frw

IF opa3&amp;gt;90 THEN opa3=90
IF opa3&amp;lt;0 THEN opa3=0

IF ls="Empty"		THEN dort=0
IF ls="Flush"		THEN dort=1
IF ls="1-Panel"		THEN dort=2&lt;/LI-CODE&gt;&lt;P&gt;3D script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ADDx lw/2
ROTy -opa3
GOSUB 200+dort
DEL 2

DEL TOP
END

200:
!!! EMPTY WHOLE
RETURN

201:
MATERIAL lmat1
PUT 0,0,15,
0,lh,15,
-lw,lh,15,
-lw,0,15,
0,0,-1
PRISM_ NSP/3,lt,GET(NSP)
RETURN

202:
CALL door01_macro PARAMETERS lmat1=lmat1, lmat2=lmat2, lw=lw, lh=lh, lt=lt
RETURN&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Juan.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 12:32:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337131#M2853</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-27T12:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not called</title>
      <link>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337140#M2854</link>
      <description>&lt;P&gt;Before your if statements for dort, add dort =0&lt;/P&gt;&lt;P&gt;This initializes the parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd you have it as an actual parameter for the object then you need to push your value back to the parameter.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 13:50:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337140#M2854</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2022-04-27T13:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not called</title>
      <link>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337142#M2855</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12002"&gt;@jc4d&lt;/a&gt;&amp;nbsp;The code checking does not see the dort value as it is conditional within the if statement. I'm no big coder and I regularly get caught out by this. Just follow the good advice above by &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/5414"&gt;@SenecaDesignLLC&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of other things...&lt;/P&gt;&lt;P&gt;You could set the Dort = 0 in which case you shouldn't need to reset it with [IF LS = "Empty"...]&lt;/P&gt;&lt;P&gt;Have a look at the Values{2} command to set the Dort parameter in the parameter script&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 14:01:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337142#M2855</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2022-04-27T14:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not called</title>
      <link>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337194#M2856</link>
      <description>&lt;P&gt;Thank you both for chime in, you are right I had to define the dort first.&lt;/P&gt;&lt;P&gt;And I just noticed that the values I had the name "1-panel" and in the master I had "1-Panel" that capital letter was the error.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:44:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Macro-not-called/m-p/337194#M2856</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-28T06:44:16Z</dc:date>
    </item>
  </channel>
</rss>

