BINARY
T HE BINARY statement is what all Binary con
verted Library objects contain, and have a lim-
ited set of parameter values of 3, 2, 1 or 0 (for pens
from the origin, that 49x8m is embedded into the bi-
nary, and ArchiCAD writes offsets to bring it back to
its own origin, at the near left bottom corner. Lesson
and materials) and an index number of 1. Binaries are number one is: build objects over the floorplan origin.
just a big chunk of impenetrable machine code that Next you can see that the MUL commands are there
defines the polygons, edges and nodes and materials. to make it stretchy – because they all refer to the magic
The code for the binary is embedded within the GSM parameters of A and B. The object itself is contained
object and is not detachable. Binary objects are not in the incredibly brief single line command of BINARY
editable (except for the odd ADD, MUL or ROT in front 1,1.
of them or the pen parameters, and in the normal
sense, there cannot be any further parameters for them,
Fun with BINARY
and no hotspot editing. Remake the object over the origin, save it again, and
Binary objects comtain all the data necessary for this time the binary itself is centred. Now you can write
3D display, including materials. They are faster and !Fun with a Binary
more reliable than editable objects (which may have !First, Delete all the MUL and ADD offsets
hundreds of k of complex script to read through and !Build the 3 in a row
interpret) and can handle more polygons. BINARY 1,1
If you wish to combine Binaries, it is surprisingly ADDx 1.0
BINARY 1,1
easy. Place two in the floor plan, arrange them as you ADDx -2.0
wish, view in 3D then save as a new 3D object, and BINARY 1,1
make sure you tick the boxes to make them Binary. DEL 2
!Build the circular structure
ADDy -2.5
! Name : holycylinder_bin.gsm FOR angl=0 TO 331 STEP 30
! Date : Tuesday, January 6, 2004 ROTz angl
! Version : 8.00 ADDx 1.5 This is efficient, because it doesn’t
! Written by ArchiCAD BINARY 1,1 double or quadruple the amount
! DEL 2 of code in the object, it just reuses
NEXT angl the same code again and again.
MULX A/0.6000022888184 DEL 1
MULY B/0.5908846855164
MULZ ZZYZX/ 1 !Build the vertical structure
ADDX 49.69966888428 ADDz 2.4
ADDY -7.998539447784 ROTx 180
BINARY 1,1 BINARY 1,1
ROTx 90
!Rotate 4 times horizontally
Open that new object, and you have a single binary FOR k=1 TO 4
which now contains both, and has a new 2D symbol. ROTy (k-1)*90
BINARY 1,1
There is no use for the command in your creative GDL, DEL 1
but you can manipulate the Binary to some extent. NEXT k
You can insert ROT or MUL or ADD commands in DEL 3
front of the Binary script, to multiply or move the ob- !Sadly, CUTPLANE doesnt work
ADDx 4.0
ject. You can write a FOR... NEXT Loop to do some-
ADDz 0.5
thing interesting with the Binary that is embedded in CUTPLANE
your object. DEL 1
Here is an object (made for another exercise, viewed BINARY 1,1
CUTEND
in 3D in Plan, and saved as a binary object. First of all
DEL 1
note that it is preceded by a number of cursor move-
ment commands. Because it was made about 49x8m all sorts of moves, loops and other things using that
BINARY.
! Name : holycylinder_bin.gsm One disappointing discovery is that the Binary is so
! Date : Tuesday, January 6, 2004
! Version : 8.00 complete that CUTPLANE and other cutting com-
! Written by ArchiCAD mands do not work.
!
Binary Hacking is a cutting trick
MULX A/0.6000000238419 However there is a trick that will cut binaries. If you
MULY B/0.5908846259117 place the object in the ArchiCAD floor plan on its own,
MULZ ZZYZX/ 1
ADDX 0.3000000119209
and use the Marquee polygonally or 3D cutaway, you
ADDY 0.2954423129559 can cut it up in various ways, the view the object again,
BINARY 1,1 and save it as a new binary object. Bring it back in, put
a ROT in front of it, update the 2D to PROJECT2, cut
Copyright Marmalade Graphics ©2004 173
it a different way, save again... and again... and again...
The GDL Cookbook 4 XML Converter!
Join Binaries together?
XML Converter!
T HERE is no doubt that ArchiCAD is the required
and preferred environment within which to pro- XSTEEL can use XML with GDL!
duce GDL, but there are other ways to produce ob-
jects. Some of you may have tried “Black Turtle”
(Abvent) or “3NF” (Webscape) – but Graphisoft them-
A N example of XML with GDL is in Steelwork. There
is an XML translator for using XSTEEL (from Tekla)
with an ArchiCAD / GDL model. You can assemble an out-
selves provide a small application called XML Con- line frame using the steel sections in the ArchiCAD library.
verter. There is one for AC8.1 and one for AC9.0. Both Don’t worry about the joints – bring the steel sections close
of these are on the Graphisoft website. to each other. Select and save the model as an XML model
XML is Extensible Mark Up Language, an evolu- using the XSTEEL translator (another plug-in). XSTEEL can
open this file, enabling an engineer to do calculations,
tionary development from HTML that provides a way
perfect the joints. This model can then be saved as an XML
to store and exchange data on the web. You can store file from XSTEEL. ArchiCAD / GDL can then reimport the
parameters, text and data in an editable text file using modified file and show you the final corrected steel frame
chevrons and slashes (<> </>) to separate fields. In model.
this way a converter can read the XML data and change
the data into something more complex – in this case, 2. Adding Binaries. We have all made objects with
a .GSM object. BINARY. We know that we can copy and paste the Bi-
XML Converter is a way of converting GSM ob- nary command, and we will get a repeat of the object
jects to XML or XML objects to GSM. It’s not really a inside the GSM file. The code for the binary is locked
way to make a completely new object (this would be up inside the GSM file, but is inaccessible using GDL
VERY hard work!), but it’s a way to edit and convert as we know it. We cannot copy a binary from one GSM
existing libraries or objects. Every part of the object file to another. Binaries in autoscripted objects always
becomes text – modify it in a text editor, then convert have a section number of 1.
it back to an object. You can do this to individual GSM Some of the newer more sophisticated objects in
files, or a a directory containing a whole lot of GSM the GDL world such as the people and cars and trucks
files – in fact, you could use it to update or edit a whole have not been made with GDL – they have been made
library. with Cinema 4D or Rhino or 3DS and brought in to
Actually, XML Converter is a bit of a nightmare to GDL. If you want the objects to animate – e.g. doors
use, it works only in the raw Command line interface open and shut, hide or show people, Lights on and off,
of MSDOS or OSX, and nobody really wants to go you cannot have the car as one single binary. If you
back to that. Once you have got a GSM object into have a number of binaries with IF statements, you can
XML form it’s just text, and the best editor is make very realistic objects. You can contain up to 16
Dreamweaver or GoLive or a similar web page editor. Binaries within one GDL.
If you want to write XML creatively there are tons of If you look at the 3D scripts of some of the newer
tutorials on the web and you can easily find them with cars and trucks you will see a lot of different BINARYs
Google. for the body, the doors, the roof, the seats, the passen-
gers etc. These finished objects have all been created
What do you do with XML Converter? with XML Converter, not with GDL.
I see two main uses of XML Converter which make
it worth learning how to use this, to do things that can- How to join Binaries together
not easily be done in normal GDL. Each part (door, bodyshell, roof) has been imported
from somewhere else as a separate GDL object with a
1. You can edit the parameter descriptions. This BINARY of section number 1. Each part has been con-
is something that is normally very tedious. If you have verted to XML with the Converter. They can all be
an object in English that you want to have in German, separate files, or if you convert a folder full, you will
you have a very hard workload to open each object, get one long file.
write the new description in, then save and close (of You can now open each XML file with Dreamweaver
course you have to know German too!). By converting or similar. The XML code shows a great mass of hexa-
the object or the whole library into XML, you can use decimal text for each Binary, with a header and footer.
a smart Global Search and Replace routine to replace Copy and paste all the chunks of Binary code into the
all parameter descriptions – this does not replace the one object you decide will be the final one. Change
parameter name or alter your script. Then convert the section numbers of the the binaries to a sequen-
them back to GDL objects, into a different directory. tial order, e.g. 1, 2, 3 etc. The limit is 16.
174 Copyright Marmalade Graphics ©2004