<?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: How to replicate elements by two axes in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218684#M1325</link>
    <description>Thank you for your reply&lt;BR /&gt;
&lt;BR /&gt;
Sorry, but maybe you misunderstood my question.&lt;BR /&gt;
&lt;BR /&gt;
You rewrote my code in readable form, but my code worked like this.&lt;BR /&gt;
&lt;BR /&gt;
The result of his work in the screenshot. The problem is that I can't duplicate all the elements along the X axis. Only the first element is duplicated</description>
    <pubDate>Fri, 14 Feb 2020 19:47:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-14T19:47:47Z</dc:date>
    <item>
      <title>How to replicate elements by two axes</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218681#M1322</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi there,&lt;BR /&gt;
i'm new to gdl&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to make a brick wall.&lt;BR /&gt;
I want to replicate bricks along the "z" and "x" axes with "do ... while", but I can only do this along one of the axes.&lt;BR /&gt;
Here is my example:
&lt;PRE&gt;xb = 0.25
yb = 0.12
cb = 0.065
sb = 0.01

movex = xb+sb 

lenA = (A/xb+sb) - fra(A/xb+sb)+1
if fra(B/xb+sb)&amp;lt;=0.5 then
lenH = (B/xb+sb) - fra(B/xb+sb)
else
lenH = (B/xb+sb) - fra(B/xb+sb)+1
endif

gosub "brick"
del 1
addx movex
gosub "brick"

end

"brick":

movez = cb+sb
i= movez
ii=0

do

if fra(ii/2)&amp;gt;0 then

addz i
brick xb,yb,cb
del top

else

add xb/2,0,i
brick xb,yb,cb
del top

endif

i = i+movez
ii=ii+1

while i&amp;lt;=lenH

return&lt;/PRE&gt;
&lt;A href="https://ibb.co/NSVz3wv" target="_blank"&gt;&lt;IMG src="https://i.ibb.co/NSVz3wv/image.png" /&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
How can I replicate elements along the x axis?&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Feb 2020 11:12:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218681#M1322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-14T11:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate elements by two axes</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218682#M1323</link>
      <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
1. First, there is a section in the GDL reference manual about scripting style, I advise you to read it and apply it as you can, since it will help with script readability.&lt;BR /&gt;
&lt;BR /&gt;
2. Second, this is pseudocode so that you can apply it:&lt;BR /&gt;
&lt;BR /&gt;
rBrickLength : Brick length parameter&lt;BR /&gt;
rBrickHeight : Brick height parameter&lt;BR /&gt;
rBrickWidth : Brick width parameter&lt;BR /&gt;
rJointWidth : Brick mortar width parameter (assume that its width will not change in the X o Z axis)&lt;BR /&gt;
&lt;BR /&gt;
rWallLength = Wall final length parameter (desired parameter)&lt;BR /&gt;
rWallHeight = Wall final height parameter(desired parameter)&lt;BR /&gt;
&lt;BR /&gt;
_rWallLength = Wall total length at a given point of the iteration variable&lt;BR /&gt;
_rWallHeight = Wall total height at a given point of theiteration variable&lt;BR /&gt;
&lt;BR /&gt;
_rBrickStepLength : is the brick length + brick joint width variable &lt;BR /&gt;
_rBrickStepHeight : is the brick Height + brick joint width variable&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
_rWallLength = 0.00		!&amp;lt;-- to initialise your variables
_rWallHeight = 0.00

do
	addz _rWallHeight

	do
		add _rWallLength

		brick rBrickLength, rBrickWidth, rBrickHeight

		_rWallLength = _rWallLength + _rBrickStepLength
	while  (_rWallLength +  _rBrickStepLength ) &amp;lt; rWallLength

	_rWallLength = 0.00

	_rWallHeight = _rWallHeight + _rBrickStepHeight 
while (_rWallHeight +  _rBrickStepHeight ) &amp;lt; rWallHeight

&lt;/PRE&gt;

Your bricks will be stacked on over another in a perfect stacked bond</description>
      <pubDate>Fri, 14 Feb 2020 18:09:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218682#M1323</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2020-02-14T18:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate elements by two axes</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218683#M1324</link>
      <description>for s stretcher bond you will need extra variables&lt;BR /&gt;
&lt;BR /&gt;
_iXRowIndex: Integer number for brick layed&lt;BR /&gt;
_iZRowIndex: Integer number for row index&lt;BR /&gt;
&lt;BR /&gt;
_rHalfBrickLength : Half brick index&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
_iXRowIndex = 1
_iZRowIndex = 1

do
	if ((_iXRowIndex mod (2)) &amp;gt; 0) then addz _rWallHeight
	if ((_iXRowIndex mod (2)) &amp;lt; 1) then addz _rHalfBrickLength, 0.00, _rWallHeight

	do
		add _rWallLength

		brick rBrickLength, rBrickWidth, rBrickHeight

		_rWallLength = _rWallLength + _rBrickStepLength
	while  (_rWallLength +  _rBrickStepLength ) &amp;lt; rWallLength

	_rWallLength = 0.00

	_iRowIndex = _iRowIndex + 1
	_rWallHeight = _rWallHeight + _rBrickStepHeight 

	if ((_iXRowIndex mod (2)) &amp;lt; 1) then addx -_rHalfBrickLength
while (_rWallHeight +  _rBrickStepHeight ) &amp;lt; rWallHeight

&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2020 18:27:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218683#M1324</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2020-02-14T18:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate elements by two axes</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218684#M1325</link>
      <description>Thank you for your reply&lt;BR /&gt;
&lt;BR /&gt;
Sorry, but maybe you misunderstood my question.&lt;BR /&gt;
&lt;BR /&gt;
You rewrote my code in readable form, but my code worked like this.&lt;BR /&gt;
&lt;BR /&gt;
The result of his work in the screenshot. The problem is that I can't duplicate all the elements along the X axis. Only the first element is duplicated</description>
      <pubDate>Fri, 14 Feb 2020 19:47:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218684#M1325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-14T19:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate elements by two axes</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218685#M1326</link>
      <description>ohh I see&lt;BR /&gt;
&lt;BR /&gt;
there is no xb in your code, it's as if you haven't defined it's value</description>
      <pubDate>Fri, 14 Feb 2020 21:31:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-replicate-elements-by-two-axes/m-p/218685#M1326</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2020-02-14T21:31:12Z</dc:date>
    </item>
  </channel>
</rss>

