2D GDL-object with top/front/side view option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-17
05:57 PM
- last edited on
‎2023-05-24
11:37 AM
by
Rubia Torres
I need your help with some GDL-scripting. My task is to prepare a library with all objects that we use in the office- we work exclusively in 2D and the idea is to create loads of 2D objects with three views (top, front and side), exactly like the 2D car drawings in the ArchiCAD Library.
I found some threads (more or less) explaining the process- I need to have all three views in 2D Symbol window, on different object-layers, then use FRAGMENT2 command. I looked into existing 2D objects that have top/front/side view option and tried copying the script, but nothing worked so far. I've never learned coding before and I thought I could just figure out the part that I need without diving in too deep... noooooope. Is there an easy way to fix it or some universal script I could use?
I'll attach a screenshot of the parameters of my object. The script is untouched, because when I change it, it just messes up the whole thing. I added the front view to 2D Symbol.
I work in ArchiCAD 19, full German version.
iOS X El Capitan 10.11.3
iMac (Retina 5K, 27 Zoll, Ende 2015)
4 GHz Intel Core i7
16 GB 1867 MHz DDR3
AMD Radeon R9 M395X 4096 MB
This is the first time I post on the forum, because for years you guys were helping me fix any problem I had. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-18 06:04 AM
"view_select" and make it integer
You will have 3 options o f it
than:
in the parameter script use the command:
values{2} "view_select" 1, "View 1", 2, "View 2", 2, "View 3"(You can customize the "" sections with the friendly names of Your views)
than in the 2D script
You have to put 3 conditional jumps:
if view_select=1 then fragment2 1,0You have to have the content of the view 1 on the "1" layer in the 2d symbol and so on.
if view_select=2 then fragment2 2,0
if view_select=3 then fragment2 3,0
the the second "0" in the commands makes the showing content as drawn in the 2d symbol - you can also have there "1" but in this case You would have to define the attributes in the script (pen/line type/ fill type)
But when saving the object from the 2d You have the script generated in the object so You would need to deal with the scripts and would be more complex to, so for the starters just paste the 2d You need to the 2d symbol rather than save the object from plan.
Best Regards,
Piotr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-18 11:43 AM

I'll stick to english, so someone else can find an answer to this question one day.
Thank you for the answer and for all the instructions, but I'm going to need some extra tips, as I'm new to this area of ArchiCAD.
1. I create a new parameter in the Parameter window and name it view_select in the 'Variable' cell, right? Then I put a number in the 'Wert' cell, for example 1? Or 3?
2. When using the commands in the script windows, do I just copy what you posted, or do I need to add some magic words like 'end' or '!'? Should I paste the commands somewhere specific (at the beginning/end of the text in the script window)?
A step-by-step instruction would be very very helpful, thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-18 01:50 PM
Joeyjojo wrote:For this parameter as Piotr described it, the "Typ" (Type) should be changed from Length to Integer so it accepts only integer numbers.
1. I create a new parameter in the Parameter window and name it view_select in the 'Variable' cell, right? Then I put a number in the 'Wert' cell, for example 1? Or 3?
David
www.davidmaudlin.com
Digital Architecture
AC28 USA • Mac mini M4 Pro OSX15 | 64 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-18 06:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-19 10:27 AM
The GDL-script is ok, no errors; another problem occurred though: the library doesn't let me change the views, of any object with multiple views (be it my object, Piotr's or even the original ArchiCAD car 2d object!). I'll try to open them at home with my student version, but it's all very very strange...
Piotr, thank you so much for building an object for me! It helped so much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-19 07:51 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-01-19 11:20 PM

Best Regards,
Piotr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2022-03-25 02:55 PM
Thanks Piotr ! Really useful !
AC 10-26 INT/GER/FR on Win 10/ Win 11