License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

2D GDL-object with top/front/side view option

Anonymous
Not applicable
Hello ArchiCAD friends!

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!

1.png
8 REPLIES 8
Set a parameter:

"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,0
if view_select=2 then fragment2 2,0
if view_select=3 then fragment2 3,0
You have to have the content of the view 1 on the "1" layer in the 2d symbol and so on.
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
Anonymous
Not applicable
Dziekuje za odpowiedz, Piotr!

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!
David Maudlin
Rockstar
Joeyjojo wrote:
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?
For this parameter as Piotr described it, the "Typ" (Type) should be changed from Length to Integer so it accepts only integer numbers.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
i made a mistake (last 2 has to be 3) the below is good:
 values{2} "view_select"    1, "View 1", 2, "View 2", 3, "View 3"
here is the example object for You the 1,2,3 digits in the 2d symbol chenge to your real content

Best Regards,
Piotr
Anonymous
Not applicable
Wow guys, I think it worked!

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 Pozdrowienia z Berlina, mam nadzieje, ze u Was pogoda ladniejsza!
Bildschirmfoto 2017-01-19 um 09.40.27.png
Anonymous
Not applicable
It worked!!! Thank you Piotr and David, you made me a true hacker. Now I'm going to impress the whole office
Contrgarts, Welcome to the club

Best Regards,
Piotr
Ernest Atanasiu
Advisor

Thanks Piotr ! Really useful !

arch. ernest atanasiu
AC 10-26 INT/GER/FR on Win 10/ Win 11