<?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: For To Next array in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/602582#M6586</link>
    <description>&lt;P&gt;Is there also the problem that "i" is being used for both of the loop counters and one is overwriting the other?&amp;nbsp; If you change the other to "j" or whatever does it then work?&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 23:12:48 GMT</pubDate>
    <dc:creator>neilmcallister</dc:creator>
    <dc:date>2024-05-03T23:12:48Z</dc:date>
    <item>
      <title>For To Next array</title>
      <link>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/597443#M6473</link>
      <description>&lt;P&gt;Hi, I am getting trying to get into GDL and wanted to try and create a simple object of a rectangle with an adjustable amount of divisions and border. I attempted to reverse engineer the "DET_Layout_Template" object that comes with archicad but I am having trouble getting my For To Next command to actually repeat and move.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	FOR i = 1 to divx STEP 1
	GOSUB 3050 !Column of boxes
		ADD2 lw,0
	NEXT i
END

!=======================================

3050:
	FOR i = 1 TO divy STEP 1
		POLY2_B 5, 3, flpen, flbkpen,
		0,0,1,
		lw,0,1,
		lw,lh,1,
		0,lh,1,
		0,0,1
		ADD2 0, lh+munt
	NEXT i
RETURN&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have for my script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;add2 -ModW,0
for i=1 to MN2 step 1
	gosub 3050 ! display column of boxes
	add2 -ModW - psGapX ,0 ! advance to next column position
next i
end

! ========= Subroutine to display column of module-sized boxs
3050:
mnh=mn1+1
repeat
	pen 99
	hotspot2 0, 0
	hotspot2 ModW, 0
	hotspot2 0, ModH
	hotspot2 ModW ,ModH
	pen 95
	rect2 0, 0, ModW, ModH
! Hotlines on rectangle for easier snapping
	hotline2 0, 0, ModW, 0
	hotline2 ModW, 0, ModW, ModH
	hotline2 ModW, ModH, 0, ModH
	hotline2 0, ModH, 0, 0
	pen 92
	line2 0, 0, ModW, ModH
	line2 0, ModH, ModW,0
	add2 0, ModH + psGapY
	mnh = mnh-1
until mnh = 1

del mn1
RETURN&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what is in the DET_Layout_Template object, I can't for the life of me figure out how this one gets the subroutine to "advance to the next column position"&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 08:21:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/597443#M6473</guid>
      <dc:creator>Alex C</dc:creator>
      <dc:date>2024-09-24T08:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: For To Next array</title>
      <link>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/598259#M6503</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you need to &lt;A href="https://gdl.graphisoft.com/reference-guide/managing-the-transformation-stack" target="_blank" rel="noopener"&gt;DEL&lt;/A&gt; the transformations done in Y direction to start at the same Y coordinate in the next X column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 11:23:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/598259#M6503</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2024-04-08T11:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: For To Next array</title>
      <link>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/602582#M6586</link>
      <description>&lt;P&gt;Is there also the problem that "i" is being used for both of the loop counters and one is overwriting the other?&amp;nbsp; If you change the other to "j" or whatever does it then work?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 23:12:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/602582#M6586</guid>
      <dc:creator>neilmcallister</dc:creator>
      <dc:date>2024-05-03T23:12:48Z</dc:date>
    </item>
    <item>
      <title>Betreff: For To Next array</title>
      <link>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/602618#M6591</link>
      <description>&lt;P&gt;You cannot use the same loop counter like "i" in nested loops more than 1 time.&lt;BR /&gt;If you start your first loop with the counter "i" and then jump to the subroutine with a second loop, you should use there another counter, e.g. "j", otherwise you will get an error message or an infinty loop.&lt;BR /&gt;That's why I always use in a loop within a Subroutine double characters as counter, like ii and jj (or i_1 and j_1), and in one subroutine deeper iii and jjj and so on.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 14:08:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/For-To-Next-array/m-p/602618#M6591</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2024-05-04T14:08:43Z</dc:date>
    </item>
  </channel>
</rss>

