Professional Documents
Culture Documents
Graphisoft
Visit the Graphisoft website at http://www.graphisoft.com for local distributor and product availability information.
Trademarks
ArchiCAD and ArchiFM are registered trademarks and PlotMaker, Virtual Building, StairMaker and GDL are trademarks of Graphisoft. IFC and IAI are trademarks of the International Alliance for Interoperability. Artlantis and PhotoCAD are trademarks of Abvent. Piranesi is a trademark of Informatix. ArchiFacade is a trademark of Cigraph. Lara Croft is a trademark of Core Design. Lightworks is the trademark of Lightwork Design. All other trademarks are the property of their respective holders.
about object making from other sources, including the reference manuals, for which all the authoring team should be thanked. It takes object making a lot further than the original volume. The author would like to thank his editing team at Graphisoft - Anett Csaki, Tibor Szolnaki and Akos Pfemeter - for their regular emails of advice and support. He would also like to thank Karl Ottenstein of Sandpoint, Idaho for his critiques and technical proofreading during the writing.
Printing Note
We have provided this as a .PDF file, but we have designed it with chapters starting on odd numbered pages. This is to enable you to print out your own copy and run it off on a double sided photocopier if you wish to save paper.
Acknowledgements
Introduction to Object Making with ArchiCAD: GDL for Beginners was developed in concept by Graphisoft as a means of filling the gap between the GDL Cookbook and the existing reference manuals. The first edition was in 2000 for ArchiCAD 6.5 and 7.0. This edition has been completely rewritten during 2004 to include ArchiCAD 8 and ArchiCAD 9 thinking and techniques. It contains easy to follow exercises in object making, and pulls together wisdom
CONTENTS
PART ONE: OBJECT MAKING WITHOUT GDL______________ 7 Chapter 1: Introduction to Object Making . . . . . . . . . . . . . . . . . . . . . . .7 1.1 About Object Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Library Parts in ArchiCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Sources of Library Parts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Add-ons that make Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 1.2 Making your own Library Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 Without GDL using ArchiCADs Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 Making Objects with GDL Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 How do you make an Object? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 Does it need to LOOK right, or BE right? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 The idea of an Investment Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 Can you learn GDL?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 The ArchiCAD experience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 Read about Object Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Chapter 2: Object Making without GDL 1 . . . . . . . . . . . . . . . . . . . . . . 17 2.1 Making Objects without GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Getting started with Object Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 2.2 Lets make something in 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 2.3 Bring a file in from DXF/DWG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 2.4 Lets make a 3D Object a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 2.5 Lets Make a 3D Window with slabs . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 2.6 Lets make a Chair using Wall tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 2.7 Lets make a Roof Truss with Fills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Summary of Object Making in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 Chapter 3: Object Making without GDL 2 . . . . . . . . . . . . . . . . . . . . . .26 3.1 Using Basic Shapes from the Library . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Make a Banana Truss or Mullion object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 3.2 Lets make an Object by Cutting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 3.3 Urban Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Urban modelling entire buildings as objects . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Urban modelling entire sites can be objects . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 Urban modelling the Camera is the mightiest weapon! . . . . . . . . . . . . . . . . . . . .31 3.4 Making Objects with Add-ons and Solid Geometry . . . . . . . . . . . . . . . .31 Profiler for extrusions and lathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 3.5 Make a Flywheel with Profiler! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3.6 Convert Mesh to Roof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 Other free Add-ons within ArchiCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.7 Carving Walls with the Roof tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Solid Element Operations (SEO) to the rescue! . . . . . . . . . . . . . . . . . . . . . . . . . .37 Notes on the naming of parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 Why bother to make objects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 Are you using the Student version? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 Summary of Object Making in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Introduction to Object Making with ArchiCAD
PART TWO: BEGINNERS' GUIDE TO GDL SCRIPTING _____ 40 Chapter 4: Starting with GDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.1 Starting with GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 The Scripts and Buttons in the Parameter Table. . . . . . . . . . . . . . . . . . . . . . . . . .40 3D Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 First steps in 3D GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 3D View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 Check Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 3D Space and the 3D Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 Do not forget the 2D script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 Summary of GDL, to this point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.2 Lets build a 3D Object a Chair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 4.3 Lets make this chair parametric. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 4.4 First steps in 2D scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 Selecting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 Subtypes you can put this into a category. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 Summary of GDL, in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 Chapter 5: Providing Options in GDL . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.1 Providing Options in GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 5.2 Boolean parameters easy options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 5.3 Popdown Menus: allow many choices. . . . . . . . . . . . . . . . . . . . . . . . . . . .54 5.4 The MultiObject concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 Summary of GDL in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 Chapter 6: The Power of PRISM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.1 The Power of PRISM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 PRISM is the most versatile element in 3D GDL . . . . . . . . . . . . . . . . . . . . . . . .60 Instant GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Writing Prisms from new. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 About Prism syntax.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 6.2 Apply Prisms to the chair seatframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 6.3 Learn about Circle Geometry and make the chair more comfortable. . .66 Summary of GDL in this section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 Chapter 7: Looking into Autoscripted GDL . . . . . . . . . . . . . . . . . . . . 69 7.1 Looking into Autoscripted GDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 Examine the 3D script of the autoscripted table . . . . . . . . . . . . . . . . . . . . . . . . . .69 The table can be tuned up to be parametric . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 Cautionary note for modifying objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 7.2 Come back to Instant GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 Try instant GDL with a REVOLVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 Modifying objects made with Add-ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 Summary of GDL in this section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 Chapter 8: Build on the power of GDL . . . . . . . . . . . . . . . . . . . . . . . . 81 8.1 Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 Golden Rules for Subroutines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Contents
8.2 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Subroutines versus Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Complex example of Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 8.3 Textures the big secret revealed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 You could do Texture mapping with a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 More things to note on textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Summary of GDL in this section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Chapter 9: Billboard Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.1 Billboard Objects use picturereality! . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.2 Make your own Billboards as accurate Cutouts . . . . . . . . . . . . . . . . . . . . 90 9.3 Make your own Billboards using the Alpha Channel with PICTURE . . 93 9.4 Rectangular cutout the combination object . . . . . . . . . . . . . . . . . . . . 95 9.5 The Billboard idea in 2D? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 9.6 Billboard creation the photograph . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Summary of Billboarding in this section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Chapter 10: GDL Windows and Doors . . . . . . . . . . . . . . . . . . . . . . . . . 99 10.1 GDL Windows and Doors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 The Rules of Windows and Doors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 10.2 Revisit the Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 10.3 You can make Skylights too . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 10.4 Try a very complex window! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Note for future versions of ArchiCAD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Objects can be better than Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Summary of GDL covered in this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Chapter 11: GDL Roundup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 11.1 GDL Roundup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 The programming language of GDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 11.2 Loops FOR... NEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 The FOR... NEXT Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Loop by counting numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Loop by Distance and optimise it! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Smart way to recalculate spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Loop by Angle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Other ways of Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 11.3 Graphical Hotspots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Lets write some Graphical Hotspots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 11.4 Solid Geometry Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Solid Geometry on the chair. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 11.5 Defining Text in 2D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 11.6 Other possibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 11.7 Advice for Newcomers to GDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 11.8 Summary of ArchiCAD 9 changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Index ___________________________________________________ 121
Picture objects that can be placed in a model to look like people, trees, or even whole buildings. 2D drawing objects and tools that can enhance your productivity and drawing accuracy. In short, the pleasure and productivity of the ArchiCAD user can be greatly enhanced with objects. This book is intended to ease the ArchiCAD user safely into making objects. It is not entirely self contained; it needs to be read with the GDL Reference Manual, the Help Menu and the main ArchiCAD Reference Guide. Dip into these frequently. If you wish to take object making further, your next stages after this primer are to take a more informed look at the manual and GDL Help menu, and to work with the GDL Cookbook, all of which take you progressively into more advanced GDL.
If you have tried making objects in ArchiCAD without GDL (we will call these Autoscripted objects), you are used to getting an object whose only possibility for variation is stretchiness. You are not offered a choice of materials, you have to get these right before saving the object. This introduction to object making will encourage you to build objects yourself, but more significantly it will encourage you to try to make them capable of offering variations thus they could be partially parametric.
The Eureka Tower in Melbourne, Australia, by Fender Katsilides: Object Technology is not just for pretty renderings it is central to the task of construction documentation.
The existing ArchiCAD Library is a folder in your installed ArchiCAD directory. ArchiCADs own library will be loaded (by default) but when you are running a project, or experimenting with GDL, you should make additional folders of your objects. Make sure you do not make objects or folders with the same names as ones that already exist in the libraries. When you are working with ArchiCAD, make sure that the folder you are saving your objects to is one of your loaded libraries.
demolition of the built environment. Documentation is vital at every stage and buildings have to be managed by teams of people who require access to shared information databases. Objects in the environment can be classified by Subtype for example they will be Seating, Windows, Roof structure, Storage or other similar categories. If your ArchiCAD model uses internationally sourced GDL components, how does it know the difference between objects called sedia, janela, fenster, Tr, tepe_penceresi, iskemle, parathiro? Is a lanterna a lamp or a skylight? ArchiCAD knows!
You can either make a new library folder that relates to current projects, or your objects can be stored in a personal library in the ArchiCAD folder. The main point is that you should know where they are, and ensure that you have loaded them. Subfolders to keep furniture objects, building components, window objects, textures etc., should be logically named and organized.
All objects now have an internal identity code GUID (Globally Unique IDentifier) which includes the subtype classification, and enables the APIs inside ArchiCAD to perform correctly whatever the objects name so a skylight will cut a hole in a roof but not a wall; a lamp will have brightness and colour controls but cannot cut holes in a roof. The GUID is very powerful more so than the objects name. As a risky experiment, I changed the name of an object in a library, reloaded libraries and checked the plan. The object was still in the
correct place, with its new name, and looked the same in 3D view because the GUID was unchanged (dont do this at home!). You can see a quick sample of the IFC categories in GDL by going to File>GDL Objects>Open Object by Subtype click open the cascading groups and you will get a comprehensive listing of the possibilities even animals, cars and railings are included. Graphical Hotspots (GHs): GDL objects can now have custom hotspots in any part of the model for editing its configuration. Previous versions of GDL only permitted stretching of an imaginary cuboid around the object. Now an object of some complexity can be manipulated by the user in a piece of storage furniture, you can pull or push the drawers, swing open or shut the doors, change the spacing of shelves or dividers it is easy to do using hotspots in the 3D or the 2D or both, and the hotspot coding is not difficult. For the GDL writer, GHs are very rewarding to write and get working.
This structural steel tube can be stretched and twisted and rotated in 3D space and in 2D using graphical hotspots. Solid Geometry Commands (SGC): We can achieve a far more authentic 3D appearance and improved line drawing of objects by adding or subtracting solids. Where intersecting tubes would look acceptable in 3D render but wrong in wireframe, we can now add them and get cleancut junctions. We can now subtract 3D outlines out of a 3D solid surface (for example spherical indents into a slab) to create shapes that could not be built with positive construction commands. These are similar to the Solid Element Operations in ArchiCAD.
This carved wood arch is now easy with SGC. Open GL: This is a new engine for fast 3D visualisation, originally devised by Silicon Graphics. It is much faster than ArchiCADs 3D engine, using accelerated routines on dedicated hardware the graphics card of your computer, Mac or PC. Open GL includes routines for hidden line, shading, texture mapping, texture filtering, anti-aliasing, lighting, geometry transformations, etc. This affects you because previously, textures were relatively unconsidered. Now it looks blatantly horrid if you are lazy with textures and all your woodgrain goes the wrong way. It can also cope with models of more polygons allowing a higher level of detail, more curviness. Open GL drawings can be preferred to renderings as they include pen lines, as in most of the illustrations in this book. Rendering: ArchiCAD 9 introduces the major advance in rendering technology, Lightworks. It is one of the most popular rendering engines available on the market. Currently more then 80 applications are licensing this technology and a total of 1 million end users are using it. The Lightworks rendering engine is now built into the ArchiCAD rendering interface. Lightworks gives you the ability to create high quality photorealistic images within ArchiCAD. Lightworks offers ray-tracing, soft shadow and reflection features and complex shader editing capabilities, and works with ArchiCADs own elements. Find more details in the ArchiCAD 9 documentation, and see the website: http://www.lightworks.com/.
10
readily to new capabilities. The fundamental modelling tools (Walls, Slabs, Roofs) have changed for the better, but are still familar with each new release. We have an extra armoury of tools like the Column, Beam and Mesh, the continuous Line tool and in recent times, we have the technology of Add-ons custom tools which make modelling even easier. GDL itself, the internal code of ArchiCAD, has also changed over the versions, but never so differently that an experienced user couldnt immediately make use of it, and later adapt to the new features as they became evident.
Internet, you will find an increasing number of websites devoted to ArchiCAD objects and add-ons such as GDL Central (www. gdlcentral.com) and Objects On Line (www.objectsonline. com). Try some of these in Google: Studio Arkada, Arkiklub, ArchiRadar, GDL Alliance, Cigraph. The Graphisoft website gives you an up-to-date list of addresses of such sites. From GDL Central, you can discover the addresses of manufacturers using GDL for products. You will find that, with the free GDL object web browser plug-in, GDL objects can be viewed in a browser, changed parametrically, and rendered, almost as if you were examining them from within ArchiCAD and then perhaps, downloaded to the user.
GDL is very widely supported the web is full of sites with object making advice and downloads.
Complementary Libraries
Several specialist libraries are available on the web or on CD from companies specialising in object making and add-ons, such as People and More, Theometrics, Hoshino, M.A.D., etc. If you explore the
Introduction to Object Making with ArchiCAD
11
incorrectly. You can speed this up by opening ArchiCAD with the Special Menu visible. Boot up ArchiCAD holding down the Opt-Cmd keys (Mac) or Alt-Ctrl (PC) you will see the Special Menu appear. Load the library you want to update. Now select Update Library parts from the Special Menu. It may take 10-20 mins. It is bringing them all up to date with GUIDs and other AC8/9 characteristics.
Slab tool and Roof tool will produce GDL script that is relatively easy to modify. The Wall tool creates bits of script which are harder but not impossible to modify, but are easier to build in the first place. Some of the most interesting possibilities are with the Mesh tool, which makes surfaces that can be converted to roofs and saved as objects. Sometimes the objects you make with ArchiCAD tools are more easily built on their side, rather than upright. Windows and doors should be built flat on the floor and ArchiCAD will convert them to be upright. Sometimes you will not be able to make an object all at once. You may have to make the legs first and save those, then make the superstructure, save that, then make additional parts, and save them. There are primitives such as cylinders, cones and domes in the ArchiCAD Library that you might also use as part of your object. You can then bring all those subsidiary parts together in the floor plan, and save the whole result as your final library part. Later in this book there is an exercise to demonstrate this procedure. Be warned, though, that this final object will only work if all the subsidiary objects can be found in the loaded libraries.
This bentwood chair is entirely made from small walls. For the more experienced object maker, it is possible to combine the use of ArchiCAD tools with a knowledge of GDL. Because you cannot rotate objects in the ArchiCAD floor plan (other than around the Z axis), you will quickly see the benefit of learning even a small amount of GDL, in which you can rotate shapes however you want. Shapes can be drawn out in the floor plan with the wall, roof or slab tool, saved as little chunks of GDL, brought back into the plan and
Introduction to Object Making with ArchiCAD
12
then added into a larger GDL project that the writer is working on moved and rotated into position, amended or simplified. Not all objects need to be 3D. It is possible to use the 2D tools of lines, text and fills to draw standard symbols, select them, and File>GDL Object>Save selection as... a library part. If you already have a 3D object that you wish to use purely as 2D, you can select it, explode it, and save the resulting lines as a new 2D library part. This does not change the original 3D part. All library parts are objects, but when you save them you can decide if they are to be an Object (a piece of furniture or a building component), a Window, or a Door. If its to be a Lamp or a special furniture object, place the object in the plan, open it and select a new Subtype for it.
This accurate ship model for the US Coastguard was built entirely by tracing over the DWG construction drawings in ArchiCAD with 2D fills, dragging the fill shapes into GDL, and tidying up into 3D subroutines. Assemblies built with the Tools palette do not have to be lost. You may want to edit or elaborate and resave. Select your assembly and save as a Module. This will take a fraction of the disk space, and can be put in a folder near your Library with a filename that helps you remember its relation to the library object that it helped you create. With modules, you may wonder, why bother to save as objects? The answer is, if you wish them to behave as objects (stretchy) and allow further editing (improved materials etc.) and appear correctly in schedules, they must be saved as library parts.
13
economical in size. They can be viewed with a browser, configured in their parameters, and downloaded.
CADCAM system (cutting tool) or a rapid prototyping machine. So you must be satisfied that it IS right. For this, you are better off working in GDL from the beginning.
Investment Objects: This parapet ladder is required un-countable times on the buildings of Orcutt Winslow (Arizona) and each one is painfully slow to draw in 2D sections with different heights for each ladder. The GDL object took the author less than an hour to write and is stretchily configurable in every conceivable direction and provides 2D and 3D data for materials ordering and welding.
14
Furthermore, objects made with the Tools palette are no longer editable if the original floor plan file that made them has been lost (and you also forgot to save them as a module!) A piece of GDL that is well written can be extended and made more powerful when your own knowledge of GDL improves or when a new edition of ArchiCAD offers more features. A well written object could be taken on by someone else in the office, years after you have left, and improved to take advantage of greater knowledge or of new features like graphical hotspots or better texture and detail. Heres another investment idea objects you make can be used in AutoCAD and ADT using the free GDL Adaptor how many people may now be able to enjoy a good parametric object, and perhaps pay you for it?
Graphisofts next edition of ArchiCAD provides new areas of exploration and power.
15
16
highly educational process! The format of GDL script it generates could be called industrial quite off-putting in appearance and a lot more complicated than the Creative GDL that you can attempt with the help of this book.
1 If the object has been made the right way up, or on its side, view in the 3D window in plan or elevation respectively. Save the resulting view as a library part use File>GDL Objects>Save 3D Model as... to save it as a .GSM object, window or door. Save it into one of your loaded libraries. 2 If the object has been made the right way up in 3D or if it is 2D, use File> GDL Objects> Save Selection as... to save it into one of your loaded libraries. 3 If the object is 2D, use File>GDL Objects>New Object... and when the GDL dialog appears, click the 2D Symbol button and draw it into the 2D symbol window or paste in something you drew earlier in the floor plan. Set the A and B dimensions to the size of the object in your drawing.
Processes 1 and 2 are called Autoscripting. ArchiCAD creates a GDL library part, with 3D form (if any) and either 2D scripts or symbol, and routines to provide stretchiness. Every object, 2D or 3D, has an imaginary size-defining cuboid around it of A for width, B for depth and zzyzx for height. Method 1 and 2 will set this size automatically; for 3 you have to set the size. When you have made such objects, open them using File>GDL Objects>Open Object... you will be able to view the scripts a
Introduction to Object Making with ArchiCAD
Setting up
Open a new ArchiCAD file, load your standard library, and load a new folder to use as your working library and save the new file to that folder or to somewhere convenient. Set the large grid to 12 or to 300
17
mm and the small grid to 5mm or 0.2. Zoom in to somewhere near the Origin of the Floor Plan, so that you are viewing an area of the grid that is a little larger than the furniture you wish to build. Try to work at or near the real origin, not a temporary one. Hairlines help with 3D building, True line weight helps with making 2D objects.
from the original drawing. This object may be saved as bthrm_whb.gsm and the other two objects may be saved with names to match, e.g. as bthrm_wc.gsm and bthrm_bidet.gsm. The other method (3) is to create a New Object (from File>GDL Objects>New Object) and from the GDL dialog, hit the 2D Symbol button to get a 2D symbol window and draw the symbol directly into that window (or paste it from the floor plan drawing). Check the size of the sanitary fitting, and set the A (width) and B (depth) values in the parameter table correctly, or your drawing will be distorted when it is an object. One benefit of method 3 is that you can return to add more detail to the drawing in the 2D symbol window and you can decorate it with the hotspots of your choice on key parts of the object, like the corners and the plugholes. If you do not add any special hotspots, you will get 5 bounding box hotspots so add those hotspots.
Set the A and B to the correct dimensions You will not have to do this too often because the ArchiCAD library is well equipped with 2D objects, and many of the 3D objects from the ArchiCAD Library have a 2D only mode in which the 3D can be omitted.
If you now Open the Object (from the File>GDL Objects menu) you will find that the 2D view is scripted, including all the hotspots
18
scripts. All the 2D and 3D data was imported, but you may be faced with colossal quantities of script. You may be disappointed with the result. Nothing brought in from DXF/DWG is solid; it seems to be a vast mass of polygons and lines, and in no particular order. If you attempt to edit these you will need a lot of luck and guesswork. The most you can be sure of editing successfully is the 2D symbol, and in the 3D, some IF statements added by you to hide or show portions; and insert some material and pen numbers. 3D objects may come in on their side, or the wrong size due to your not knowing if they are created in millimetres, inches, feet or metres. If the object is the size of a pinhead or larger than your town, you may have to duplicate the Default Translator and amend the scale conversion of the import. It may also be many kilometres from the Origin. Solids may be inside-out hollow things. You may find that the lack of control over the number of polygons leaves you with a model that has so many polygons that your rendering times become unacceptable. Many objects can be found by some smart searching with Google. Check the file format before downloading. Choose the DXF/DWG if you have a choice. Always take the opportunity (exert your consumer power) to ask manufacturers of components to provide objects in GDL.
side, and only 150m high. You have to be prepared to do some fixing, e.g. rotating it upright, making a new 2D symbol and resizing it correctly in height and plan area.
We can use the curving function in the Pet palette to soften the edges of the object. Remember also that you need to set the materials of the tabletop and legs using the Slab settings dialog box. A cylindrical element like the chair leg could be made by magic wanding a slab to a circular arc, or by bringing in a cylinder from the ArchiCAD Library. Perhaps the best way is to use the Column tool, set to the right dimension and materials. This model of the Eiffel Tower comes in perfectly from DXF directly from the Eiffel Towers own website. Unfortunately, its lying on its
Introduction to Object Making with ArchiCAD
19
To make sure that each leg is consistent, make just one leg correctly at first. Next, Edit>Drag a Copy to the other end of the table. If this option isnt available, use Options> Preferences>Miscellaneous to activate the Show Element copy... button. If you use the grid, you can make the table reasonably accurate in dimensions. Keep an eye on the Coordinates palette as you type in your X and Y locations and you can make the table totally accurate. This is easier if you set Grid Snap to ON, and use a small grid of say 10mm or 3/8. Make the table about 750mm (30) high.
Now click on the object icon in the Tools palette and place it in the floor plan. The result is indistinguishable from the original, but the GDL object can be placed as often as you need, it will appear in listings and can be used in other building models. This table will be stretchy, but if you stretch it, the section sizes will deform so build it the size you want from the start if you want to avoid distortion. No matter how well you make it this way, it will never permit you to make parametric alterations to height, leg spacing or timber sizes unless you are prepared to dive in and do some editing in GDL. We will cover the editing of industrial GDL in a later chapter.
When you have built the chair, select it and using 3D Projection Settings, view it in 3D hidden line, in Plan with the camera at 270. Save it using File>GDL Objects>Save 3D model as....
20
should be symmetrically at the centre of the lower sill of the window. The external face of the frame must lie at a height of project zero on the ground plane. Normally, slabs have their tops on the ground plane, so be careful to set your window frame at the right height and altitude. Draw out a rectangular slab first which defines the overall opening size. Then select this slab, and with the Slab tool selected draw another rectangle within the first slab. This draws a hole in the slab and effectively makes the frame hollow. A better way to do it is to make the frame from four separate pieces. In this era of Open GL you want to try to get better texture rendering look at the woodgrain GDL organises the grain separately for each piece. Set the material of this slab to frame material. You can now draw another slab into the window, set this to 20mm (3/4) thick and set it to Glass for top bottom and sides. Make sure the height of the glass is well positioned in height, within the frame. For added realism, you can add a smaller group of frame sections to play the part of a casement, and a small slab below the project zero to be a sill.
adjustments when it saves the window so that the origin finishes up in the right place. But it is tidy and more disciplined to get it right at the start. When you are done laying slabs, select all the slab elements of the window, and view them in Plan (270) just like you did for the table. Use a wireframe view to show the frame. Although you are viewing it in plan, ArchiCAD will turn it the right way round for it to work as a window in a wall. Save that 3D view as an Object and when asked, click on the Window icon. Check the box that hides redundant lines. Make sure you save it into a loaded library. If you have not already done so, make a folder in your personal library for windows and doors as you save. If you clicked the window or door icon, ArchiCAD will recognise that it has to cut a hole in any wall. The hole size will be the width and depth of the window you made.
The illustration above shows how the window should sit on the project zero ground plane. Check that the frame/casement/glass relationships are working correctly. Use a Section/Elevation view to get it perfect, including the glass position. In this case, the project origin is neatly positioned at the centre of the sill. This is not absolutely necessary because ArchiCAD will make
Introduction to Object Making with ArchiCAD
Back in the floor plan, build a wall, and then select a window to put into it. Select the window you have just saved. Place it into the wall, making sure that the Eyeball cursor is clicked to the outside face of the wall (the face with more hotspots). You can now view the result and change its parameters of size only. One unfortunate finding is that the textures can be perfectly aligned in the object itself, but in the wider ArchiCAD environment, the wood textures behave differently. The way to guarantee perfect textures is to use Edit>Align 3D texture on each part of the frame before you save the window object.
21
outline of the window, and give it an ID of wallhole. We will explain that more fully in chapter 10 on windows.
The technique of making windows is similar to door construction. But you would need GDL to change the window or door styles, to make it open and shut, add grilles, or offer a choice of glazing or ironwork styles.
Before you move on, you would find that the 2D symbol (see figure at right, in illustration above) is too horrid to use in a plan. The curve in the window head produces a lot of spurious lines. You should open the Window as a GDL object, click on the 2D Symbol button and it will open up a drawing window, enabling you to delete the bad lines and clean up the pen thicknesses (left side, in illustration above).
This Bentwood chair illustrates the use of the Wall tool perfectly it could be made with the Slab tool but only with more difficulty.
22
straight sections for the seat and back. Change their heights to start from 150mm (6) above the deck and finish 600mm (24) high as in the illustration. Duplicate the seat and back walls, and make them about 90mm (3.5) thick and change material to fabric. You can use the wall-end feature of ArchiCAD 8.1 to get rounded ends, or get the same outline with the Slab tool. To finish, the chair has some little black hinge bolts for the connecting rods, which can be a small but very high slab. Try using the Log setting in the wall, set to 30mm (1.25) log heights to simulate bamboo for the arms. It works on the straight bits, but not on the curves. For this effect, you will need real GDL.
Stand it upright in 3D
When you have something like the Bentwood chair in the diagram, lying fully on its side, its time to rotate it upright. Set the 3D projection setting in the parallel views to 90 position for camera with elevational view selected. Save the 3D view as a library part into your loaded library; this time, click the object icon (not the window or door) and tick the Editable radio button, and tick the redundant lines checkbox.
Place the chair into your project and enjoy! In this view, the finished chair object admires its creator with satisfaction. To improve it, you might edit the 2D Symbol (as you did for the window) to erase extraneous lines.
23
whole truss. In this case, use a separate Fill for the Steel wires, the Timber and the Circlebolt. Now select the fills, copy them, move to the floor plan and paste them. Move them to a clear space, and it would help if one end corner of the truss is over the Origin perhaps one of the truss bearings. The hotspots will help you. Now you can magic-wand the Slab tool to follow the outline of the Fill, and to cut any holes you might have (there are none in this truss).
Keep the two sides of the truss separate by splitting the slab at the apex; do an Align Texture for each side for the wood grain. This will look good in the finished object. Now select and view the truss from
Introduction to Object Making with ArchiCAD
24
the 90 camera position in parallel elevation view. Save the 3D view as a library part, click the object icon and you have your truss, with texture alignment.
25
For the next step, its easier to rotate it 90, so we can save it as an upright truss.
26
Save again, with the camera at the same viewpoint, in elevation. You need great precision in placing them in relation to each other. Bring it back in, this time laid flat on the ground. Its time to add in linking cross tubes. You will need the sectional view to get the precise position and height of each cross tube. In the plan make sure that the cylinder ends are lost inside each main curving tube. View it in 3D Plan, 270 and you can save it as a horizontal 3D Truss.
You could view it one more time in 3D Elevation, 90, and save a version of it, upright, for use as vertical wind resisting mullions which is what I intended to make originally. Remember that if you ever wish to view the final object, you will always have to be able to find the constituent parts in a loaded library. If you alter one of the components, it may result in an error when the final object is viewed. We have become used to seeing the Missing objects dialog box coming up at some time or other. This is useful; if you read it, the warnings of duplicate library objects and of missing ones require action. If the composite object never needs to be edited again, then you could view it once more in 3D plan view from an angle of your choice and then save as a Binary. This ensures that all the subsidiary objects are included and wrapped up into a new bundle of polygons and and you do not need to worry about missing the earlier components.
A final finish would be to open it as a GDL object and plant some hotspots into the 2D Symbol to remove the bounding box and make the truss easier to pickup and snap to wall surfaces.
27
could make a rounded vault, and further refine it with the ability to form a crossing a groin vault. This is something we cannot do easily with the Slab tool, nor even with the Roof tool. Try using the more powerful Wall tool because it is smoother and more easily manipulated. We will draw a length of vault on its end, using the circular wall variant of the Wall tool. If you are more ambitious, follow this example making it as a Gothic vault (instead of Arched) by having two sections of curved wall meeting each other. Set the camera at 90, viewed in 3D elevation, then save as a vault object. Call it vault_part1.GSM if you like. Bring it into the floor plan and you now have a stretchy vault. You can change its length, width and height. So it may have been round when you first built it, but it could now be elliptical if you wish. Drag a copy of your vault object, and be careful not to change its width change only the length. We are going to cut (or mitre) the vault at 45 angles to make it usable as a groin vault for the crossing.
The plan shows the basic wall curved to form a flattened circular vault; above it, the resulting library part stretchy in three dimensions The marquee is mostly used as a rectangle but it can be very powerful when used as a polygonal shape, like a fill. First draw one 2D line down the centreline of the vault, using the half point tickmarks. When you hover the cursor over the end of the vault, you should get a little tick mark to indicate the half width of the vault. Now draw two 2D lines from this half point at 45 angles to indicate the line you wish to cut along. By using the Shift key, you can ensure that these lines are at exactly 45.
Toolbox icon of the Marquee tool with the polygon and rectangle variants. And the Elements to Show in 3D allows you to select the way that the Marquee operates. Now, using the Marquee tool in polygonal mode, Magic wand the Marquee tool to the 2D lines so that it encircles most of the vault that you intend to retain.
28
Plan of the shimmering marquee over the vault object. The thin 2D lines ensure that your cutter is at exactly the right angle. Use the Coordinate Box if you like to type the angle in. Now you see the groin vault part in 3D. View this in 3D axonometric and you will find that you have a groin vault mitred at 45. If the cutting effect does not occur, close the 3D window, use the Display> Rebuild command, and then try 3D again. If it is cutting correctly, use the 3D projection settings to set the camera position to 270 and the view type to Parallel>Plan. Save this as a library part and you can call it vault_part2.GSM. Return to the floor plan, and place your new vault piece. Now this object has default Bounding Box hotspots. You can make your life easier open the 2D Symbol in the GDL dialog and customize your hotspots. Place your own 2D hotspots at the corners, including one in the middle. Zoom in real close and place one at the pointy apex of the groin-vault. Personalised hotspots will remove the bounding box. The hotspot at the pointy corner can now be used as a hinge around which to Edit>Multiply>Rotate.
Place the result next to a piece of straight vaulting and you can now group these two. Now use Edit>Multiply to Rotate yourself another three and you have the complete groin vault!
Picture of the four vaults in 3D axo You can now add in more uncut vault objects alongside these, stretch to appropriate lengths and before you know it, you have your church roof. You can use the same technique with the polygonal marquee to take a sideways bite out of a large vault and have a pair of smaller vaults intersecting. Try making a Doric column with Profiler, add a square base top and bottom. Bring it all together. All this can be done without GDL, and yet, when they see it, your friends and colleagues will be convinced you have become a GDL expert.
29
Picture of the final structure, with the groin vault, and some columns made with Profiler, and a window made with little walls.
marquee, and view it in 3D in plan view. Either way, you will get all stories showing. If you had a basement that you wished to omit, then use Image>Elements to Show in 3D... dialog and you can decide which stories to omit. Save as an object. If you save it as Editable, you are in danger in the long term of losing the subsidiary library parts (such as windows) that it was built from. It may also fail to render due to spurious errors such as missing parts or bad polygons. Save as Binary, and you can safely export it to your urban model; place it anywhere and at any height and it will work. You would need a copy of the original if you wish to go back and modify any part of it, as the only editing you can do to a binary is to make it stretchy so store the layer combination. If you do not want the binary building object to be stretchy (to help with selection), open the 2D symbol window of the GDL object, and place 2D hotspots wherever you think would be most appropriate corners, turrets, entrance canopy, ridges, etc. and then save again. That will turn off the bounding box hotspots.
Proposal for a 43 storey tower for Central London by Robert Luck. You can just see Tower Bridge in the far distance. the entire central area of London is a low polygon count object.
Introduction to Object Making with ArchiCAD
30
If you only need facades, you can build an entire facade on the ground, using the Slab, Wall and Roof tools. Then save it using the 3D view with the camera at 90 in the Parallel>Elevation view. Bring it back into your floor plan and assemble the building from facade library parts. Again, we advise that these are binary, to avoid any lost subsidiary components, and to reduce the risk of rendering errors. A disadvantage of this method is that you cannot use normal Window and Door objects in the library but its great for areas of curtain walling. If the object is binary, you can change its materials at a stroke to a single one in the object settings box untick the Use objects own materials option. Try changing it all to Ice for the Sketchup effect!
While not wishing to suggest that Lara Crofts environments are modelled with ArchiCAD, the point here is that you can use textures more vigorously. Open GL has changed the situation remarkably it is far quicker to model urban environments with the greatest simplicity in 3D and then apply textures. If you cannot photograph an entire building, you can reconstruct its elevation from photos of the entrance, and main fenestration and roof features, and copy and paste together the whole facade. This technique is so important, we have the whole of chapter 9 dedicated to it Billboard Objects.
The textured facades are so much more realistic than trying to use 3D modelling tools (as in the foreground, above).
31
Mesh to Roof, Solid Element Operations and Trussmaker are major assistants to object makers. There are some non-Graphisoft third party Add-ons, notably ArchiForma, GDL Toolbox and Zoom, but this book would never end if we covered all those in brief, those are so good they exceed all conventional non-GDL methods of object making. However, true native coded GDL is more powerful than any of these because it is parametric and almost infinitely customisable in the way of user interface and 3D options once you have learnt it. Its fair to say that some of the curvy shapes you can make with ArchiForma or Zoom would take years of GDL knowledge to equal with native GDL.
32
Profiler used for Lathing. In its other form, Profiler is able to make Lathed Objects. The interface (sequence of actions) is more tricky than when making an extrusion, but after 2 or 3 tries, you might get something that looks right. We will make an object based on Lathing, as it is an important technique, and we can include Solid Element Operations (SEO) in the same task.
33
Now select the wheel on its own, 3D view in Plan at 270 and save the 3D view as Object, Editable. Place the resulting object in the floor plan. You will get the wheel with the cutting operating in the GDL, but by calling cylinders from the ArchiCAD library in the GDL. If you save it as Object, Binary, the object is completely independent of the library.
If you take a quick view of the editable script of an object made with Solid Element Operations, you will gain a quick tutorial in the syntax for Solid Geometry Commands in GDL! They are basically the same thing.
34
Select the Mesh, use Tools>Convert Mesh to Roof, and the mesh will be converted to a surface with thickness and with different materials on top and bottom. Better still, you can suspend groups and then edit the collection of joined roofs select them individually to delete, punch holes, or change the materials as you wish.
With this, you could construct complex roof shapes, eyeballing or entering heights as you go. When you are ready to, convert to roof and your structure is tidily jointed and made parametric and you could save the roof as a module or as an object, as you please.
Try this hyperbolic saddle shape. One trick is to make it flat at first and apply a curve to the edges before you set the altitude of the corners. This will have the effect of interpolating the points of the triangles that will be formed at a later stage along the edges. Putting in the simple inner ridge is easy and you find that the heights of the new points are interpolated too.
35
36
this chapter, so it resulted in some research into roof cutting and carving!
This stone is a piece of ArchiCAD Wall carved in different directions. The roof that is axial to the wall line cuts the ridge perfectly, but the sideways cutting plane extends too far. The roofs at angles to the wall line extend their cutting planes beyond the ridge although their side cutting is correct. If you wished to form a wall up to the edgebeam, you could make a temporary dedicated single roof piece to do the cutting because the edge is almost straight.
The illustration above shows the use of a curvy roof used to cut a wall. If you keep the wall line and pitch lines, you get a perfect result (rear wall). If you rotate the wall and thicken it (as in the foreground wall, thickened to 7.5m) the cutting is all over the place. The next example is an attempt to carve a piece of stone. Something like this was required by a client of the author during the writing of
Introduction to Object Making with ArchiCAD
37
SEO gives you perfect cutting of the wall under the saddle.
38
and walls in the room wouldnt you would prefer the scheduler to report a clean list of 4 chairs and 2 tables and a 3 sets of shelves?
Using the Marquee tool, you can cut library objects into smaller shapes, or cut bites out of them. If you wish to place your building in a larger site model for visualisation, you could save it as an object, but make sure you hide the layers containing complex interiors. You can take object making to the other extreme of having entire surrounding buildings or landscapes as objects and bring them into your main building model. Textures mapped to facades of extremely simple building shapes produce better results than over elaborate 3D modelling. Take a close look at the Add-ons and special modelling functions available to ArchiCAD users, particularly Profiler, Trussmaker, Solid Operations and Mesh to Roof. Roofs cut walls, but do not try to use them to carve walls. Solid Operations do it better. Take care with the naming of library parts avoid using generic names for objects but make sure the name is descriptive. Save your assemblies of slabs and walls etc. as modules in case you need to remake an autoscripted object.
39
The GDL Dialog: the list of parameters and their descriptions, types and values are the Parameter Table.
40
Parameters button shows you the list of parameters and parameter titles that the user will see and use when they use your object. By hitting the New button and filling in the small details, you can create parameters. By selecting a Subtype you can say if the object is in a special classification. Dont do this until you have more experience. Master Script can be used for housekeeping tasks such as checking user errors and defining materials. This is read by the other scripts. If you enter a value like the radius of a tube or the width of a chair seat, it becomes available to all the other scripts saving you from repeatedly typing the same information into each script. It also contains routines to correct errors in the users parameters, e.g. zero for radius. 2D Symbol is a drawing window into which you can paste a 2D image, or draw using 2D tools. It will only be displayed if there is no 2D script. With GDL knowledge, you are better off trying to write a 2D script. 2D Script can make a 2D symbol in several ways. It can be used to draw lines, 2D shapes, polygons and text. It can tell GDL to draw in 2D whatever it finds in the 3D script (PROJECT2). It can be used to force the 2D Symbol window to be the 2D symbol (FRAGMENT2). Its most creative use is for you to write a parametrically organized script to draw what the object will look like in 2D, by using 1, 2 or all three of these options. By designating Hotspots, the 2D script can make the object stretchy and easy to pick up. If the 2D script is left blank, the object will display whatever is drawn into the 2D Symbol window. If you leave both blank, the object will not show in the project. 2D Full View shows what is generated by the 2D Script. This will not normally show what is in the 2D Symbol window. 3D Script is the primary means of building parametric 3D objects. If the object is simple, almost all the work can be done in the 3D Script. This is the power center of most library parts. 3D View is generated by the 3D Script not to be confused with the 3D window of the main project.
Property Script enables you to write Components and Descriptor commands if the object is to be in a schedule. Parameter Script is the place where you can build pop-down menus, and send updated values of parameters back to the Parameters Table. Comment is a small text field in which you can write a set of instructions to your user on how to use the object. You can put the URL of your website in there with a hash# symbol, so the user will see a clickable web-access icon. Preview Picture is a window containing a small bitmap image of a view of the object. It tells the user what the object will look like in its setting, and could come from Artlantis Render or an ArchiCAD photorendering. This becomes the icon of the object in the settings dialog box. User Interface Script enables you to build a custom settings dialog box with your own text fields and images, with buttons and input fields for the user to enter parameters. It supports multiple pages. It is great for complex objects where the user might need more explanation of the purpose of parameters. Relax! When you start GDL, you only need the 2D and 3D scripts at first, and then the Master Script.
The purpose of the Parameter Table is to set up the parameters types, names and default values you are going to use, but it is also the way you can construct the settings dialog that the user will see. The most important parameters of A, B and zzyzx are moved into white boxes alongside the parameters.
41
3D Entities
This book cannot contain comprehensive syntax of all GDL coding. Please have a GDL manual handy for cross checking. The easiest 3D elements to build with are Block, Cylinder, Sphere and Cone. Their syntax is very simple. BLOCK x,y,z x being the Width, y the Depth and z the Height. CYLIND h,r h being the Height, and r the Radius. SPHERE r r being the Radius. CONE h,r1,r2,90,90 h being the Height, r1 the Radius at the base and r2 the Radius at the top. The 90, 90 are the angles relative to the cones axis at which you cut off the top and bottom. You can vary these numbers to get interesting effects.
3D View
Click the 3D View button (of the library part, not the project) and you will see this. These objects all exist in the same space and overlap each other, so we need to find a way to separate them. The wireframe view shows each of the objects and the shaded view shows you how well GDL permits objects to collide like this in the shaded view without harm.
42
Check Script
If, when you click the 3D window, it refuses to draw because of an error, return to your script and click the Check Script button. This will point to the line where the error occurred, usually because of a wrongly placed comma, or a spelling error. Do this often when writing GDL.
command will happen. Using the ADD command, you can move the 3D cursor about in 3D space in a single XYZ move. ADDX, ADDY, or ADDZ move the 3D cursor in those axial directions, in one direction only.
2D Cursor movement
When you are writing GDL in 2D, you have a similar concept of X and Y based 2D space. You do not have to worry about height. Using the ADD2, ROT2 and DEL commands, you can move about in 2D space providing you specify both the X and Y distances. Unfortunately, you do not have a visible cursor.
The three-pointed object that you can see in a GDL 3D view reminds you which ways are X, Y, or Z. This is like a 3D Cursor. When you word process, you are used to the idea of a cursor wherever you place the cursor, you can begin typing, and whatever you type appears. In GDL, there are two of these, one at the origin, and one where you have moved to. The one labelled G is the Global Origin of the GDL model. The one labelled L is the Local Origin, referred to here as 3D cursor, for short. Wherever this is, your next 3D
Introduction to Object Making with ArchiCAD
43
This is a killer command that in one line, projects a view of the 3D object in 2D, regardless of its complexity. Later, when we get onto 2D scripting, the PROJECT2 command can be explained in more detail, along with other 2D GDL commands.
44
The Legs
Start in the 3D Script with a CONE command for one leg of the chair, so that the legs appear to taper from 60mm to 30mm (2.4 to 1.2). Later we can introduce more subtleties of form and size. Starting from the left-hand front corner, use the ADD commands and work your way around the chair, planting legs as you go. Lets assume the seat height is 500mm (20).
!Simple Chair Example, 3D script PEN 1 RESOL 12 !---All the legs----------MATERIAL "Wood-Pine, shiny" CONE 0.5, 0.015,0.03, 90,90 ADDx 0.45 CONE 0.5, 0.015,0.03, 90,90 ADDy 0.55 CONE 0.5, 0.015,0.03, 90,90 ADDx -0.45 CONE 0.5, 0.015,0.03, 90,90 DEL 3
Notice that it is wise, even for such a simple object, to write a comment, and to state the material and pen color. We used a RESOL statement to set the number of polygons, the Resolution of Curvature, on each leg to 12. You may not have the Material name used here, so put in the names of materials that you know to be loaded. Notice that the textures are horizontal. At this stage you may have to make a vertical version of Pine to make it look right on the legs. The operation to make the legs required three ADD commands, so we can use DEL 3 to bring the cursor back to the Origin. Then rest.
Now for the Back. Note that we are working with CONE and BLOCK on this chair. As your experience increases, you will expand the range
45
of GDL commands you use to achieve form. There is usually more than one way to make any shape. We can use a thin block of upholstery, as we did for the seat.
!---Back Legs, panel and upholstery--MATERIAL "Wood-Pine, shiny" ADD 0,0.55,0.5 CONE 0.6,0.03,0.02, 90,90 ADDx 0.45 CONE 0.6,0.03,0.02, 90,90 DEL 2 ADD 0,0.54,0.70 BLOCK 0.45,0.025,0.35 MATERIAL "Surface-Fabric" ADD 0.05,-0.01,0.02 BLOCK 0.35,0.01,0.30 DEL 2
2D Script
To complete this, you will want to see it in your floor plan. You must write a short 2D Script. Open the 2D script window and write the single line PROJECT2 3,270,2. Save and close the object, return to the floor plan. Click the Object tool in ArchiCAD Toolbox, click in the plan, and your chair will appear, with its own hotspots provided by ArchiCAD. It will not be stretchy we did not write in this capability. The chair may not win a design award, but it is your first GDL object so reward yourself and then move on with GDL.
46
The popup parameter type palette permits 12 types of parameter. Select the appropriate type.
47
MATERIAL framat ADD 0,B,sthit CONE bhit,lsec/2,lsec/3, 90,90 ADDx A CONE bhit,lsec/2,lsec/3, 90,90 DEL 2 ADD 0,B-0.01,sthit+bhit*0.3 BLOCK A,lsec/2,bhit*0.6 !Back panel MATERIAL seatmat ADD lsec/2,-0.01,lsec/2 BLOCK A-lsec,0.01,bhit*0.6-lsec DEL 2
When you multiply or divide, note that Star (*) means multiply, Slash (/) means divide.
Error checking
As you work your way through the script, keep clicking in the 3D view window of the GDL object to see if the logic of your arithmetical expressions are making sense. If they are not, it may be a bad spelling, or a misplaced comma. A wrongly spelled parameter will result in a value of zero, or could produce an error message. Click on the Check Script button and read the error message if you get one. Make sure that dimensions are dimensions and not angles or something else.
48
!Simple Chair, Parametric 2D Script HOTSPOT2 0,0 !corner spots HOTSPOT2 A,0 HOTSPOT2 A,B HOTSPOT2 0,B HOTSPOT2 A/2,B/2 !pickup spot !PROJECT2 3,270,2 !now disabled s4=lsec/4 !Quarter of diameter s2=lsec/2 !Half of diameter PEN cont_pen CIRCLE2 0,0,s2 CIRCLE2 A,0,s2 CIRCLE2 A,B,s2 CIRCLE2 0,B,s2 LINE2 s2,B-s4, A-s2,B-s4 !back LINE2 s2,B+s4, A-s2,B+s4 !back LINE2 0, s2, 0,B-s2 !side LINE2 A, s2, A,B-s2 !side LINE2 s2,0, A-s2,0 !front
We can keep the PROJECT2 command in the script, but make it inactive by turning it into a comment line in case we make some changes and want it back. Do not comment it out until you are sure that your CIRCLE2 and LINE2 statements sit comfortably over the correct locations. Note that the s2 and s4 are temporary variables to avoid typing errors and save time. Save the object and place it on the floor plan. You will find that it generates the symbol instantly. The earlier non-parametric chair with a PROJECT2 is untidily full of lines. The scripted 2D parametric chair is better to look at in 2D.
Although you may prefer to work in Hairline much of the time, it is essential you see how your work appears with True Line Weight.
If you have used ArchiCAD, you will know that hotspots have three main purposes: allowing objects to be picked up; making them stretchy; and giving them gravity (helping them to snap against wall surfaces or each other). Decide where you will need them most corners, centre, intersections, etc.
49
The distance between the hotspots must be A and B for stretchiness. Just suppose your Origin was in the centre of the chair, not the near left corner. You would need this, using half values of A and B:
HOTSPOT2 A/2, B/2!4 Corner stretch spots HOTSPOT2 -A/2, B/2 HOTSPOT2 -A/2,-B/2 HOTSPOT2 A/2,-B/2 HOTSPOT2 0,0 !Pick up Centre spot
are on the bounding box, you may have to drag the mouse in a small marquee in your attempts to find those elusive hotspots. In ArchiCAD 9 you can make the job easier for users of your object. In the 2D drawn symbol, you should provide a fill over the area of your object. In a 2D Script, you should provide a filled POLY2. If you do this, your user can click anywhere in the fill and they can select the object easily. Another AC9 idea is that of making specific lines sensitive to your mouse. In a 2D Script, you can duplicate instances of LINE2 and ARC2 with HOTLINE2 and HOTARC2 (using the same syntax) and the mouse will detect the object anywhere along the line. Even in an object with PROJECT2 as the main way of drawing the symbol, you can inject a few HOTLINE2 commands to make it easier to pick up.
Selecting Objects
Normally, you can only select objects by clicking on the hotspots of the 2D symbol in the plan. If your hotspots are in an illogical place, or
50
After each 3D task is achieved, DEL back to the origin before starting the next task. Writing a 2D script is easy and saves time in the long term. 2D Hotspots are vital for making objects stretchy. Try cylinders, cones and elbows for extra quality and authenticity. Control curvature of cylinders, etc, with RESOL or TOLER. You could consider trying to apply the correct Subtype even for simple objects. Now, at last, you have a useful application for that algebra you learned at school.
51
52
We can use an IF statement to decide whether to show or hide the back. IF statements can be written on a single line or, as in this script, can be written in the form shown here. The first line ends with the word THEN, followed on the next few lines with the things to be done as a result of the IF question. You round off the IF statement with the ENDIF statement to end it. Single line IF statements are of the sort:
IF bakon=0 THEN arms=0
But here we need to write more than a single statement as a result of the IF condition. So we use an IF... ENDIF. The value of bakon is sent to the 3D Script as a 1 or a zero. If the condition is not true (bakon is zero) the interpreter moves to the ENDIF command and continues with the rest of the script. We could write IF bakon=1 THEN, but as bakon can only be 1 or 0, GDL accepts the parameter name alone as enough to judge its value to be True or False.
!--Back Legs, panel and upholstery IF bakon THEN MATERIAL framat ADD 0,B,sthit CONE bhit,lsec/2,lsec/3, 90,90 ADDx A CONE bhit,lsec/2,lsec/3, 90,90 DEL 2 ADD 0,B-0.01,sthit+bhit*0.3 BLOCK A,lsec/2,bhit*0.6 !Back MATERIAL seatmat ADD lsec/2,-0.01,lsec/2 BLOCK A-lsec,0.01,bhit*0.6-lsec DEL 2 ENDIF
Introduction to Object Making with ArchiCAD
S Show or hide the braces In the same way we could add a new routine for the leg braces and could provide an additional boolean parameter to the 3D options group to control the braces. The braces will be double cones. We could have used cylinders but they would not look authentic the ends have to be smaller so that they fit to the legs, mortice and tenon style. Follow the logic of the script below, and you see its simply a matter of moving and rotating the 3D cursor to the right place, and pushing out those cones. CONE can only go vertically, so the cursor has to point horizontally. We return the cursor to the origin as each brace is installed, with a DEL command.
!Braces IF brace THEN MATERIAL framat ADDz sthit/3 ROTx -90 CONE B/2,lsec/4,lsec/3,90,90 ADDz B/2 CONE B/2,lsec/3,lsec/4,90,90 DEL 3 ADD A,0,sthit/3 ROTx -90 CONE B/2,lsec/4,lsec/3,90,90 ADDz B/2 CONE B/2,lsec/3,lsec/4,90,90
53
DEL 3 ADD 0,B/2,sthit/3 ROTz -90 ROTx -90 CONE A/2,lsec/4,lsec/3,90,90 ADDz A/2 CONE A/2,lsec/3,lsec/4,90,90 DEL 4 ENDIF
down in a setting dialog the same way that we get Materials, Pens, Lines, etc. A typical ValueList for a text parameter called font would be:
VALUES font Times New Western, Arial, Verdana, Courier
This arrangement of braces is an H-configuration and we would be in trouble if we introduced another like an O-configuration because we would now have three choices, None, H, or O. Boolean cannot handle more than two alternatives, so we need to consider the use of a Popdown menu, or ValueList as we call it when writing the code.
Note that there is no comma after the parameter name (in quotes), but the list of menu choices are in quotes with commas. A ValueList of this form is best put in the Parameters Script.
Simple ValueLists are best built in the Parameters Script, but ones involving a lot of decision making are best built in the Master Script GDL prefers it, and it also permits joined-up thinking on your part. You build the menu and you write the IF statements that follow as a result. This way of writing ValueLists is an authors special and is called the Variables Method. It works far better than the standard syntax.
!Add to the Master Script !-------Pop down Menu----------bv0="No leg braces" bv1="O brace" bv2="H brace" VALUES "bracetyp" bv0, bv1, bv2 IF bracetyp=bv0 THEN brace=0 ELSE brace=1 ENDIF
What we do is to build a list of the words that will appear in the ValueList, making each choice equal to a simple variable like bv0. The single line starting with VALUES builds the popdown menu. The benefit of this way of doing it is that the decision-making that follows is easily done on the basis of simple variables like bv0. By this method, we can make popdown menus in English and Norwegian
54
and French if we so choose, and there can be no risk of spelling mistakes or upper/lower case confusion. This variables method of building Valuelists only works if it is done in the Master Script. Because the ValueList is the primary decision making point, we can click the Hide button in the parameter table for the bakon parameter. Its value is now governed by the Master Script, not by the user. Here is a rerun of the original brace routine in the 3D Script, with the IF statements working.
!--------Braces front to rear---------IF brace THEN MATERIAL framat ADDz sthit/3 ROTx -90 CONE B/2,lsec/4,lsec/3,90,90 ADDz B/2 CONE B/2,lsec/3,lsec/4,90,90 DEL 3 ADD A,0,sthit/3 ROTx -90 CONE B/2,lsec/4,lsec/3,90,90 ADDz B/2 CONE B/2,lsec/3,lsec/4,90,90 DEL 3 IF bracetyp=bv1 THEN !---H Brace-----ADD 0,B/2,sthit/3 ROTz -90 ROTx -90 CONE A/2,lsec/4,lsec/3,90,90 ADDz A/2 CONE A/2,lsec/3,lsec/4,90,90 DEL 4 ENDIF !brace=bv1 IF bracetyp=bv2 THEN !---O Brace-----ADD 0,0,sthit/3 ROTz -90 ROTx -90 CONE A/2,lsec/4,lsec/3,90,90 ADDz A/2 CONE A/2,lsec/3,lsec/4,90,90 DEL 4 ADD 0,B,sthit/3
Introduction to Object Making with ArchiCAD
ROTz -90 ROTx -90 CONE A/2,lsec/4,lsec/3,90,90 ADDz A/2 CONE A/2,lsec/3,lsec/4,90,90 DEL 4 ENDIF !brace=bv2 ENDIF !If brace
Add Arms its easy! This far into the book, we can leap forward in faster moves, as you will have developed some confidence with GDL coding if you have tried out the easy stages of this little chair. We can add some arms, and then the chair is able to adopt a surprisingly large variety of configurations. Add an arms parameter to the Parameter Table, and make it Boolean.
!Add this to the end of the 3D Script !Arms IF arms THEN MATERIAL framat ADD 0,0,sthit !Left CONE 0.2 ,lsec/2,lsec/3,90,90 ADD 0,-lsec, 0.2 ROTx -90 MULy 0.5 !Squash the arm cone to an ellipse CONE B+lsec, lsec*0.7,lsec*0.45, 90,90 DEL 4 ADD A,0,sthit !Right CONE 0.2 ,lsec/2,lsec/3,90,90 ADD 0,-lsec, 0.2 ROTx -90 MULy 0.5 CONE B+lsec, lsec*0.7, lsec*0.45, 90,90
55
DEL 4 ENDIF
This routine demonstrates the use of MUL to reshape the basic shapes. The conical arm now becomes pleasingly elliptical. Because we do not want Arms flapping about in the air if the Back is omitted, its important to write a small error-avoiding line in the Master Script.
!Add to the Master Script IF bakon=0 THEN arms=0
can have over a million variations an object genome. CNC machines now make custom manufacturing possible, even with small production runs. We are all indebted to Kimon Onuma, president of the GDLA, for bringing to our minds the expression Object Genome.
As these arms and braces are similar CONE routines, over and over again, it seems a pity to keep writing them so often. We need to learn how to write Subroutines soon.
56
throttle and a speedometer in your car. You cannot make the car go faster by swivelling the speedometer needle! We want to transform this object to a MultiObject. To do this, we can simply use the Master Script to define a new value for the parameters for each of the standard versions of the chair: for seat height, leg section, etc, overriding the choice in the parameter table. You can use the colon to include more than one short GDL statement on the same line of text. Its a help for compacting code, but can sometimes lead to your overlooking bugs. Use the Variables method to build the menu. This example shows abundantly how good and how easy the method is.
!Cookbook Chair: Master Script !------Menu for Chair------cv0='Customised chair' cv1='Foot stool' cv2='Nursery chair' cv3='Piano stool' cv4='Dining chair' cv5='Dining armchair' cv6='Kitchen stool' cv7='Bar stool' VALUES 'chairtyp' cv0,cv1, cv2,cv3, cv4,cv5, cv6,cv7 IF chairtyp<>cv0 THEN !Grey out custom parameters LOCK 'A','B','sthit' LOCK 'lsec','frsec' LOCK 'bakon','bracetyp', 'bhit','arms' ENDIF IF chairtyp A=0.35: lsec=0.04: bakon=0: ENDIF IF chairtyp A=0.30: =cv1 THEN !Footstool B=0.30: sthit=0.28: frsec=0.04: arms=0 bracetyp=bv0 =cv2 THEN !Nursery chair B=0.35: sthit=0.32:
lsec=0.04: frsec=0.04: arms=0 bakon=1: bracetyp=bv0: bhit=0.5 ENDIF IF chairtyp =cv3 THEN !Piano stool A=0.45: B=0.40: sthit=0.45: lsec=0.05: frsec=0.1: arms=0 bakon=0: bracetyp=bv0 ENDIF IF chairtyp =cv4 THEN !Dining chair A=0.45: B=0.40: sthit=0.45: lsec=0.05: frsec=0.05: arms=0 bakon=1: bracetyp=bv1: bhit=0.55 ENDIF IF chairtyp =cv5 THEN !Dining armchair A=0.50: B=0.45: sthit=0.45: lsec=0.05: frsec=0.05: arms=1 bakon=1: bracetyp=bv1: bhit=0.65 ENDIF IF chairtyp =cv6 THEN !Kitchen stool A=0.35: B=0.40: sthit=0.60: lsec=0.05: frsec=0.05: arms=0 bakon=0: bracetyp=bv2 ENDIF IF chairtyp =cv7 THEN !Bar stool A=0.35: B=0.40: sthit=0.65: lsec=0.05: frsec=0.05: arms=0 bakon=1: bracetyp=bv2: bhit=0.3 ENDIF !More parameter checking IF bracetyp=bv0 THEN brace=0 ELSE brace=1 IF bakon=0 THEN arms=0 !Feedback to the user PARAMETERS A=A, B=B, sthit=sthit, arms=arms, lsec=lsec, cpn=cpn
57
At the end we choose to use the PARAMETERS command to show all or some of the values in the parameter table.
You can also put a small note into the Comment window, including your internet address. Precede the internet address on the first line with a hash symbol. The rest of the Comment could be instructions or a copyright notice.
58
Picture tiles in the User Interface. With more work, we can build a graphical User Interface that presents ValueLists as a series of picture tiles. Wonderful! Unfortunately, its beyond the scope of the book, but its fully covered in the GDL Cookbook.
59
If you made this in a random location, you will find the numbers for the XY locations to be quite high, or perhaps negative. It all depends where you clicked. In a future chapter, we will look at the housekeeping, but for now try another idea.
60
Instant GDL
The code for many prisms can also be stolen from ArchiCAD. Now draw out a slab yourself of roughly the same shape. As a regular discipline, try to draw slabs in the counterclockwise direction, because GDL is happier working that way. Mathematically, counterclockwise is a positive direction if you start trying to curve edges later. Draw it so that one of the points coincides with zero the global origin. Usually, GDL seems to remember the order in which you clicked the points.
dragging and dropping it into a GDL script window. 3D objects should be dragged into a 3D script window, and 2D into 2D. You may get a 3D code looking like this:
BODY -1 MODEL SOLID RESOL 36 !!Slab-018 PEN 1 ADDZ 4.1 BODY -1 cPRISM_ "Whitewash", "Whitewash", "Whitewash", 13, 0.1, 0.0, 0.0, 15, 4.28548, 0.0, 15, 4.28548, 0.949196, 15, 5.279549, 0.949196, 15, 5.279549, 2.155116, 15, 3.405484, 2.155116, 15, 3.405484, 3.067704, 15, -0.000425, 3.067704, 15, -0.000425, 2.00845, 15, -2.444858, 2.00845, 15, -2.444858, 0.949196, 15, 0.0, 0.949196, 15, 0.0, 0.0, -1 BODY -1 DEL 1
Now open a File>GDL Objects>New Object, and bring up a floating palette of the 3D Script (click on the little white button to get it). This is a trick that takes some learning, so try it a few times. Position the floor plan and the 3D Script as shown above, overlapping. Grasp an edge of the slab, and drag it smartly across into the 3D Script as fast as you can. Do it slowly and nothing happens... So do it fast! Everything in ArchiCAD is in fact GDL (under the surface). You can click on anything in an ArchiCAD floor plan wall, roof, floor, mesh, even and object and you will find out what its GDL code is by
All Slab tool objects are converted into CPRISM_ this is a prism in which the top, bottom and side surfaces are specified by name or number. The next line contains the number of nodes and the thickness, and then follows the list of XY locations. Each one ends in the number 15, and the final node ends in a -1. The 15 is a masking code and simply tells the slab to be drawn as a Solid and tells all the edge lines to be drawn. The -1 tells GDL that the slab is finished (and also that the end point is the same as the start point). This is the default, so leave these as they are unless you want to omit nodepoints. Note that the slab in the illustration was started 24 metres from the from the main origin of the project your numbers will be wrong. Move the object so that one node is on the Main Origin. Do the drag-trick again and you will see that the first node listed is 0,0 like it appears in the sample script, above.
61
Note also that the XY locations are accurate to a millionth of a metre in ArchiCAD 8 onwards, this becomes million millonths no kidding! This is a lot of reading for the GDL parser, and if you write creative GDL, you can write in much cleaner numbers. If you set the small snap grid, perhaps to 1 mm or 0.1 and trace out another slab and drag it into the 3D Script, the numbers get shortened. You can also do Instant GDL in 2D Try drawing a polygon with the Fill tool. Drag and Drop the result into a 2D Script window another example of instant GDL! If you include curves in the edges of the fill, you will see extra codes which define the curves polylines. In creative GDL you make use of 2D dragging more often than 3D dragging. Fills provides the XY syntax for outlines for EXTRUDE, REVOLVE, SWEEP, TUBE and other more exotic 3D GDL commands.
the prism by returning to the start. If you are working in real dimensions, dragging from ArchiCAD in to GDL will do. In creative GDL you are more likely to be defining prism outlines using parameters. The only way you can do this without losing your way is to sketch it out on paper, and number the nodes. Lets look at the basic syntax.
For a simple prism, you do not include materials or the underscore (state the material before the statement), and you do not even need to close the prism. The default is for it to be a closed solid. By adding an underscore and 15 at the end of each line, you get much the same thing, but with added potential.
MATERIAL slabmat PRISM_ number of nodes, thickness, X1,Y1,mask,...... Xn,Yn,mask, X1,Y1,-1
Normally, the value of the masking code is always 15. The power of masking in the underscore version of PRISM is that you can omit faces and lines of the prism and you can curve corners and edges and drill holes through the prism. The curved corners are made using the technique of the Polyline. It is too early to lead you through all these possibilities now, but you need to know that they are available.
CPRISM_ topmat,botmat,sidemat, number of nodes, thickness, X1,Y1,mask,...... Xn,Yn,mask, X1,Y1,-1
Simple A-B based rectangular prism. Left, the origin is at the near left. Right, the origin is at the centre. To illustrate how prisms work, the nodes have been numbered in the order in which they were clicked. In this example, there are 5 points if you include the first point twice the idea being that you fully close
CPRISM_ is what you get when you make instant GDL with the Slab tool. This has all the powers of PRISM_ but it also allows you to change the colours of the top, bottom and side faces. These material parameters are included in the statement. You also have the following types of prism which are suitable for later study check the syntax in the ArchiCAD Help menu: BPRISM_ is an extension of CPRISM_ but allows you to bend the prism by adding a radius of curvature. It bends downwards, but if you precede it with a mirroring routine (MULZ -1), it will bend upwards.
Introduction to Object Making with ArchiCAD
62
BPRISM_ topmat,botmat,sidemat, number of nodes, thickness, radius, X1,Y1,mask,...... Xn,Yn,mask, X1,Y1,-1 FPRISM_ and HPRISM_ are extensions of CPRISM_ but allows you to have curved or chamfered top edges (hills) by specifying the angle, height and material of the hill. This is useful for suggesting softness, e.g. upholsery in furniture. However, they create a lot of polygons and lines in 3D view. FPRISM_ is almost obsolete because HPRISM_ does the same but better. HPRISM_ topmat,botmat,sidemat,hillmat, number of nodes, thickness, hillangle,hillheight,hillstatus, X1,Y1,mask,...... Xn,Yn,mask, X1,Y1,-1 The Hill is visible in the illustration if the hill angle is 0, the hill will be rounded. Hill material and height have to be included. Hill status is 0 or 1 (invisible or visible edges).
BPRISM_ and FPRISM_/HPRISM_ SPRISM_ is an extension of CPRISM_ but allows you to have a cutting plane taken through the prism. As it is possible and easier to use an actual command CUTPLANE, this version of the Prism is almost never required.
If you are doing a very simple solid one-color prism, you can remove the c and the material definitions to make it simpler. One single material definition is enough for the whole prism. You can use the GDL text editors Find and Replace function to remove some of the surplus spaces to make the code look more compact. So you are left with simpler PRISM_ :
MATERIAL slabmat
Introduction to Object Making with ArchiCAD
63
PRISM_ 13, 0.1, 0.0, 0.0, 15, 4.28548, 0.0,15, 4.28548, 0.949196, 15,
using A and B as parameters for width and depth with the origin at the near left corner.
!Alternative Codes for the Seat frame.... !BLOCK A,B,frsec-0.002 !Simple Prism PRISM 5,frsec-0.002, 0,0, A,0, A,B, 0,B, 0,0
etc, etc, etc In creative GDL, you have to decide how your model is to be written. Do you have a single prism shape that is not parametric? If so, use the dragging method, but try always to work from the main origin of the project to ensure that at least one node of the prism is zero. If the shape is parametric, such as a window or door frame, then you should always do a sketch on paper of the prism, number each node in an anti clockwise direction. Then start writing the prism methodically using parameters, or significant dimensions where appropriate. Remember that Prisms can be anywhere in the XY plane, but must rise vertically from a local zero plane. You will usually have to ADDZ before you make a prism. Have a look in the GDL Reference Manual (by now you should find it a lot easier to browse) and read the section on PRISMs in the chapter dealing with 3D to make sure you know the syntax.
Comma confusion?
In some countries, it is common to write decimal points as commas, e.g., 1,25. In other countries it is common to write thousands with commas for example, a million is 1,000,000. If you have a localized ArchiCAD, this is how numbers may appear in the parameters box. But in GDL, the scripts are hard coded so only one convention can be followed. Dots are used to form the decimal point, and commas are used to separate numbers. Many of the errors in your early efforts in creative prism writing with GDL will be with misplaced dots and commas. Pay strict attention to them. Use a monospaced font in scripting, so that you can get all the commas and dots to line up vertically.
Progress from the simple block to a frame that looks more authentic. The frames can be centred to the legs. We shall drill a hole in the prism. The first requirement is that you have the underscore type, with the masking codes. Keep them all as 15 for the moment.
!Same prism with drawing codes PRISM_ 5, frsec-0.002, 0,0, 15, A,0, 15, A,B, 15, 0,B, 15, 0,0, -1
64
The way to cut the hole is to write the Prism statement for the outline of the solid, using 15s for masking. When you repeat the first point as the last point, the prism needs to be told that its the last point by using a masking code of -1. Continue on with the XY points for the inline of the hole , using 15s again for the masking. Again, you use a -1 to indicate that you have completed the inline. Make sure that that the number of points is written correctly with the hole, we have gone from 5 points to 5+5, i.e. 10. Lets make a temporary parameter of ft for frame thickness, and give it a value of 30mm or 1.25. let this be a manufacturers parameter, so do not put it in the Parameter Table.
!Prism with hole, for frame effect ft=0.03 !Frame thickness PRISM_ 5+5, frsec-0.002, 0,0, 15, !start of outline A,0, 15, A,B, 15, 0,B, 15, 0,0, -1, !end of outline ft, ft, 15, !start of inline A-ft,ft, 15, A-ft,B-ft, 15, ft, B-ft, 15, ft, ft, -1 !end of inline
15, 15, 15, -1, 15, !Hole inline 15, 15, 15, -1
See the right hand illustration on the previous page. Its a small change, but worth doing for authenticity. Another way to do this would be to keeping the theme of a frame, but build 4 prisms, one for each side of the frame. The benefit of this would be to be able to control the woodgrain in each piece. We will do this later in the book. As in the illustration we have a chair with a frame and nothing in the frame very uncomfortable! We can now make a prism to fill the empty space, and make it of upholstery on top, with an undersurface, perhaps of the same material as the frame.
With this code, you get the chair as in the illustration (centre). We can add a cushion later.
65
You can see how the seat upholstery is chamfered to give a soft look. Lets try to curve the back now!
6.3 Learn about Circle Geometry and make the chair more comfortable
While this chapter is about Prisms, we can profit by looking at the bendy BPRISM_ and applying it to the back of the chair. We would like to curve the back panel to make it more comfortable and authentic. As the width of the chair is A, we need to make a parameter for the bulge of the chairback bbulg and work out a formula based on A to calculate how much curvature to apply to the chairback. Here it is.
The chairback is a chord, a slice off the edge of a theoretical circle. If we can work out from the bulge what the sweep angle is, we can work out the radius. From this you can work out the circumferential distance travelled by the back. This is all that you need. The formulae are printed below.
Make a new parameter bbulg (dimension). First the Master Script is required to do the calculations.
66
!--------Add to Master Script--------!Back bulge Circle calculation formula IF bbulg<=0.01 THEN bbulg=0.01 IF bbulg>=0.08 THEN bbulg=0.08 bangl=(90-ATN((A/2)/bbulg))*2 !Half angle brad=(A/2)/SIN(bangl) !Radius of curve bcirc=2*PI*rad*bangl*360 !Half chord length PARAMETERS bbulg=bbulg
Here we have two idiotproofing lines to protect against extreme values being entered by the user. PARAMETERS reports the corrected dimensions back to the user in case of an error. We must calculate the sweep angle, and its easiest to calculate the half angle bangl between the edge and the centre. From that we can work out brad the radius. Finally, as BPRISM_ is like a flat surface bent into a curve, we need to find out the length of the chord. As BPRISM_ has to be organised around the centre of the chair for it to bend symmetrically, we need only the half length of the chord. So look at the 3D script as it was before, and make the modification.
!Cushion, not chamfered ADDz -lsec/6 BPRISM_ seatmat,framat,seatmat, 5,lsec/6,brad, -bcirc +ft,ft,15, bcirc -ft,ft,15, bcirc -ft,bhit*0.6-ft,15, -bcirc +ft,bhit*0.6-ft,15, -bcirc +ft,ft,-1 DEL 3 !BLOCK A,lsec/2,bhit*0.6 !original Back panel ENDIF !if bakon
!Modify 3D Script !Back Legs, panel and upholstery IF bakon THEN MATERIAL framat ADD 0,B,sthit CONE bhit,lsec/2,lsec/3, 90,90 ADDx A CONE bhit,lsec/2,lsec/3, 90,90 DEL 2 !Back panel ADD A/2,B-lsec/3+bbulg,sthit+bhit*0.9 ROTx -90 BPRISM_ framat,framat,framat, 5,lsec/3,brad, -bcirc,0,15, bcirc,0,15, bcirc,bhit*0.6,15, -bcirc,bhit*0.6,15, -bcirc,0,-1
Introduction to Object Making with ArchiCAD
In the 3D Script, we built the back legs, as before, but for the back panel, we have to do some 3D manoevres. We use ADD to get to the centre of the chair. Because BPRISM_ curves downwards, we have to get behind the chair and use ROTx so that the Z axis is facing backwards (away from the chair). Play with the script of the chair changing the ROTx from -90 to 90. The height of the prism will be from the topmost part sthit+bhit*0.9. Try changing the values to see where the back moves to. We made the half-width of the prism the half-circumference, so that whatever the bulge value, it will always fit perfectly. The back cushion by adjusting the Z height, we can shift a small distance and issue another BPRISM_ for the upholstery, using soft fabric. DEL 3 takes us right back to the origin. You may wonder why we cannot chamfer the edges of the upholstery on the back as we did for the seat. We cannot have both a curve. You have the choice of BPRISM_ or HPRISM_ so you choose. For me, the curved back takes priority.
67
HOTARC2 x, y, r, alpha, beta: the same as ARC2 above, but it is a new ArchiCAD 9 command that makes it easier to pick the object up in the floor plan. Now make the modification to the 2D Script.
!Put these lines in for the curved back !LINE2 s2,B-s4, A-s2,B-s4 !back !LINE2 s2,B+s4, A-s2,B+s4 !back ARC2A/2,B-brad+bbulg,brad,90-bangl+2,90+bangl-2 !for AC9 addthe lines below !HOTARC2 A/2,B-brad+bbulg,brad, ! 90-bangl+2,90+bangl-2 LINE2 s2,B, A-s2,B !back for AC7,8 !HOTLINE2 s2,B, A-s2,B !add for AC9
We do not have to use ADD2 commands here. We position the arc with an XY coordinate, and the position is at the centre of the back, as with the prism. The sweep angle of the arc can be bangl either way. By deducting 2 either way, it looks better in relation to the legs.
You can shorten the time of building prisms with Instant GDL using Drag and Drop. Instant GDL is best built from slabs placed on the main origin. It is best used if prism shape is not going to change much. Otherwise, define the prism with parameters. A common cause of errors when writing prisms is confusion with commas. Drilling holes write the XYs of the hole immediately after the outline XYs. Soft edge effects can be achieved with HPRISM. Curved solids can be made with BPRISM. This may require some calculation to get it the correct size and position. If the object gets too complex, use a PROJECT2. If you can still manage the code, write the 2D with a proper script.
68
it first seemed. Remind yourself again how to make objects using ArchiCADs own tools by looking at the start of chapter 2. When you look at a script of an autoscripted object, you need to recognise what the bits are. Every element in ArchiCADs toolbox has its 2D or 3D equivalent in GDL. You can find out which by laying out elements in the ArchiCAD Floor Plan and dragging them to a GDL Script window. Walls become XWALL_{2} Roofs become CSLAB_ Floors become CPRISM_ Beams become BEAM Columns become CPRISM_ Mesh becomes MASS Fills and Polylines become POLY2_B{2} Line becomes LINE2 Spline lines become SPLINE2A Texts become TEXT2 Circles become CIRCLE2 Hotspots become HOTSPOT2 Objects, Lamps, Profiler objects, Stairs etc are brought in as Macros and appear in the form of a CALL statement. In the script, every part will have the original ID, and you can compare that with the IDs in the model.
69
making sure that you tick the Editable button. Place the object again, now open the GDL and view the scripts.
First thing you can do it to view the table in 3D and paste a nice small square image into the Preview Window. The 3D script starts out with some titling. Its good to have date and objects name and author at the start of the script. Do likewise when you write creative scripts.
! Document name: ! ! Name : table_2_iomwac.gsm ! Date : April 2004 ! Version : 8.10 ! Written by ArchiCAD ! MULXA/2.25753262639 MULYB/1.001325786114 MULZZZYZX/ 0.75 ADDX 0.4849148094654 ADDY 0.5064862370491 BODY -1 MODEL SOLID RESOL 36
objects from ArchiCAD 5.0 (and earlier) already used Z for other purposes and might no longer work. The GDL development team chose zzyzx after a small town overlooking a dried salt lake in California near Las Vegas, the last town in the US directory of placenames. Because the autoscripted units are accurate to a million millionth of a metre, you get a vast number of trailing decimals. You will wish you had built them with a small snap grid working. Now you can see how stretchiness works in autoscripted objects. If you shrink the table to a A value of 1.8 metres, the MULX command will multiply everything in the X direction by A/2.25753262639 (i.e. 1.8/2.25753262639). This will make it slightly shorter. If you stretch the height to be 1.2 metres, the vertical components will all be multiplied using MULZ by 1.2/0.75. The MULY command works in the same way. Retain (if you want it to be stretchy). If you want the table NOT to be stretchy, delete the 3 MUL commands, and replace the 2D Symbol with a PROJECT2 3,270,2 in the 2D Script. Youll get bounding box hotspots.
The three MUL commands enable the object to be stretchy. When it was first made, the table was drawn by eye in the floor plan, so it was approximately 2.25 metres by 1.0 metres, and the height was 0.75 metres. ZZYZX is what GDL denotes for the height. This rather curious name arises from the need to call it something related to Z when ArchiCAD 6.0 came out. But it could not be called Z as many older
The most easily changed parameters are Material and Pen The ADD command is an offset this is in case you built the object a long distance from the origin of the main floor plan. Some people build their objects hundreds, sometimes thousands of metres from the project origin. If you build very close to the projects Origin (it must be the main project origin, not a temporary one) then this offset will be very small. As we built this on the origin, you can see that this
70
offset is trying to place the objects own origin at the bottom left-hand corner. Retain. The BODY -1 command is one that autoscripts always carry. These are a command to the GDL interpreter to ensure the 3D integrity of each object. They are not necessary in creative GDL until you get into more complex tasks such as the TUBE command. Delete BODY. MODEL SOLID just tells the object to be solid. This is the default condition, so if you did not write it, your model would still be solid even without the command. RESOL 36 tells it that all rounded surfaces are to have 36 polygons to make up a full circle. 36 is the default value for this, so you do not really need this either. Delete MODEL SOLID.
GLOB_SCRIPT_TYPE = 3 GLOB_CONTEXT = 3 GLOB_SCALE = 50 GLOB_NORTH_DIR = 90 GLOB_DRAWING_BGD_PEN = 91 GLOB_FRAME_NR = -1 GLOB_EYEPOS_X = -35.85101578994 GLOB_EYEPOS_Y = -7.730174812729 GLOB_EYEPOS_Z = 1.557576862359 GLOB_TARGPOS_X = -30.44915475591 GLOB_TARGPOS_Y = -5.030201323002 GLOB_TARGPOS_Z = 1.5 GLOB_SUN_AZIMUTH = 239.847 GLOB_SUN_ALTITUDE = 11.2981 BODY -1 BODY -1 GLOB_HSTORY_HEIGHT = 0.65
GLOB_LAYER = "Floors" GLOB_ID = "Slab-062" GLOB_INTID = 667 BODY -1 ADDZ 0.6 cPRISM_ "Surface-Whitewash", "Surface-Whitewash", "Surface-Whitewash", 5, 0.1, 0.04300407447266, 0.01376101330492, 15, 1.259910825444, 0.01376101330492, 15, 1.259910825444, -0.02340206237996, 15, 0.04300407447266, -0.02340206237996, 15, 0.04300407447266, 0.01376101330492, -1 DEL 1 BODY -1
This is the first real 3D element in the script. It is obviously the beam under the tabletop as it is only 100 mm deep and is 0.57 metres off the floor. This and the tabletop were made with a Slab tool, and these always translate into a CPRISM_. The syntax for CPRISM_ was explained in chapter 5. The prism is lifted by 0.6 and drawn; then the DEL command returns the cursor to the origin.
!!Slab-059 GLOB_ID = "Slab-059" GLOB_INTID = 651 BODY -1 ADDZ 0.7 cPRISM_ "Surface-Whitewash", "Surface-Whitewash", "Surface-Whitewash", 49, 0.05, -0.004326136003042, 0.4919763397133, 15, -0.03992947334826, 0.490650560281, 79, -0.1100340105909, 0.4778922240699, 79, -0.1776092841723, 0.4552868334455, 79, -0.2412796563933, 0.4232945689723, 79, -0.2997489820857, 0.382566700897, 79, -0.35182699439, 0.3339323311641, 79, -0.3964535351562, 0.2783815152915, 79, -0.4327201367068, 0.2170451076949, 79, etc, etc, etc ...
These GLOB items are called Global Variables. They are not doing anything here except recording the conditions that prevailed when the object was made. At the time the table was made the North point was at 90, there was no animation taking place (Frame number is set to -1), the camera eye and target positions were noted, the drawing scale was 1:50. These are not commands, they are a historical record. You can find out more about Global Variables in Appendix A of the GDL Reference Manual. There are a few more BODYs here. Meanwhile, you can Delete ALL the GLOB s! ...throughout the script.
!!Slab-062 PEN 7
71
This is the tabletop itself. It is obviously the tabletop because the height of the prism is 0.7 metres, the thickness of the prism is 0.05 metres and there are a lot of points (49) because of the curved ends. If we are not sure its the tabletop, the GLOB_ID is matched by the ID of the slab it was made from in the settings dialog. The masking values shows you the 15s but they are modified by having 64 added to each of them 79 (15+64) means that the point is part of a curve and should be treated as smooth by Open GL and the ArchiCAD Rendering engine.
!!Slab-061 GLOB_ID = "Slab-061" GLOB_INTID = 655 BODY -1 ADDZ 0.05 cPRISM_ "Surface-Whitewash", "Surface-Whitewash", "Surface-Whitewash", 15, 0.05, -0.02400049266183, 0.3960784971471, 15, -0.036711189204, 0.31606425849, 79, -0.05203414774601, 0.154755338342, 79,
etc, etc, etc... These are obviously table feet, judging by their height and depth.
72
Materials and Pen, but note in so doing that GDL has now given you a load of ready made parameter names for some of these which you can use. It will also give you ones you do not intend to use, perhaps, so click the Hide button next to the ArchiFM title and all the other parameters will be hidden from the users view. New parameters you make will be put at the bottom, annoyingly. Move them up. Selecting the right subtype is more than a way to save you typing. The object will conform with some of the internal routines of ArchiCAD (for example the wall cutting of window or the roof cutting of the skylight). For most objects, the main advantage is that they will show up correctly in Interactive Schedules. The common parameters are the key to group editing and group reporting. For example if you use gs_top_mat and gs_leg_mat for the top and leg materials, you could select a whole host of different tables (of subtype table) and update materials in all tables simultaneously. Simplify A and B to exactly 2.25 m and 1.0 m, the dimensions we wanted in the first place when building the eyeballed table. Here, the parameter box is in millimetres. Do not forget to keep strictly to metres when writing anything into the actual script. Make a new parameter tthik for tabletop thickness.
73
table that you believe it to be. Change the materials at the start of each CPRISM to the parameters you made.
! Name : table_2_iomwac.gsm ! Date : April 2004 ! Version : 8.10 ! Written by ArchiCAD modified for iOMWAC MULX A/2.25753262639 MULY B/1.001325786114 !!Centre Beam PEN gs_cont_pen ADDZ zzyzx-0.1-tthik cPRISM_ botmat, botmat, botmat, 5, 0.1, 0.04, 0.01376101330492, 15, 1.21, 0.01376101330492, 15, 1.21, -0.02340206237996, 15, 0.04, -0.02340206237996, 15, 0.04, 0.01376101330492, -1 DEL 1 !!Tabletop ADDZ zzyzx-tthik cPRISM_ gs_top_mat, botmat, edgmat, 49, tthik, -0.004326136003042, 0.4919763397133, 15, -0.03992947334826, 0.490650560281, 79, -0.1100340105909, 0.4778922240699, 79, -0.1776092841723, 0.4552868334455, 79, -0.2412796563933, 0.4232945689723, 79, -0.2997489820857, 0.382566700897, 79, -0.35182699439, 0.3339323311641, 79, -0.3964535351562, 0.2783815152915, 79, -0.4327201367068, 0.2170451076949, 79, -0.4598885156183, 0.1511717407535, 79, -0.4774056020433, 0.08210240625503, 79, -0.4849147986173, 0.01124315667042, 79,
Delete the ADD offsets, but remember to delete the equivalent offset command in the 2D script or the symbol and the actual table will not coincide in location. Put in a parametric PEN command, provide a new title for the tabletop, and remove all the redundant GLOBs and BODYs and all later PENs. Now label each part in the 3D script with the part of the
etc, etc, etc... For the beam, change the ADDZ command to be the total table height minus the tabletop thickness minus foot height. For the tabletop, change the ADDZ command to be the total table height minus the tabletop thickness. Change the tabletop thickness to the new parameter of tthik.
74
Ever mindful of quality, we could put in a Master Script routine like the one below to control the zzyzx height of the table and you could do this for the tthik too. The greater than or equals sign (>=) always works better than simple greater than (>), and the same for the smaller than (<).
!Modified Table !Master Script IF zzyzx>=1.2 THEN zzyzx=1.2 IF zzyzx<=0.4 THEN zzyzx=0.4 PARAMETERS zzyzx=zzyzx
0.07424769749459, -0.1642796538628, 0.07867493665818, 0.002408716924311, 0.0729319557382, 0.1690569439548, 0.05704011900087, 0.3350450848787, 0.04732645894257, 0.3960784971471, -0.02400049266183, 0.3960784971471, DEL 1 !!Little circular pad under foot cPRISM_ footmat2, footmat2, footmat2, 39, 0.05, 0.0410091477233, 0.3437969914738, 0.0410091477233, 0.3463603485633, 0.04011890314868, 0.3514091764344, 0.03836546363036, 0.3562267119174, 0.03580210654081, 0.3606665766344, etc, etc, etc.
If you wish, you can also clean up some of the million millionth of a metre decimals to clean rounded dimensions, but here it is only worth doing it in the case of the beam under the tabletop we can ensure that it centres nicely on the cylindrical legs. As the CPRISM allows you to specify top material, bottom material and side material within the command, replace all that Whitewash with your new material parameters. Because we selected the table Subtype definition we have gs_top_mat, and gs_leg_mat given to us. We can also put in the other parameter values like botmat and edgmat etc. Note that in the script they must NOT appear with quote marks they are material indices, not names. Although it takes a bit more thinking about, you should do the same thing to all the leg parts under the table top. Once you have embarked on this, you have to finish. Think it out and work it through, guessing which parts they all are and how the heights need to be adjusted. Provide a label for each part. Do it all the way to the end of the 3D Script.
!!Foot element under leg ADDZ 0.05 cPRISM_ footmat, footmat, footmat, 15, 0.05, -0.02400049266183, 0.3960784971471, -0.036711189204, 0.31606425849, -0.05203414774601, 0.154755338342, -0.05719819902872, -0.007197412027317, -0.05218296290095, -0.1691548391012, -0.03700823220845, -0.3304777709065, -0.02400049266183, -0.4128433470601, 0.04732645894257, -0.4128433470601, 0.05966670786791, -0.330388076719,
75
DEL 1 RETURN
76
DEL 1 ENDIF
There are lines containing 900 and 4001 status codes which are beyond the scope of this chapter. For the moment, just use the POLY2 as it comes, and change only the Pen parameters.
This is the method whereby you make a component in the ArchiCAD plan, then drag and drop it into a script window. Dragging is not advisable for entire objects for which saving objects using methods 1 and 2 are perfectly suited. But it is the ideal way to make single components such as fretwork, curvy shapes, outlines for furniture legs and a hundred other uses. These can be stitched into the structure of your creatively scripted object. It is possible to do the same for 2D objects, such as fills and lines.
77
A lot of 3D commands involve drawing out a 2D profile and then doing something with it: EXTRUDE extrudes, REVOLVE lathes the section around an axis; SWEEP pulls a profile through 3D space, twisting or rescaling the section as it goes; TUBE also draws a 2D profile through 3D space, allowing it to be twisted and mitred as it goes; PYRAMID pulls the nodes on a 2D profile to one point; RULED takes the points on a 2D profile and allows you to form a 3D solid by repeating the same number of nodes at different heights. These all use the same syntax for XY points as POLY2_B{2}. All of these profiles support the use of Polylines. These are outside the scope of this book. If you use the 2D Fill tool and force lines to be curves, and then copy them to GDL, you will find many lines with 900 and 4001 in them. These define centres and radii of curvature. If you copy and paste these 2D profiles and use them in this way, you dont entirely have to know how they work. They just do.
Note that if you have tried to use Profiler for lathing, it works around a vertical axis. Here we have to use a horizontal axis.
Create a New Library Part from the File menu, and position the 2D window to the right of the screen, so that it is next to the project floor plan. Drag and drop the 2D fill into the 2D Script window do the drag over very fast. You should get something like this:
PEN 1 SET FILL "25 %" POLY2_B{2} 13, 1, 0, 0, 0, 0, 0, 0, 0.3760557831815, 1, 0.06592689450963, 0.3760557831815, 1, 0.1013692707986, 0.258191153049, 1, 0.142621891345, 0.2282009802147, 900, 0, -107.9665730337, 4001, 0.1838745118913, 0.258191153049, 1, 0.6645848017343, -0.6870353976553, 900, 0, -47.59681179421, 4001, 1.038393080352, 0.305337005102, 1, 1.380200507736, 0.163899448943, 1, 1.556751901622, 0.02393520066069, 900, 0, -60.68649776848, 4001, 1.592356841974, 0.2464046900357, -1 HOTSPOT2 0, 0.3760557831815 HOTSPOT2 0.06592689450963, 0.3760557831815 HOTSPOT2 0.1013692707986, 0.258191153049 HOTSPOT2 0.1838745118913, 0.258191153049
Introduction to Object Making with ArchiCAD
78
Now, copy only the list of XY points and paste it into the 3D Script, noting that there were 13 lines in the POLY2. When the list is in the 3D Script, leave all the status codes as they are except the last one which is an ArchiCAD error. This should be 1, not -1. Now add the REVOLVE command above the list of points. The word REVOLVE is followed by the number of points (was 13), the angle through which the profile should be revolved (360) and finally a masking value, which you can assume to be 61. You need to precede the REVOLVE command with a ROTy 90 because the lathed object is turned around the X-axis, and is therefore horizontal. Things which need to stand upright should be rotated minus 90 around Y.
PEN 1 MATERIAL 18 !Temporary values for pen & material RESOL 16 ROTy -90 REVOLVE 13,360,61, 0, 0.3760557831815, 1, 0.06592689450963, 0.3760557831815, 1, 0.1013692707986, 0.258191153049, 1, 0.142621891345, 0.2282009802147, 900, 0, -107.9665730337, 4001, 0.1838745118913, 0.258191153049, 1, 0.6645848017343, -0.6870353976553, 900, 0, -47.59681179421, 4001, 1.038393080352, 0.305337005102, 1, 1.380200507736, 0.163899448943, 1, 1.556751901622, 0.02393520066069, 900, 0, -60.68649776848, 4001, 1.592356841974, 0.2464046900357, +1 DEL 1
Here is the finished pot. Delete the hotspots and all from the 2D Script and replace with a standard PROJECT2 statement.
The Chesspieces are made entirely using this Drag and Revolve technique. Masking codes and Curvature control The key to knowing the masking code here is thus: 60 will give you a lathed object open at both ends, with pen lines top and bottom. 61 will give you an open object with pen lines and a flat bottom. 63 will give you a solid closed object, with pen lines.
79
Whatever value you give RESOL here, the vase will look smooth because we are using Open GL rendering. With ArchiCADs 3D engine, you will see the polygons. The RESOL command tells GDL that you only want 16 polygonal faces to the shape. You can ruin your model with too many polygons. Multiply these vases by a few hundred and your computer may not have enough memory to render, and you may have an unrealistic number of polygons if you wish to export to DXF/DWG or an external renderer. The benefit of being a GDL user is that you can control the number of polygons with a simple RESOL (or TOLER) command.
the autoscript. But it has been a good means of demonstrating the contents of an autoscript. The easiest things to change into parameters are the names of materials they can be replaced with variable names. The methods used in this chapter are fine for complete objects. But if you are working at creative GDL and simply want a quick solution, try Instant GDL drag and drop. Many 3D objects use the same syntax as the 2D Fill tool, so you can make interesting 3D objects easily. REVOLVE is a good use of this technique. You may have to learn about object masking. It is important to control the number of polygons in the model if you are building any objects that are repeated in great numbers you must use GDL to define the number of polygons in each solid.
These curved 3D lattices can be made with Profiler and require only the smallest amount of GDL tweaking to make them 3D. See the GDL Cookbook for a thorough explanation.
80
8.1 Subroutines
Subroutines are pieces of GDL code that we want to repeat. Even if we only want to use them once, we can package the code into a discrete bundle. We store subroutines at the end of the script, after the END statement, and give them a label number just like a piece of luggage. We must never allow the script to run accidentally into the subroutines they must only happen when required. Subroutines are at the heart of complex GDL scripting. Subroutines can be used in all the scripts except the Master Script (in which case if you used the END statement, the entire object would obey!)
!Chair GOSUB 100:!All the Legs GOSUB 200:!Draw the Seat GOSUB 300:!Build the Back END !----------------------------100:!All the legs GOSUB 110:!One single leg ADDx A GOSUB 110:!One single leg ADDy B GOSUB 110:!One single leg ADDx -A GOSUB 110:!One single leg DEL 3 RETURN 110:!One single leg CONE sthit, lsec/3,lsec/2, 90,90 RETURN
In this case, you could refer to the first part of the script as the executive script, with most of the actual work being done by the subroutines that follow the END command. Subroutines can be hierarchical, and can be moved or rotated like objects (see the ROTx command for the window below). This is moving towards what we mean when we talk about object oriented programming. We make every part of the model a discrete package that can be identified and made to perform or locate itself according to rules. In a human figure, the entire Arm object (which hinged at the shoulder) could GOSUB a subroutine for the Forearm (hinging at the elbow), and that could GOSUB the Hand (hinging at the wrist), and the hand could GOSUB each of the Fingers (each of which is correctly sized and hinging according to the rules). As the Fingernails are largely the same (with minor variations on size), each finger would
81
call the same fingernail subroutine, passing it a different value for length and width. Look at your object for every opportunity to make use of repetition and if they do not repeat exactly, they may be close enough to repeat with minor variations, using this concept of hierarchy. Subroutines must have number labels and this helps with organisation. For example, in a cabinet design, everything to do with the cabinet itself can be numbered 100, 110, 120 etc. The drawer parts can all be numbered in the 200 family, e.g. 200, 210, 220 etc. Graphical hotspots can all start from 1000, and be numbered 1000, 1010, 1020 etc. Thus you can find everything easily. You do not have to write colons after the label number except when they are actually a label. However, its a good discipline to provide a comment with every subroutine, so I usually write the subroutine first line (as in the example above) then copy and paste the line to the place where it will be used with the GOSUB command so the comment is the same as the subroutine title.
you can issue a GOSUB command that includes the flag in the line number. For example:
!Window object ROTx -90 GOSUB 100+ws !Window DEL 1 END:!----------------------------------100:!Rectangular window ........... RETURN 101:!Round topped window ........... RETURN 102:!Gothic window ........... RETURN
In this case the drawers can be in subroutines which get told their width, depth and height. Graphical hotspots which open and shut the drawers can also be put into subroutines.
82
In cursor movement, subroutines must be self contained; the number of DELs must exactly equal the number of cursor movements. Execution of the any script must never run accidentally into a subroutine GOSUB must be the only entry ticket. You must avoid the risk of running from one subroutine to another by forgetting to close it with the RETURN.
Macros can be placed in the plan like any other object or if the author wishes, they can be made unplaceable using the little checkbox in the GDL dialog.
8.2 Macros
Macros are separate small GDL files which can be somewhere in your library and can be called in, like a subroutine, but exist outside the object you are currently writing. These are essential in manufacturing, for example kitchen and door design they are much more powerful than subroutines. If you look at the kitchens or doors in the ArchiCAD library you will realise that if every kitchen unit had to carry identical subroutines for taps and inserted sinks, there would be an impossible maintenance problem. Everytime you updated the range of taps, you would have to open every kitchen cabinet and update the tap subroutine. Think about doors. There are a huge variety of doors and a huge variety of door ironmongery items, and the permutations of both become uncountable all of which can fit into a door frame 900x2100mm. What happens when the range of doors needs to be updated? The mind boggles at the workload. The solution is to be found by making the primary GDL object a user interface with the main parameters offered to the user, much of it in the form of popdown or pictorial menus. A door object will do nothing much more in real GDL terms than cut the hole in the wall the WALLHOLE command. It will then use the CALL command to call in a suitable door frame, call in architraves if they are required, call in a door (from a library of door types), call in the handle. Macros can be hierarchical so the frame can call the architrave, the door can call the handle, the door can call the glazed panel. In each case information is passed down the chain to the macros, for example how big to be, and which material to use. If you do not pass information to the macro, it comes in using the parameters with which it was saved.
Introduction to Object Making with ArchiCAD
83
VALUES 'bthrm_part' 'Bidet','WC','WHB', 'Bath' !Bathroom fitting !2D Script !Macro Call using default values IF bthrm_part='Bidet' THEN CALL bthrm_bidet IF bthrm_part='WC' THEN CALL bthrm_WC IF bthrm_part='WHB' THEN CALL bthrm_bath !Macro Call sending information IF bthrm_part='WHB' THEN CALL bthrm_WHB PARAMETERS A=0.45,B=0.35 ENDIF
The Chessboard has comparatively simple GDL (a FOR NEXT Loop) to form the squares. The board can be used on its own. A more interesting possibility is that the board might contain the starting layout, and a number of famous endgame positions and lay the pieces out itself. It could contain the pattern for these patterns in a dataset and summon up each chesspiece as a Macro, repeatedly placing it in the appropriate location, and specifying with the PARAMETERS command which rank and which colour it is to be. Theoretically, you could extend this to include higher levels of intelligence, e.g. getting it to play during animations.
If you set the Subtype to drawing symbol, you will not be asked for a zzyzx value. If the objects have been saved with the correct A and B values, there is no need to specify further information they will come in the correct size. In the case of the WHB, we can send it the correct sizes. In this case, it would be difficult to make the final object stretchy as they all have different A and B. Also, in listings, you would get 4 of the same object in one room whereas you might be better to keep them separate but it is a fast drawing aid. Your choice.
Another simple example would be this chess set. The chesspiece is a single GDL object that contains Subroutines, one for each ranked piece in the set the user chooses from a popdown menu.
84
method for making ValueLists ensures that the language can easily be changed. Wood is to Norwegians what leather is to Argentinians or wine to the French. It has to be just right. Every small piece of wood has to have the correct texture direction, every mitred joint has to look authentic. The texture direction is calculated by every piece of timber every macro containing a tiny piece of beading knows which way to push the woodgrain.
You can see all the macros sitting in a tidy little heap in the distance, the architraves, grilles, casement, even the glass. Even in the 2D, the window uses macros, the same section outlines that are used to draw the 3D timbers. The window is scale sensitive if the drawing is 1/50 this is how it will draw. It has other 2D outlines for when the drawing is 1/100, or 1/20. This is essential in good GDL or the object will just be a dense mass of ink if the 2D symbol has too much detail at 1/100.
Earlier in this chapter, it was said that you could use a subroutine like an object swivel it, relocate it. Well this toothpaste tube can be
85
pointed and squirted. After you have written an object, you rotate as required, issue the texture GOSUB command, and it will be done. BLOCK A,B,zzyzx ROTy -90:GOSUB 999:DEL 1 !Texture vertical Above you can see an example of combining several statements on one line separated only by a humble colon.
A+f2, -f2, 15, A+f2, B+f2, 15, -f2, B+f2, 15, -f2, -f2, -1, f2, f2, 15, A-f2, f2, 15, A-f2, B-f2, 15, f2, B-f2, 15, f2, f2, -1 !Seatcushion !Chamfered with HPRISM_ HPRISM_ seatmat,framat,seatmat,seatmat, 5,frsec+0.010, 30,0.01,1, f2, f2, 15, A-f2, f2, 15, A-f2,B-f2, 15, f2,B-f2, 15, f2, f2, -1 DEL 1 RETURN
This worked in 3D form, but the texture would be the same on the side seat frames and on the front and back seat frames. Use the 999 subroutine that was printed earlier, and do 4 separate frames these always come after the 3D statement.
Left, the chair without texture control in the woodgrain. Right, with textures working correctly.
200:!The Seat and upholstery ADDz sthit-frsec !Improved Mortice and tenon ft=0.03 f2=ft/2 PRISM_ 5+5, frsec-0.002, -f2, -f2, 15,
86
Everything here is getting the texture right leg braces, arms, legs, seat frames. We cannot change pen lines at joints between cones. You need REVOLVE to control pen lines.
!Chair with frame and textures 200:!The Seat and upholstery ADDz sthit-frsec !Do four prisms for seatframe ft=0.03 f2=ft/2 GOSUB 210:!Front to Back frame ADDx A GOSUB 210:!Front to Back frame DEL 1 GOSUB 220:!Left to Right frame ADDy B GOSUB 220:!Left to Right frame DEL 1 !Seatcushion HPRISM_ seatmat,framat,seatmat,seatmat, 5,frsec+0.010, 30,0.01,1, f2, f2, 15, A-f2, f2, 15, A-f2,B-f2, 15, f2,B-f2, 15, f2, f2, -1 GOSUB 999:!Paint Texture DEL 1 RETURN 210:!Front to Back frame PRISM 5,frsec-0.002, -f2,0, f2,0, f2,B, -f2,B, -f2,0 ROTz 90 GOSUB 999:!Paint Texture DEL 1 RETURN 220:!Left to Right frame PRISM 5,frsec-0.002, -f2,-f2, A-f2,-f2,
Introduction to Object Making with ArchiCAD
Look at the rest of the script in the object Space does not permit us to print the whole of the chair 3D script converted to subroutines with texture mapping, but you can look at the object off the CD or website and it will become quite clear to you.
87
Sadly... if you use Binary objects or Solid Geometry Commands (SGC) in GDL (see ch. 11), you may not be able to use this method of texture control.
88
Piranesi and Artlantis (third party renderers for ArchiCAD) work well with cutouts, or you can use their own library of billboard objects for people and trees. But they are not your people and your signs, and you may want to do your renderings in ArchiCAD. The new Lightworks renderer will encourage people to use ArchiCAD for renderings and save you the worry about the wrinkles of exporting to third party renderers.
89
oblivion). Save this cropped image into a loaded library and reload libraries. If you havent got a straight-on view of your subject, you will first have to use Photoshops Edit>Free Transform>Perspective and Distort to adjust and straighten the image.
Here you see the ArchiCAD Carpet and Picture objects. To the left we see the Picture object adapted to allow a silhouette effect with alpha channels, and no back panel. You can also see two Icepeople, another good way of populating scenes. Anybody who has played computer games knows that the urban environments are mostly very simple in 3D but are made complex by having photographs mapped onto simple block shapes and trees are usually planar cutout objects. Lets look at three techniques for making our own objects, the Cutout Billboard, the Picture Billboard, and combination of the two. This chapter includes instructions on making the Alpha channel.
We use an image of Matthew Lohden, a prime contributor to ArchiCAD-Talk and to ArchiCAD University events. Now you can place it as a Figure into the ground plan. Without losing the proportions, resize it till its the correct size. In this case, its 590mm x 1800mm (2 ft x 6 ft). From the Options > Attribute Settings >Materials in ArchiCAD make a new material. Take a material like Whitewash, hit the Duplicate button, rename the duplicate in this case I called it matthew_cutout. Use the Texture button to bring in the Figure. Set the size of the Figure used for the texture to the same as the one in the plan 590mm x 1800mm.
90
Now, back in the plan, select the Slab tool, set it to 10mm (3.8) high and trace closely around the image as in the illustration. Trace another rectangular slab over the cropped image. Set the material of both slabs to be matthew_cutout. Initially, you will find the texture will be starting from a random position, but at least you have the comfort of knowing its the right size in fact its coming from the main origin of the project, a long way away. We need to use Align Texture to get this starting from the bottom left corner. Open GL is a great help here because you get instant display to changes of the texture alignment in the 3D View.
If your cutout fitted the Figure closely (to within one pixel) the 3D Script will have been written so that the bottom left corner is the origin of the new object. So if you set the texture to the bottom left, you will get a perfect alignment. If the Align Texture routine worked, 3D Script will end with:
! The CPRISM will end, something like this..... -35.36420271267, 12.94639198852, 15, -35.35731157426, 12.90504515807, 15, -35.30677655926, 12.88720216694, -1 BASE VERT -35.45259415915, 12.88720216694, -0.0004516888204097 VERT -33.64050165154, 12.88720216694, -0.0004516888204097 VERT -35.45259415915, 13.53348955012, -0.0004516888204097 VERT -35.45259415915, 12.88720216694, 0.009096622359181 COOR 8468, -1, -2, -3, -4 DEL 1 BODY -1
Select both your slabs and view in 3D Axonometric. Use Edit>Align Texture>Set Origin and place the Origin at the bottom left corner of the rectangular slab. Now, try to set the direction, so use Edit>Align Texture>Set Direction to go from a point on the cutout slab in a horizontal direction (use shift key for constraint to go rightwards) if it offers you a choice of graphical or numerical, set the angle numerically, to 0. Select your cutout, view it in 3D Elevation view from 90 and save as an Object, Editable. Place it in the floor plan.
If you have a problem with Align Texture, just save the object. Open the 3D Script and have a look....
! The CPRISM will end, something like this..... -35.36420271267, 12.94639198852, 15, -35.35731157426, 12.90504515807, 15, -35.30677655926, 12.88720216694, -1
91
DEL 1 BODY -1
Now, the Open GL view works with the Cutout perfectly with the Picture based billboard it betrays a telltale rectangle, and does not use transparency. In the Photorender, the shadows work, but not in the same way.
This illustration shows the comparison, left, an Open GL 3D View, and right, a Photorender with shadows, and below, the Plan, with the original slab and the billboards. Starting from the left, you have the author in a Cutout, Matthew in a rectangular cutout (casting shadows), then in a Picture object (casting a rectangular shadow), then two versions of the Cutout object both casting shadows.
92
Now go to the 3D Script and change the three materials of the CPRISM to biltexture, in quote marks. You must also insert a PROJECT2 3,270,2 into the 2D Script. The object will now be completely portable, and you will not need to make a new material in ArchiCAD.
9.3 Make your own Billboards using the Alpha Channel with PICTURE
Billboard objects using the PICTURE command are actually GDL rectangles with a picture mapped on to them for example the carpet and the picture in the ArchiCAD Library. They only become outlined objects by virtue of the alpha channels in the bitmap file and only show correctly in photorenderings. In 3D views they remain as rectangles, and cast rectangular shadows. You do not need to make a Material and Texture definition but you require a quick tutorial in Adobe Photoshop.
Lets make the Alpha channel. In Photoshop, surround Matthew carefully with the polygon-lasso. From the Select menu, Inverse, and delete (the backgound will be erased). Re-Crop the picture closely to the edges of the image, but do this: leave at least ONE white pixel all around the edges. Now use the Magic wand to pick up the white background. The whole white area should be shimmering.
93
Now hit the Select menu>Inverse, and the lasso will now be surrounding the image. Now Save that selection from the Select menu the job is done, the Alpha channel is now created. You can see it in the illustration, added to the list of channels, under the Red, Green and Blue.
Billboard parameters, 3D view and 2D symbol. Save the bitmap file as a .TIF, into a loaded library and reload.
!!Billboard.gsm - 3D Script PEN cont_pen
Introduction to Object Making with ArchiCAD
94
IF gs_shadow THEN SHADOW ON MATERIAL matl ROTx 90 PICTURE picture_file,A,zzyzx,mask DEL 1 HOTSPOT 0,0,0,1 HOTSPOT A,0,0,2 HOTSPOT A,0,zzyzx,3 HOTSPOT 0,0,zzyzx,4 HOTSPOT A/2,0,zzyzx/2,5
This is an ultra simple version of a Picture billboard object, and its possible to build in smarter features for example the ability to turn to face the cameras. See the GDL Cookbook for a more extensive discussion of Billboard objects.
A note on Shadows
Alpha channel based material textures, if applied to ArchiCAD elements or objects will cast shadows correctly cut around the outline of the alpha channel. Picture based objects will cast only rectangular shadows in the ArchiCAD rendering engine, but cast shadows correctly in the Lightworks rebndering engine. To be sure of the best results, go to Image>Photorendering Effects> Options, use transparency in shadow calculation. f you want to cast perfect shadows, the Cutout billboard is the way to get the best result in both renders and 3D views if you are prepared to make a material for each one. Open GL and the 3D view do not use transparency in the Picture object. If you want to control shadow casting, make a Boolean parameter shad and start the 3D Script with the line:
IF shad THEN SHADOW ON ELSE SHADOW OFF
A compromise of the two types is that you can save yourself all that tracing around objects in ArchiCAD and use a rectangular cutout (ie a thin upstanding wall) and apply a texture to it which uses alpha channels. This will look like a rectangle in 3D but look OK in Photorender, and will cast shadows correctly.
In its use (parameters and stretchiness) this is indistinguishable from the Picture object but its better. We need to adapt the Master Script from the Cutout object.
!Billboard Object rectangular Master Script DEFINE TEXTURE 'biltexture' picture_file,
95
The small difference here is that the name of the picture file is now a parameter and the dimensions of the picture are dynamically resized by the A and zzyzx dimensions.
!Billboard Rectangular.gsm !3D Script PEN cont_pen IF shad THEN SHADOW ON ELSE SHADOW OFF MATERIAL bilmat ROTx 90 POLY_ 5, 0,0,1, A,0,1, A,zzyzx,1, 0,zzyzx,1, 0,0,-1 BASE VERT 0,0,0 VERT 0.1,0,0 VERT 0,0.1,0
VERT 0,0,0.1 COOR 258, -1,-2,-3,-4 BODY -1 DEL 1 We are not using a PRISM here. A POLY_ is one simple surface that will not reveal tell-tale edges showing in a render. We are using the texture mapping routine that was used in the previous chapter. Copy and paste! For the 2D Script copy the script from the Picture object in the previous section of this chapter. Thats all!
This is useful mostly for placing trees and plants into ArchiCAD in the floor plan. You can also place elevations of people, cars and trees into sections and elevations, giving the impression of upright billboard objects all you need to do is whiten the background.
96
talents extend to making the billboard object for you including the GDL texture routines!
Find out more at http://www.cigraph-store.com ArchiFacade is an API (Add-on) which uses the cutout method and generates a GDL object for each cutout. It is good at both the requirements, straightening and regularising the bitmap image. Its
Introduction to Object Making with ArchiCAD
By giving ArchiFacade the required height and width of the facade, you will see it perform the Perspective and Distort action quickly and accurately, saving you much time. You can also look at the facade, and if you can get clean images of the entrance and some typical windows and cornice details, you might be able to reconstruct a facade by copying and pasting the bits that you managed to capture even if the rest was obscured with trees! But this is going to be hard labour!
97
This view of West Bridgford Central Avenue near the authors home was done by Bite Design in Nottingham. It uses billboard surfaces for the building elevations, 3D street furniture and a few billboard trees to fill in the spaces.
98
The first rule of making a window/door is that it is made flat on the XY ground plane, with the Origin at the centre of the width of the sill and the zero ground plane being analogous to the external face of the wall, the inside face looking upwards. Doors in their initial state open outwards (downwards) and hinge on the right hand side. This mode can be modified by flipping and mirroring by the user, if your script permits. The second rule is to select the correct Subtype when you saved from ArchiCAD, you found it magically made into a window by clicking an icon. In creative GDL, the way to define an object as a window is to select the Wall Opening subtype. When it is brought back into ArchiCAD and placed in a wall, it will be the right way up and will be able to cut a wallhole. If you set the Subtype correctly, the window will be able to stand upright and cut a hole in the wall.
99
The third rule is that A governs the width and B governs the height. It is possible to override this later, but start this way. If you author a Window/Door from new, you write a WALLHOLE command which determines the wall cutting. If you fail to write a WALLHOLE command, you will get a default hole A wide and B high. It would be good if there were just three rules. Look at the parameters and try to imagine how many more rules there must be!
Door and Windows can present such a variety of choices that they need a multipage visual User Interface.
100
Construct the Wallhole by combining extreme left, right upper and lower dimensions of head and sill pieces.
WALLHOLE 5, AC_HoleSideMaterial, -35.4397-ac_left_oversize, 7.0026-ac_lower_oversize,15, -34.5261+ac_right_oversize,7.0026-ac_lower_oversi ze,15, -34.5261+ac_right_oversize,8.2524+ac_upper_oversi ze,15, -35.4397-ac_left_oversize, 8.2524+ac_upper_oversize,15, -35.4397-ac_left_oversize, 7.0026-ac_lower_oversize,-1
At this point, we had to add in the parameters for the oversizes from the Parameter Table. If you do not want to do this, dont bother with the WALLHOLE and hit the Hide button to the title of the group in the Table. Leave the MUL and ADD commands at the start otherwise the window will not position or stretch correctly. The WALLHOLE is similar to a PRISM statement except that instead of thickness, we past in the parameter for the side material. WALLHOLE is very powerful it can be repeated many times to make complex shapes, or it can be complex in its own outline. It can also be give the ROTx or ROTy treatment to make interesting chamfering effects to the wall. We could have remade this window over the main origin, but here we have accepted the window as it comes, to show that even if you lost the original slab parts, you can still tweak the script. It only causes problems if you want to write a script to drive a hole through the wall. We want to write in a WALLHOLE command as this will allow us to conform to one quality requirement, that of allowing oversize dimensions around the hole. It would have been so-o-o much easier to do this if the window is built symmetrically over the main Origin.
! Name : windo_2_omwac.gsm ! 3D Script PEN gs_frame_pen
Introduction to Object Making with ArchiCAD
!!Glass ADDZ 0.04 cPRISM_ gs_glass_mat, gs_glass_mat, gs_glass_mat, 12, gs_glass_thk, -35.39981876463, 8.160415405712, 15, -35.38268901762, 8.166515355645, 79, -35.2645803879, 8.193436940666, 79, -35.14463324159, 8.210381032486, 79, -35.02368892174, 8.217228780474, 79, -34.90259576587, 8.213932152599, 79, -34.78220315544, 8.200514272335, 79, -34.66335555813, 8.177069256472, 79, -34.60512108129, 8.160415405712, 15,
101
DEL
15, 15, -1
-34.56217141011, 7.047220207262, 15, -34.56217141011, 7.002659943499, 15, -35.43970293569, 7.002659943499, 15, -35.43970293569, 7.047220207262, -1 DEL 1 !!Horizontal Window head cPRISM_ gs_frame_mat, gs_frame_mat, gs_frame_mat, 14, 0.1, -34.56217141011, 8.160415405712, 15, -34.56217141011, 8.252477570844, 15, -35.43970293569, 8.252477570844, 15, -35.43970293569, 8.160415405712, 15, -35.39981876463, 8.160415405712, 15, -35.38268901762, 8.166515355645, 79, -35.2645803879, 8.193436940666, 79, -35.14463324159, 8.210381032486, 79, -35.02368892174, 8.217228780474, 79, -34.90259576587, 8.213932152599, 79, -34.78220315544, 8.200514272335, 79, -34.66335555813, 8.177069256472, 79, -34.60512108129, 8.160415405712, 15, -34.56217141011, 8.160415405712, -1
Sorry about all this script its the usual autoscripted stuff. But its useful to see how the parameters can be inserted and the texture managed. You could try to insert gs_frame_thk for the frame thickness, but you would need to script the 2D and it would get so complicated you might wonder why you didnt make it parametric in the first place.
!!Horizontal Sill cPRISM_ gs_frame_mat, gs_frame_mat, gs_frame_mat, 7, 0.1, -35.43970293569, 7.002659943499, 15, -34.56217141011, 7.002659943499, 15, -34.56217141011, 7.075050087223, 15, -34.60512108129, 7.075050087223, 15, -35.39981876463, 7.075050087223, 15, -35.43970293569, 7.075050087223, 15, -35.43970293569, 7.002659943499, -1 GOSUB 999:!Texture !!Vertical Jambs cPRISM_ gs_frame_mat, gs_frame_mat, gs_frame_mat, 5, 0.1,
Note that we just have to hide the parameters we cannot make use of. If we script parametrically, we could design a window with frame thickness and width, and with sash details and make full use of all the parameters. If we leave them showing but inoperable, your poor user will be confused.
!!Overhanging Sill ADDZ -0.06 cPRISM_ gs_frame_mat, gs_frame_mat, gs_frame_mat, 5, 0.06, -35.43970293569, 7.047220207262, 15,
102
-35.39981876463, 7.075050087223, 15, -35.39981876463, 8.160415405712, 15, -35.43970293569, 8.160415405712, 15, -35.43970293569, 7.075050087223, 15, -35.39981876463, 7.075050087223, -1 cPRISM_ gs_frame_mat, gs_frame_mat, gs_frame_mat, 5, 0.1, -34.56217141011, 7.075050087223, 15, -34.56217141011, 8.160415405712, 15, -34.60512108129, 8.160415405712, 15, -34.60413858807, 7.075050087223, 15, -34.56217141011, 7.075050087223, -1 ROTz 90 GOSUB 999:!Texture DEL 1 DEL TOP END:!======================== 999:!Texture BASE VERT 0,0,0 VERT 1,0,0 VERT 0,1,0 VERT 0,0,1 COOR 258,-1,-2,-3,-4 BODY -1 RETURN
Left, with texture control, right without control. It is a pity that the Open GL implementation in ArchiCAD 8.1 makes the glass disappear or look totally solid.
103
You can see how the Skylight API cuts the roof (left), better than 'vertical' hole cutting (right). If you want to modify the holeshape, build back parts of the roof, using the correct materials and thicknesses. We are going to use a smart little trick here. Skylights are usually wood framed with a metal top and outer surface, and the timber should be visible on the underside and inside edge. We cannot do this with a CPRISM_ or any other GDL statement directly. So we make the frame flat and solid on the floor. Work out the size of the glass, and drive a hole through the frame the same size as the glass. CUTPOLY is a wonderfully useful command similar to a PRISM (if you wish for holes with curved edges, you need CUTPOLYA). CUTPOLY will cut, leaving behind the material you specify so we can state the frame material and get the authentic look!
!Skylight simple, 3D Script PEN gs_cont_pen ROTx ac_roofang
!Glass MATERIAL gs_glass_mat ADDz fdep-gthk PRISM_ 5,gthk, -A/2+fwid,fwid,15, -A/2+fwid,B-fwid*2,15, A/2-fwid,B-fwid*2,15, A/2-fwid,fwid,15, -A/2+fwid,fwid,-1 DEL 1 !Frame MATERIAL gs_frame_mat CUTPOLY 5, -A/2+fwid,fwid, -A/2+fwid,B-fwid*2, A/2-fwid,B-fwid*2, A/2-fwid,fwid, -A/2+fwid,fwid !Actual frame cPRISM_ gs_upper_mat,gs_frame_mat,gs_upper_mat, 5,fdep, -A/2 ,0,15, -A/2 ,B,15, A/2 ,B,15, A/2 ,0,15, -A/2 ,0,-1 CUTEND DEL 1
After a CUTPOLY or other cutting command, we have to terminate the cutting with a CUTEND even if it is at the end of the 3D Script. We have another smart little trick. The data about the roof is conveniently displayed to us in the subtype parameters greyed out in the illustration. We can see the roof angle, thickness, materials. So by laying the window flat on the ground but applying a ROTx ac_roofang, it stands up at the correct angle! Knowing the materials of the roof enables us to build back little bits of roof or flashing detail if we have to modify the opening shape.
104
The 2D script can be done with a PROJECT2, but we cannot avoid some thinking if we want the Hotspots to work. The dimensions of the hole at the slope of the roof are A wide and B high. So as seen vertically in plan, the dimensions will require some simple trigonometry using the roof angle parameter.
!Skylight very simple !2DScript HOTSPOT2 0,0 HOTSPOT2 -A/2,0 HOTSPOT2 A/2,0 HOTSPOT2 -A/2,B*COS(ac_roofang) HOTSPOT2 A/2,B*COS(ac_roofang) HOTSPOT2 0, B*COS(ac_roofang)/2 PROJECT2 3,270,2
The purpose of this LOCK command is that we do not confuse our user. These parameters are not editable they are the equivalent of Global Variables. They are telling us and the Skylight what is going on in the model. We need to lock them so that they change colour to grey and the user isnt confused into thinking that they can edit the roof pitch or materials. We can also set up a dimension for the glass thickness here.
Introduction to Object Making with ArchiCAD
105
For the window sections, walls have the benefit of having a constant width and height, and in some way relate to actual window sections if you are computing the lengths. For the outer window sections, make sure the walls follow the Fill perfectly, touching the edges of the opening. You can flip the wall reference line if you need to. You make a judgement now as to whether the internal mullions and transoms are centred or referenced to the edges. It also pays to set a small grid in this example, I set it to 10mm (0.625). Using the Wall tool, your textures will line up nicely along the frames. Do the glass for the window by applying the Magic wand to the whole fill there is no harm in taking the glass right to the edge. If you have to be pedantic and make each piece of glass separately, then magic wand a dumb piece of Floorslab over the fill, make it Concrete and 300mm thick, Give it an object ID of Wallhole in the settings dialog. When you are in the script later, you will know its not the glass and you can change it to a Hole cutting outline for the wall.
Unmodifed, the window will create a rectangle of A x B. The task is to shape the wall around the window frame. To make the window, you view it in 3D, in Plan, from 270. Save as a Window, editable. Now place into the plan a new wall about 6m (20) high, and place the window. This finished window is 6500x 4271mm and would be used in a 2 storey height wall. When it comes in, it will cut a rectangle of A and B of that size. We can tidy it up somewhat as we did for the table its easier to identify the parts if all the frames are walls and the glass is a slab. Either the glass or that extra slab will act as your cutting outline.
! Name : window_complex2.gsm ! Date : May 2004 ! Version : 8.10 ! Written by ArchiCAD, modified by DNC MULXA/ 6.5 MULYB/4.271227780756 MULZZZYZX/0.08 ADDX 3.25 BODY -1 MODEL SOLID RESOL 36
Introduction to Object Making with ArchiCAD
106
!!First Window Frame PEN gs_frame_pen ADD -6.5, 4, 0 ROTZ 284.0362434679 xWALL_{2} gs_frame_mat, gs_frame_mat, gs_frame_mat, gs_frame_mat, 0.08, 8.61659632663E-016, 2.061552812809, 2.022513992489, 0.03792787368157, -2.154149081658E-016, 3.330669073875E-016, 0.05, 0.05, 0.05, 0, 0, 0, 15, 15, 15, 15, 0, 0 DEL 2
Many sections of window frames appear after this.. but all have been omitted for clarity. You only need to change the materials. You could change the thickness of the frame and the depth if you wish to, but in this situation, you are better advised to get it right in the original plan and only make the materials parametric, and to cut the wallhole. Lets pick up the 3D script near the end...
!!Typical Window frame section up the side elevation ADD -4.055, 3.686666666667, 0 ROTZ 270 xWALL_{2} gs_frame_mat, gs_frame_mat, gs_frame_mat, gs_frame_mat, 0.08, 0.04342585459107, 2.256574145409, 2.289907478742, 0.0767591879244, 7.976936617858E-018, 4.145122554509E-016, 0.05, 0.05, 0.05, 0, 0, 0, 15, 15, 15, 15, 0, 0 DEL 2 BODY -1 !!Window and hole PEN gs_glass_pen ADDZ 0.04 cPRISM_ gs_glass_mat, gs_glass_mat, gs_glass_mat, 24, 0.02, 0, 0, 15, -0.5, 2, 15,
Introduction to Object Making with ArchiCAD
-1.5, -4.5, -4.561310905493, -4.688716060937, -4.820255333372, -4.955258428817, -5.093037402443, -5.232890164181, -5.374104056416, -5.515959485522, -5.657733588747, -5.79870391776, -5.938152120077, -6.075367599624, -6.209651137769, -6.340318456382, -6.46670370476, -6.5, -6, -5, -2, 0,
2, 15, 4, 79, 4.035715090578, 4.098215535982, 4.151467757689, 4.195200394584, 4.229190595175, 4.253265153189, 4.267301390198, 4.271227780756, 4.265024316876, 4.248722609987, 4.222405729853, 4.186207781261, 4.14031322066, 4.084955916211, 4.020417956049, 4, 15, 2, 15, 2, 15, 0, 15, 0, -1
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
The trick here is that you have a prism for the glass that exactly fits the desired window opening point by point. So Copy and Paste a duplicate of it, exactly as done here, and retitle the start of the pasted prism statement with a WALLHOLE statement. Use the AC_Holesidematerial parameter instead of the prism thickness. Have the two commands immediately next to each other.
WALLHOLE 24, AC_Holesidematerial, 0, 0, 15, -0.5, 2, 15, -1.5, 2, 15, -4.5, 4, 79, -4.561310905493, 4.035715090578, -4.688716060937, 4.098215535982, -4.820255333372, 4.151467757689, -4.955258428817, 4.195200394584, -5.093037402443, 4.229190595175, -5.232890164181, 4.253265153189, -5.374104056416, 4.267301390198, -5.515959485522, 4.271227780756, -5.657733588747, 4.265024316876,
107
-5.79870391776, -5.938152120077, -6.075367599624, -6.209651137769, -6.340318456382, -6.46670370476, -6.5, -6, -5, -2, 0, DEL DEL TOP 1
4.248722609987, 4.222405729853, 4.186207781261, 4.14031322066, 4.084955916211, 4.020417956049, 4, 15, 2, 15, 2, 15, 0, 15, 0, -1
This technique does not work on versions of ArchiCAD prior to version 8 wallholes existed, but could not be complex in shape. Complex shapes could only be built up using several wallholes. It is an interesting command you can rotate wallholes to create chamfered reveals. Another idea is that you can oversize the wallhole to leave enough space to insert a lintel, sill or sidelight.
This glass walling solutions is based on the Velfac 200 system. You would then autoscript these in 3D Elevation parallel view with the camera at 90, and save as Object, Editable. You could then add in some parameters for materials. If you are scripting this fully in GDL, you build it upright. You might still make use of macros for the frames and casements, in fact you can use the same ones that work for windows. This prototype window system for Velfac uses objects. The same code, with a ROTx -90, a WALLHOLE, a change of subtype and a few small modifications can also make a conventional wall-cutting Window subtype.
108
Use a new trick with a roof outline to do the same cutting in future versions. Windows are sometimes objects if they are freestanding and not to be placed in a wall.
109
GDL can react according to conditions in the main ArchiCAD model. Objects can know the current drawing scale, default drawing pen numbers and background pens. Doors and Windows can know the thickness and materials of the current Wall. With knowledge of the objects position in 3D space and the location of the current camera, the object knows how far away the camera is, and in which direction. Thus, a billboard object can turn to face the camera; or a complex 3D object can simplify itself if it is too far away to require drawing in detail. This is done when GDL objects read the values of Global Variables, which exist in ArchiCAD. You saw all the GLOB statements in the autoscript in chapter 2. GLOB_SCALE is the current drawing scale. GLOB_NORTH the angle of the current north point. The GDL Cookbook covers all of these topics in greater detail, and provides practical working examples to help you learn.
110
Top, Open GL makes it look smooth, no matter what you set for RESOL. Note that a trick is used to improve the look of the capping rail. By making it slightly longer (by one diameter) than the sum of the distances of the poles, it looks more authentic in the welded joint. We take advantage of Z-buffering here. The Cylinders are actually colliding with the handrail although Open GL and the ArchiCAD 3D drawing engine makes them look as if they are joining smoothly. We can improve the way the loop is coded in two small ways. The first one worked fine, but we had to DEL all the cursor moves after the loop was complete. We also specified the stepping value. This method includes the DEL inside the loop, so that the loop is cleanly self-contained.
FOR k=1 TO 6 ADDX pspac*(k-1) CYLIND 1.0,0.05 DEL 1 NEXT k
111
Now we place the ADDX command before the cylinder. The first time, the value of (k-1) is zero, so if you multiply pspac by zero, the distance added is zero. So it plants the first pole. Then it DELs back to the origin. When k is equal to 2, the distance moved is pspac*1 so it draws the next pole, then returns to the origin. Notice that in the first case, we specified the stepping rate to be 1. If it is 1, you can omit that STEP value, but if it is anything else at all, you must specify the STEP, or GDL will assume a value of 1 which could be misinterpreted as 1.0 metres, or 1.0 degrees!
112
FOR dist=0 TO A STEP pspac ADDx dist CYLIND 1.0,0.05 DEL 1 NEXT dist !Do the rails the same as before
We have here a calculation of the number of bays you would get by dividing pspac into A. The INT() function rounds this down to an integer number. The insertion of 0.5 makes it round up or down. Now you know the number of bays, you can calculate the number of Uprights and the true Bay Spacing pspac. No matter how you stretch it, the uprights will always fit the handrail nicely. This handrail could now be custom manufactured to fit any length.
Loop by Angle
There are many occasions when your object has interesting circle geometry. Here is a similar handrail, but now its enclosing a curved running track. We use the FOR... NEXT loop to distribute the posts at an angular spacing of 15. This brings the opportunity to introduce you to two more GDL commands: ELBOW and TOLER. ELBOW is like a cylinder but it is a cylinder which curves at a defined radius, to a defined sweep angle. ELBOW curve radius, alpha angle, tube radius Because elbows always grow upwards, you have to precede the command with a ROTX -90 and lift it to the height of the top of the posts.
right, and if we have a lot of rails in the project, the tubing will have too many polygons, and the computer could be crippled trying to shade all those surfaces. TOLER 0.005. This command sets the error to 5mm (3/16) If you issue a TOLER dimension command, curvature is controlled in both small and large 3D shapes. TOLER stands for tolerable error so you need to provide a dimension, like a few millimetres, a fraction of an inch, whatever you think is right. As the curve is traced, GDL measures the difference between the curve and a tangent to the curve. So small tubing will have only 6 or 8 faces (which is smoothed by Open GL), and on the large curve it will follow the curve smoothly. It is a very useful command.
Curvature control
We want to control the number of polygons in the model, or the renderer will be too slow if there are too many of these rails. Open GL and Photorendering can smooth curved surfaces so it is not necessary to have a lot of polygons to get smooth effects. RESOL is code for Resolution of Curvature and allows you to define how many polygons you want on a typical curve. RESOL 10 gives 10 polygons to all the cylinders. If you use this for something like the curved handrail, you will get a polygonal not curved rail, so you need something more sophisticated TOLER. Poor old RESOL is too simple for complex objects. In any elbow, we have two curves, the main curve and the tubing curve. If we have a large resolution (we need at least RESOL 36) so that the rail looks
Introduction to Object Making with ArchiCAD
!Circular racecourse rail !Loop by angle TOLER 0.005 crad=3.0 !Curve Radius angl=120 !Sweep angle ovra=360*0.05/(2*PI*crad) !Overhang angle !Uprights FOR ang=0 TO angl STEP 15 ROTz ang ADDx crad CYLIND 1.0,0.05 DEL 2 NEXT ang !Handrail ROTz -ovra ADD crad, 0 , 1.0 ROTx -90 ROTz 180 ELBOW crad, angl+ovra*2, 0.05 DEL 4
113
From the centre, you can run a FOR NEXT loop in which for each iteration you move out the the edge of the circle and draw an upright, and rotate slightly each time before the next upright. By using DEL within the loop, you have a nice tidy loop. For the rail, we start from the centre of the circle and move out to build the uprights and handrail. Rotate the rail slightly using the ROTZ command, move to the first upright with the ADD command, lay the ELBOW over on its side (with a sweep slightly longer than the required sweep angle) and draw the rail. In this case, we had do use a trick to make sure the weld detail would look good at the end posts. We calculate what fraction a single radius of the post would be of the total circumference. That becomes an internal parameter ovra (overhanging angle) and its easy to get a good weld detail by rotating and extending the rail slightly.
This parametric model of the London Millennium Wheel (Marks Barfield, London 2000) allows you to model the wheel as built or in any other configuration you could wish for. All the tubing and spokes and cabins are recalculated using Angle based FOR... NEXT loops. If you want to make the circular rail self managing like the second version of the straight rail or the Millennium Wheel, we would have to divide the circumference by the optimum spacing, then work out the best stepping angle.
114
This steel tube can be stretched and twisted and rotated in 3D You get the changes display visually as you work, both in the object and in a small dialog box above. Graphical hotspots (GHs) can control distance and angle. It seems that most objects can be manipulated successfully with these two. If you can think of another mode of action, put it on the Graphisoft wishlist. You can use GHs in 2D or 3D. The general rule is to use GHs that control X and Y dimensions in the 2D and use the 3D for heights or twisting motions. Another rule is that you should write all the hotspot routines before the bulk of either 2D Script or the 3D Script. This is so that the parameters resulting from the hotspot manipulation are swiftly passed on to the rest of the script. There is not space to cover the topic of GHs fully here, but lets alert you to the possibilities of GHs here and try a simple exercise. You will
Introduction to Object Making with ArchiCAD
115
find GHs very thoroughly covered in the ArchiCAD Help menu and the GDL Cookbook theres a lot more to them than this brief mention permits.
!Straight Handrail - 2D Script HOTSPOT2 0,0 !Base HOTSPOT2 A,0 !Move PROJECT2 3,270,1
Using the hotspots above, you can safely use the ABzzyzx cuboid. Lets try the GHs method instead. The syntax for a graphical hotspot is:
HOTSPOT x,y,z, uniqueID, parameter, code !3D HOTSPOT2 x,y, uniqueID, parameter, code !2D
With GHs in length calculation you nominate the position of the starting Base spot (code=1), the Moving spot (code=2) and a third position, one that defines a Vector of movement (code=3). This can be anywhere behind the Base spot (in a negative direction). Graphical hotspots also require a unique ID number (to support associative dimensioning) and they need to know which parameter you are trying to change. So replace the hotspot routine above with:
!Straight Handrail - 2D Script HOTSPOT2 0,0, 1001, A,1 !Base HOTSPOT2 A,0, 1002, A,2 !Move HOTSPOT2 -1,0, 1003, A,3 !Vector PROJECT2 3,270,1
We will have a brief excursion into this very important technology. SGC makes it possible to improve the 3D quality of solids by addition, subtraction or intersection. You will have to read more advanced books on GDL to cover this further, but lets just improve the wireline view of the straight handrail.
!Straight handrail with improved wireline view RESOL 12 MATERIAL 18: PEN 1 pspac=0.6 !Pole Spacing GROUP 'uprights' !Uprights FOR k=1 TO 6 STEP 1 CYLIND 1.0, 0.05 ADDx pspac NEXT k DEL 6 ENDGROUP GROUP 'rails' !Top rail ADD -0.05,0,1.0
Introduction to Object Making with ArchiCAD
116
ROTy 90 CYLIND 5*(pspac) +0.1,0.05 DEL 2 !Mid rail ADD 0,0,0.6 ROTy 90 CYLIND 5*(pspac),0.03 DEL 2 ENDGROUP handrail=ADDGROUP('uprights','rails') PLACEGROUP handrail
!Clear out the memory KILLGROUP handrail KILLGROUP 'uprights' KILLGROUP 'rails' In this procedure we define two groups, we create a new group with the ADDGROUP statement, and we then place it with a PLACEGROUP statement. KILLGROUP clears out the memory and allows us to use those group names again its only really needed if this is part of a much longer script. The most important use of SGC is in subtraction, for example when you want to subtract a curved 3D shape from a another solid something that you cannot do at all without SGC.
The earlier chair on the right looks messy at the joints. SGC cleans it all up! Even subcomponents are tidied up, such as the junction of the braces relative to each other. We cannot get rid of the pen lines on the cone-ends except by using a REVOLVE instead of a CONE.
!Chair 3D Script - With Solid Geometry !to improve the look of the joints PEN cont_pen TOLER 0.001 GROUP 'legs' GOSUB 100:!All the legs ENDGROUP GROUP 'seat' GOSUB 200:!Seat and upholstery ENDGROUP GROUP 'back' GOSUB 300:!Back ENDGROUP GROUP 'braces' GOSUB 400:!Braces ENDGROUP
Here you can see the finished object near to. Behind you see the spheres which have been subtracted from the cylinder.
Introduction to Object Making with ArchiCAD
117
GROUP 'arms' GOSUB 500:!Arms ENDGROUP chair=ADDGROUP('legs','seat') chair=ADDGROUP( chair,'back') chair=ADDGROUP( chair,'braces') chair=ADDGROUP( chair,'arms') PLACEGROUP chair KILLGROUP chair END:!____________________________
In the earlier chair script we had a number of IF statements in the executive script, like IF bakon THEN and IF arms THEN. Move all these statements to the subroutines, to keep the executive script clean. Notice how the chair value can be successively added to, line by line.
Defining style is done in the form of the script here. The 1,0 mean that it is to be left-justified and normal (i.e. not bold or italic). See the Help Menu or GDL Cookbook for a more extended discussion of defining style. You must also SET STYLE before the text will recognise it. The TEXT2 statement includes the XY position of the text (just below the left chair leg) and the string. A normal string is in quotes, or in this case is a parameter from the ValueList.
118
Using trigonometry to calculate the pathway of tubes and edges through curved and parabolic pathways. Complex tubular lattice structures. Making curvy skin-based surfaces using COONS or MASS. Circle, parabolic, elliptical, catenary, sinwave curve maths. Reading and displaying the system date, time, project name, and much more, using the REQUEST command. Defining your own materials, line types and fill patterns. Defining your own textures, and orienting them for greater authenticity, e.g. in Wood models. Defining your own Line and Fill types, for better 2D. Defining your own Text styles, including autosizing, setting styles and text positions for self labelling objects. Storing numbers in memory and bringing them out later (Arrays and PUT & GET). Solid Geometry Commands, in which parts of the model combine or cut each other. Graphical hotspots allowing full manipulation of objects, including pulling/pushing, and twisting/rotation. Parameter arrays and dynamic arrays. Building a Graphical User Interface that replaces the normal parameter box and makes the GDL object look more professional. Setting up animation possibilities by changing the objects shape or position according to the frame number in the animation. Knowing where the camera is, and changing accordingly. Knowing which storey the object is on. Reading and writing text based datafiles. Making use of the Special menu. Rich Text in 2D and 3D.
119
First thing is.... Dont Panic!! Its not as difficult as you expect once you are into it, and when you get an error message, read the message, look at the script; have you spelt the parameters right? Are your commas in the right place? Try excluding part of the script to see if other parts work. GDL has few bugs; for beginner level GDL there are none to speak of; so its a relief to know that the error will be found through hard logical thinking. Second thing is.... Always have pen and paper handy If you cant draw it on paper, you cant write it in GDL. Drawing it out on paper will put your mind at ease to concentrate on the logical process of actually building it. For many commands such as prisms and revolves, half the job is done if you have drawn it out, preferably marking the origin and numbering each point along the profile. Third thing is.... Think in parameters Always try to work (and think) in parameters not in numbers its easy to develop your own lingo of 'wid', 'dep', 'len', 'hit' and 'thik', and easier to write in these terms knowing that a simple change in the parameter value will modify your object easily. Fourth thing is... Steal from ArchiCAD Some objects are so complex that the parametric method above is harder than beating your head against the wall. You may be better sketching them out in the ArchiCAD floorplan and then dragging them and dropping into the script. You may have to settle for making them parametric only by stretching and mirroring. Fifth thing is.... Structured GDL is best The moment it gets more complicated than one page full of script, convert the script to subroutines, so that each part of the model is a tiny object in its own right. This also saves on repetitive typing, and makes it easy to isolate errors.
120
INDEX
2D Full View 41 2D Hotspots 49 2D Script 41 2D Symbol 23, 25, 29, 41, 77 2D symbol 22, 48 3D 110 ~ View 43 3D Cafe 11 3D Cursor 43 3D Cutaway 17 3D projection setting 23 3D Projection Settings 17, 20 3D projection settings 29 3D Script 41 3D script 70 3D View 41 3DS 11 3NF 12 ArchiPaint 89 ArchiRadar 11 ArchiTerra 8 Architerra 89 Arkiklub 11 Artlantis 89, 98 AutoCAD 11, 15 Autoscripted 8, 25 Autoscripted GDL 69 Autoscripting 17 autoscripting 99 Comma 64 Comment 41, 44, 58 CONE 42, 45, 50 Convert Mesh to Roof 31 Convert Roof to Mesh 35 COONS 119 COOR 85 Coordinates palette 17, 20, 25, 43 counterclockwise 61 CPRISM_ 60, 62, 69, 71 cPRISM_ 100 CSLAB_ 69, 77 curtain walling 108 Curvature 113 curvature control 79 CUTFORM 119 Cutout 89, 95 CUTPLANE 63, 119 CUTPOLY 104, 119 CUTPOLYA 104 CYLIND 42, 50
A
Abvent 97 AC_Holesidematerial 107 ADD 43 ADD2 43 ADDGROUP 117, 118 Add-on 97 Add-ons 11, 12, 17, 31, 35, 39, 80, 89 Adobe Photoshop 93 ADT 15 Align Texture 24, 91 Align texture 17 Alpha channel 89, 90, 95 animation 119 ARC2 50, 67, 120 ArchiCAD 9 10, 50, 108, 118, 120 ArchiCAD Library 11, 12, 18, 19, 38 ArchiCAD library 26, 34, 83 ArchiCAD Reference Guide 7, 16 ArchiCAD University 90 ArchiCAD-Talk 90 ArchiFacade 89, 97 ArchiFM 50, 73 ArchiForma 26, 32 Archiforma 12
Introduction to Object Making with ArchiCAD
banana truss 26, 27, 34 BASIC 15, 110 Basic Shapes 39 Basic Shapes library 34 bathroom fittings 18 BEAM 69 Billboard Objects 31, 89 Binary 12, 27, 30, 34, 88 binary 31 Bite Design 98 BLOCK 42, 45, 50 BODY -1 71, 85, 100 Boolean 52, 55, 77, 95 Bounding Box 29 bounding box 30, 70 BPRISM_ 60, 62, 66
D
David Sutherland 40 Default Translator 18 DEFINE MATERIAL 96 DEFINE TEXTURE 95 Defining Text 118 DEL 43 DEL TOP 44 Design Workshop 11 Dimensions 42 Display Options 22 Display Order 96 DNA 56 DO... WHILE 114 Door 13, 31 door 22 Doors 99 DXF/DWG 11, 16, 18, 80
C
CADCAM 14 CALL 69, 83 Carpet 89, 94 Chair 22, 45 Check Script 43 Chesspieces 79 Chris Jones 36 Cigraph 11, 97 CIRCLE2 48, 69 Clean Wall Intersections 22 CNC 56 Column tool 19
121
Index
Eiffel Tower 19 ELBOW 50, 113 Elbow 26 END 81, 82, 100 ENDGROUP 117 Eureka Tower 8, 40 explode 13 EXTRUDE 62, 78
grid 106 Grid Snap 20 Grids 17 groin vault 28 GROUP 116 GUID 9
F
Fender Katsilides 40 Figure 90, 96 FILL 120 Fill tool 24, 62, 77 Find and Replace 63, 76 flow control 82 Flywheel 33 FOR... NEXT Loop 111 FPRISM_ 60, 63 FRAGMENT2 41, 119
Help Menu 7, 16, 119 HIDEPARAMETER 59 Hoshino 11 HOTARC2 50, 120 HOTLINE2 50, 120 HOTSPOT2 69 Hotspots 49, 72 HPRISM_ 60, 63 hyperbolic saddle 35, 36
Line tool 24 line weight 18 LINE2 48, 50, 69, 72, 94, 120 loaded library 27 LOCK 59 Log setting 23 London 30, 114 London Millennium Wheel 114 Loops 110 Lovell Radio Telescope 36
M
M.A.D. 11 Macro 87 Macros 83 Magic Wand 17, 22, 24, 25, 35 Magic wand 15, 28, 93, 106 magic wand 19 Manufacturers Rules 48 Marks Barfield 114 Marquee 15, 17, 28, 39 masking code 61 Masking codes 79 MASS 69, 119 Master Script 41, 52, 54, 56, 66, 75, 81 MATERIAL 42 Material 44, 90 Materials 73 materials 13 Matthew Lohden 90 Melbourne 40 Mesh tool 12, 35 Missing objects 27 MODEL SOLID 71 Module 13, 38, 39 MUL 43 MultiObject 56, 83 MULX 70 MULY 70 MULZ 70
G
GDL Adaptor 11 GDL adaptor 15 GDL Alliance 11 GDL Central 11 GDL Cookbook 7, 59, 85, 95, 110, 119 GDL Dialog 40, 58 GDL dialog 99 GDL Reference Manual 7, 16, 64, 71, 119 GDL Toolbox 12, 26, 32 Geometric Description Language 13 GLOB 100 GLOB_ID 72 GLOB_NORTH 110 GLOB_SCALE 110 Global Variables 71, 105, 110 Golden Rules 82 Goodies 32, 34 Google 11, 19 GOSUB 81 Graphical Editing Hotspots 50 Graphical Hotspots 10, 110, 115, 120 Graphical hotspots 119 Graphisoft 9, 11, 15
Ice figures 92, 98 IF... ENDIF 53 IFC 9, 99 IF-Statement 52 Industry Foundation Classes 9, 99 Instant GDL 61, 62, 77 Internet 11, 13 internet 58 Investment Object 14
16
J
Jodrell Bank 36
L
label 82 Lamp 13 Lara Croft 31 Las Vegas 70 Le Corbusier 7 Libraries 8 Library Manager 38 Lightworks 10, 89
N
Naming 120 naming 38 Norwegian window 84 Nottingham 98
Introduction to Object Making with ArchiCAD
122
Index
O
Object Genome 56 Object Genome Project 52 Object Making 7 Objects On Line 11 Open GL 10, 31, 85, 89, 91, 92, 95, 111 Options menu 85, 90 Orcutt Winslow 14 Origin 18, 19, 24, 42, 43, 45, 69, 75, 91, 99, 101
80
Programming 110 Project Framework 16 PROJECT2 41, 44, 48, 67, 70, 72, 76, 79, 116 Property Script 41 PUT & GET 119 PYRAMID 78
119
R
racecourse rail 113 rapid prototyping 14 ray-tracing 10 RECT2 48 reflection 10 Rendering 10, 72 REPEAT... UNTIL 114 REQUEST 118, 119 RESOL 45, 51, 71, 80, 111, 113 Resolution of Curvature 45 RETURN 75, 82 REVOLVE 62, 78, 79, 110, 117 Rhino 11 Rich Text 118, 120 RICHTEXT 118 RICHTEXT2 118 Robert Luck 30 Roof tool 12, 17, 36 Roof Truss 23 RoofMaker 8, 12 Roofmaker 35 ROT2 43 RPC 89 RULED 78
P
PARAGRAPH 118 Parameter arrays 119 parameter naming 47 Parameter Script 41, 54 Parameter Table 40, 46, 47, 52, 58, 65, 76 PARAMETERS 52, 58, 59, 67, 75, 84 Parameters button 41 Parametric 72 parametric 8, 15, 32, 46, 64 PEN 42, 100 Pen 73 People 89 people 96 People and More 11 Pet Palette 17 Pet palette 19 PhotoCAD 97 Photorender 95 Photoshop 89, 90, 93, 98 PICTURE 93 Picture 89 picturereality 89 Piranesi 89, 98 PLACEGROUP 117, 118 POLY_ 96 POLY2 50, 72, 120 POLY2_B{2} 69, 77, 78 Polylines 78 Popdown Menus 54 Popdown menus 50, 58 popdown menus 52 Preview Picture 23, 39, 41, 58 primitive forms 14 PRISM 50 Prism syntax 62 Profiler 8, 12, 14, 17, 29, 31, 32, 33, 36, 39, 78,
Introduction to Object Making with ArchiCAD
Solid Operations 39 spaghetti 44, 82 SPHERE 42 SPLINE2A 69 SPRISM_ 60, 63 StairMaker 8 status codes 77 STEP 112 Stretchiness 17, 47, 70 students 39 Studio Arkada 11 STYLE 118 STYLE{2} 118 Subroutine 75 subroutine 100 Subroutines 56, 81, 83 Subtype 10, 13, 41, 99, 103 Subtypes 9, 50, 73, 99 SWEEP 62, 78
T
Table 19 template 73 TEXT2 69, 118 TEXTBLOCK 118 Textures 39, 85 textures 14, 21 Theometrics 11 TOLER 51, 80, 113 Tools menu 33 Tools palette 8, 12, 13, 14, 15, 17, 20, 38 transparency 96 trees 89, 96 trigonometry 119 Trim to Roof 36 True Line Weight 49 Trussmaker 12, 14, 17, 25, 26, 32, 35, 36, 39, 80 TUBE 62, 71, 80, 110 typographical discipline 44
Schedules 38, 73 Section/Elevation 21, 23 SEO 33, 34, 37 SET STYLE 118 Settings dialog 17, 96 SGC 10, 88, 116 Shadows 95 Silicon Graphics 10 Sketchup 11, 31 Skylights 103 Slab tool 12, 19, 21, 22, 24, 60, 90 Solid Element Operations 10, 17, 32, 33, 34, 37
U
Urban modelling 30 User Interface 59, 100, 119 User Interface Script 41 User Interface script 84
123
Index
ValueList 54, 82, 118 ValueLists 52, 59 VALUES 54 Velfac 108 VERT 85
Wall tool 12, 22, 28, 35, 106 WALLHOLE 83, 101, 107 Wallhole 106 wallhole 22, 99 Webscape 52 West Bridgford 98 WHILE condition DO 114 Window 13, 20, 31 window 84 Windows 12, 99
X
XWALL 77 XWALL_{2} 69
124