Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Brand Spanking New GDL Book

Aaron Bourgoin
Virtuoso
Cadimage Tools scripting wizards have written a big book on GDL - to be published shortly.

http://blog.cadimagetools.com/
Think Like a Spec Writer
AC4.55 through 27 / USA AC27-6000 USA
Rhino 8 Mac
MacOS 14.6.1
106 REPLIES 106
Anonymous
Not applicable
Ok,
Well that answer totally surprised me.
That allows me to look at it in a whole new light.
Thanks
Anonymous
Not applicable
Hi Andrew,

I've just received a copy of your book from Infor, our local reseller, and I must say thank you very much for this piece of work...
Your book not only covers all the "technic" aspects of the GDL in a very friendly and detailed way, but brings us with the "philosophic" and the "economic" aspects of creating powerful GDL objects...
IMO your book is a turning point for the GDL culture... at the same level of the legendary David Nicholson Cole's "GDL Cook Book"...
Maybe now GS/Nemetschek will start to develop a so much needed GDL 2.0...

Thank you Andrew.
rocorona
Booster
Maybe now GS/Nemetschek will start to develop a so much needed GDL 2.0...
Or, at least, a decent developing environment.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Hi Andrew,
I really like page 65, somehow is easy to relate to for me, being a board and nail kinda guy. So I hope I’m not asking too much, but could you annotate some of this page for me to study.
Others in my beginning stage might like it also I would assume.
I feel if I get this page totally, I would have a foothold to stand on.
I have put a bit of time into modifying and adjusting script to see what happens, but still can’t figure it all out.
Also would it be hard for you to make simple 3d script for these boards to study?


!Fill and Pen
pen boardPen I get this
fill boardFill I get this

!Hotspots
hotspot2 0, 0 Why not call 1st one hotspot1?
hotspot2 a, 0 How does the “a” HS seem to know to go to near end of last board?

!Place a row of boards
for x = 0 to a step boardWidth + gap The beginning board location call out, right?
add2 x, 0 Add two times board to get next board start?
gosub "Tongue & Groove Board" I get this.
del 1 Why does this not delete the gosub just above?
next x I get this, (Ithink) (a loop?)
end I get this.
"Tongue & Groove Board": I get this
poly2 14, 7, Messed with different numbers but did not “get it.”
0, chamfer, How does script know to put chamfer on bottom?
chamfer, 0, Can you also annotate the remaining lines?
boardWidth - chamfer, 0,
boardWidth, chamfer,
boardWidth, (boardThick - tongueThick)/2,
boardWidth + tongueLength, (boardThick - tongueThick)/2,
boardWidth + tongueLength, (boardThick + tongueThick)/2,
boardWidth, (boardThick + tongueThick)/2,
boardWidth, boardThick,
0, boardThick,
0, (boardThick + tongueThick)/2 + gap,
tongueLength, (boardThick + tongueThick)/2 + gap,
tongueLength, (boardThick - tongueThick)/2 - gap,
0, (boardThick - tongueThick)/2 - gap
Return why does this not say end?

Thanks again for all your help.
PS; Also played with “gap” parameter that was set as 0’ and yet there was a gap.
I changed it to 1/8” and gap got larger as I suspected, Then tried to change to 1/16” but it kept reverting
back to original 0’ but now at 0’ there was no actual gap. Did not understand that.
And why can’t I get 1/16th to work. Is it a mm to inch issue?
(Tried to attach a word.doc that I had formatted to read easier but would not accept .doc I found out) That's why there are no spaces between your script and my questions.
rocorona
Booster
I don't have the book, so I am a guest, here. But I can try to give some answer...
hotspot2 0, 0 Why not call 1st one hotspot1?
hmmm in GDL there are two commands for the HotSpots. One is "HOTSPOT" and is for the 3D script, and the other is "HOTSPOT2" and is for the 2D symbol. The number "2" here is part of the command name, so you can't change it!
hotspot2 a, 0 How does the “a” HS seem to know to go to near end of last board?
The two numbers after the "HOTSPOT2" are the coordinates (X and Y), so the place where the hotspot goes. "a" is the parameter that hold the width of your object (is the very first, if you look at the "parameters" list of the object).
del 1 Why does this not delete the gosub just above?
The "DEL" command only cancel the effect of the last performed transformation of the "stack". These are: MUL2 MUL MULX MULY MULZ ADD2 ADD ADDx ADDy ADDz
poly2 14, 7, Messed with different numbers but did not “get it.”
You can't mess them. "14" is the number of nodes, and must correspond to the coordinates pairs that follow. "7" is a code that says to make a polygon BORDERED (1), FILLED (2), CLOSED (4). 1+2+4=7
Return why does this not say end?
The script execution do NOT ends here. We are in a subroutine, and we have to go back to the calling point (just after the GOSUB)

No time to go further, right now. Bye
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
rocorona
Booster
Here again.
for x = 0 to a step boardWidth + gap The beginning board location call out, right?
add2 x, 0 Add two times board to get next board start?
I think you got this, but not 100%
The first is the declaration that a loop is starting. The loop starts giving the value 0 (zero) to "x" and will end when "x" reach the value of the variable "a". Each go the value of "x" is added with the value of (boardWidth + gap).
Every time the loop is run, all the commands from "FOR" to "NEXT" are performed. Then the execution goes to the following commands.

I think here is a little inconsistency, causing one more board than desired: the object is larger than the "a" variable, this is why the second hotspot is NOT at the end of the last board, as you say "go to near end of last board"
Also played with “gap” parameter that was set as 0’ and yet there was a gap.
It works for me. No gap, with value zero.
(Tried to attach a word.doc that I had formatted to read easier but would not accept .doc I found out) That's why there are no spaces between your script and my questions
Next time you can put an exclamation mark (!) to separate comments. This way we can simply copy-paste the whole thing to check.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
rocorona
Booster
0, chamfer, How does script know to put chamfer on bottom?
chamfer, 0, Can you also annotate the remaining lines?
In the POLY2 command, each line, after the first one, is a coordinate pair: X and Y of a node.
YOU decide the shape of the poly, and write down all the coordinates in order. Starting at one point and following the perimeter (preferably in counter-clock direction).
The board, as you see in the image below, has 14 nodes (and 14 is the first parameter needed by the POLY2 command). As you have learnt, the coordinate can be numbers, variables and formulas.
Poly2.png
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Thanks for that detailed response, Roberto.

Lec, you're probably just reading too much into the example scripts.

All your questions will be answered as you read the following chapters. The point of this example is only to show how loops can be used in practice.
Anonymous
Not applicable
Hi Roberto
I really appreciate the detailed explanation.
It seems I get a "wheel in the ditch" over the simplest notations I don't understand.
I should have gotten the "a" parameter part, Andrew has pointed that out to me before and that was kinda dumb of me.

Also I think the "a" hot spot is not spot on because the +gap parameter has pushed the boards past that point?
(Mystery part, the script comes from Andrew with a 0 "gap" parameter and yet running the script produces a gap). Oh well?
Still don't understand why in the parameters section the gap parameter keeps reverting back to 0 when I try to set it to 1/16".
In my work environment level of fractions are set to down to 1/16".

Now I realize how the script knows how to put the chamfer on the bottom,(along the x as 0 cord.) If I wanted it on top I'd have to move up the y axis and move along the x cord), anyway what I just wrote may not be clear, but I get that part ok now.

Hi Andrew
I am enjoying reading your book. Even at my beginning level it does explain a lot of things really clearly.
And thanks for all your help, I am trying to read on but was looking for visualization plateau foothold. Looks like I made more out of example than was intended. Whooops and sorry about that!
rocorona
Booster
lec1212 wrote:
Also I think the "a" hot spot is not spot on because the +gap parameter has pushed the boards past that point?

No, it has to do with the step (Board width + Gap) not being a sub-multiple (not know the word in English) of "a". In other words, you set the "a" parameter, then place a number of boards that "try" to match that dimension. To be exact, the last board needs (in most of the cases) to be cut... there are ways to get this in GDL, but that goes a lot beyond the purpose of the exercise.
Still don't understand why in the parameters section the gap parameter keeps reverting back to 0 when I try to set it to 1/16".
In my work environment level of fractions are set to down to 1/16".
I'm on the metric side... do not know if this has something to do.
If you downloaded the object (not typed by you) check if in the MASTER or PARAMETER Script there is some instruction that prevent some values to be used.
PS; Also played with “gap” parameter that was set as 0’ and yet there was a gap.
I changed it to 1/8” and gap got larger as I suspected, Then tried to change to 1/16” but it kept reverting
back to original 0’ but now at 0’ there was no actual gap. Did not understand that.
Sure, at the begining there was a small value, rounded to 0' in the input field, but still memorized as >0.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________