<?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: Parameter buffer an Loops in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377290#M137</link>
    <description>&lt;P&gt;Thanks, it worked &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 14:00:41 GMT</pubDate>
    <dc:creator>MF BIM</dc:creator>
    <dc:date>2023-04-20T14:00:41Z</dc:date>
    <item>
      <title>Parameter buffer and Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377284#M135</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to know how to improve my use of the Parameter buffer when it comes to loops because I have a loop that create a simple stack of prisms :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;for N = 1 to 4
	put		0, 0, 15,
			1, 0, 15,
			1, 1, 15,		
			0, 1, 15,	
			0, 0, 1
	prism_	nsp/3, 0.5, get(nsp)
	addz	0.5
next N
del 4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel this code is not good as I populate and clear the stack with each loop rather than populating it once, looping the geometry and clearing the stack at the end. I would like to make it better but the following snippet doesn't work :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;put	0, 0, 15,
	1, 0, 15,
	1, 1, 15,		
	0, 1, 15,	
	0, 0, 1
for N = 1 to 4
	prism_	nsp/3, 0.5, use(nsp)
	addz	0.5
next N
del 4
get(nsp) ! Clearing the stack that way after the loop doesn't work&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is there a way to clear the parameter buffer without having to use get() in a command ? Or am I reduced to do this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;put	0, 0, 15,
	1, 0, 15,
	1, 1, 15,		
	0, 1, 15,	
	0, 0, 1
for N = 1 to 4-1
	prism_	nsp/3, 0.5, use(nsp)
	addz	0.5
next N
prism_	nsp/3, 0.5, get(nsp)
del 3
get(nsp) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks less readable but seems to be the only solution ?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 14:30:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377284#M135</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2023-04-20T14:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter buffer an Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377289#M136</link>
      <description>&lt;P&gt;Try to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if NSP&amp;gt;0 then ttt = max(get(NSP))&lt;/LI-CODE&gt;&lt;P&gt;Final code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;n_prism = 4

put	0, 0, 15
put	1, 0, 15
put	1, 1, 15	
put	0, 1, 15
put	0, 0, 1
for N = 1 to n_prism
	prism_	nsp/3, 0.5, use(nsp)
	addz	0.5
next N
del n_prism
if nsp&amp;gt;0 then ttt = max(get(nsp))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 13:46:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377289#M136</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2023-04-20T13:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter buffer an Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377290#M137</link>
      <description>&lt;P&gt;Thanks, it worked &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 14:00:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/377290#M137</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2023-04-20T14:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter buffer and Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/397718#M5531</link>
      <description>&lt;P&gt;The last get (nsp) is not needed because it does not perform any operations and only extracts data, resulting in a program error.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 00:36:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/397718#M5531</guid>
      <dc:creator>yongler</dc:creator>
      <dc:date>2023-09-09T00:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter buffer and Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/397787#M5545</link>
      <description>&lt;P&gt;If you only ever 'USE' the PUT stack, then the stack will remain populated.&lt;/P&gt;
&lt;P&gt;The last 'GET' just clears the stack so you can use PUT again later if you need to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 01:35:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/397787#M5545</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-09-11T01:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter buffer and Loops</title>
      <link>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/583560#M6170</link>
      <description>&lt;P&gt;It should be possible to just use GET(NSP) to Empty the stack. While it is not, Thank you for this solution.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:33:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Parameter-buffer-and-Loops/m-p/583560#M6170</guid>
      <dc:creator>concepsys</dc:creator>
      <dc:date>2024-01-11T14:33:27Z</dc:date>
    </item>
  </channel>
</rss>

