SOLVED!
How to replicate elements by two axes
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 12:12 PM
2020-02-14
12:12 PM
i'm new to gdl
I'm trying to make a brick wall.
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.
Here is my example:
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)<=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)>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<=lenH return

How can I replicate elements along the x axis?
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 10:31 PM
2020-02-14
10:31 PM
ohh I see
there is no xb in your code, it's as if you haven't defined it's value
there is no xb in your code, it's as if you haven't defined it's value
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 07:09 PM
2020-02-14
07:09 PM
Hi there,
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.
2. Second, this is pseudocode so that you can apply it:
rBrickLength : Brick length parameter
rBrickHeight : Brick height parameter
rBrickWidth : Brick width parameter
rJointWidth : Brick mortar width parameter (assume that its width will not change in the X o Z axis)
rWallLength = Wall final length parameter (desired parameter)
rWallHeight = Wall final height parameter(desired parameter)
_rWallLength = Wall total length at a given point of the iteration variable
_rWallHeight = Wall total height at a given point of theiteration variable
_rBrickStepLength : is the brick length + brick joint width variable
_rBrickStepHeight : is the brick Height + brick joint width variable
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.
2. Second, this is pseudocode so that you can apply it:
rBrickLength : Brick length parameter
rBrickHeight : Brick height parameter
rBrickWidth : Brick width parameter
rJointWidth : Brick mortar width parameter (assume that its width will not change in the X o Z axis)
rWallLength = Wall final length parameter (desired parameter)
rWallHeight = Wall final height parameter(desired parameter)
_rWallLength = Wall total length at a given point of the iteration variable
_rWallHeight = Wall total height at a given point of theiteration variable
_rBrickStepLength : is the brick length + brick joint width variable
_rBrickStepHeight : is the brick Height + brick joint width variable
_rWallLength = 0.00 !<-- to initialise your variables _rWallHeight = 0.00 do addz _rWallHeight do add _rWallLength brick rBrickLength, rBrickWidth, rBrickHeight _rWallLength = _rWallLength + _rBrickStepLength while (_rWallLength + _rBrickStepLength ) < rWallLength _rWallLength = 0.00 _rWallHeight = _rWallHeight + _rBrickStepHeight while (_rWallHeight + _rBrickStepHeight ) < rWallHeightYour bricks will be stacked on over another in a perfect stacked bond
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 07:27 PM
2020-02-14
07:27 PM
for s stretcher bond you will need extra variables
_iXRowIndex: Integer number for brick layed
_iZRowIndex: Integer number for row index
_rHalfBrickLength : Half brick index
_iXRowIndex: Integer number for brick layed
_iZRowIndex: Integer number for row index
_rHalfBrickLength : Half brick index
_iXRowIndex = 1 _iZRowIndex = 1 do if ((_iXRowIndex mod (2)) > 0) then addz _rWallHeight if ((_iXRowIndex mod (2)) < 1) then addz _rHalfBrickLength, 0.00, _rWallHeight do add _rWallLength brick rBrickLength, rBrickWidth, rBrickHeight _rWallLength = _rWallLength + _rBrickStepLength while (_rWallLength + _rBrickStepLength ) < rWallLength _rWallLength = 0.00 _iRowIndex = _iRowIndex + 1 _rWallHeight = _rWallHeight + _rBrickStepHeight if ((_iXRowIndex mod (2)) < 1) then addx -_rHalfBrickLength while (_rWallHeight + _rBrickStepHeight ) < rWallHeight
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 08:47 PM
2020-02-14
08:47 PM
Thank you for your reply
Sorry, but maybe you misunderstood my question.
You rewrote my code in readable form, but my code worked like this.
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
Sorry, but maybe you misunderstood my question.
You rewrote my code in readable form, but my code worked like this.
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
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-02-14 10:31 PM
2020-02-14
10:31 PM
ohh I see
there is no xb in your code, it's as if you haven't defined it's value
there is no xb in your code, it's as if you haven't defined it's value
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
