We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-03-25 01:32 PM
Good day all,
It has occurred to me that being able to combine 2D symbols has a ton of useful applications, right now I have a set of 2D symbols for various sizes of bike rack from a manufacturer, I would like to create a single object with an option set that will allow me to change the symbol on the fly.
Similar to the 2D car or tree object included in the inbuilt libraries.
I have nosed about the car object and can see the general idea for how it is achieved but I am hoping there might be a way to do it that won't require me to get that deep into GDL just yet.
If not, a starting point will be much appreciated, maybe it is time....
Many thanks!
Solved! Go to Solution.
2022-03-26 06:29 AM - last edited on 2022-03-27 03:43 AM by Laszlo Nagy
There are two simple ways you can do this with super basic GDL.
1. Place your 2d linework onto a separate layer in the 2D Symbol window. Have a parameter with different options (Refer the steps 1&2 in @Jeff Griffin link). Then a simple if statement for each option to call a FRAGMENT2 for the relevant 2D symbol layer. Something along these lines in your master code:
IF Plan_Symbol_Det = "Bikerack" THEN FRAGMENT2 1,0 !Shows only 2D Symbol Layer 1
IF Plan_Symbol_Det = "Tree" THEN FRAGMENT2 2,0 !Shows only 2D Symbol Layer 2
Refer: https://gdl.graphisoft.com/reference-guide/binary-2d
Get's a bit messy when you want to edit the linework of a symbol, but it's easy to do.
2. (As @SenecaDesignLLC suggested) Create an object for each 2D symbol (use the Save as Object.. function). Make each of these objects un-placeable. Have a parameter with the different options (Refer the steps 1&2 in @Jeff Griffin link). Then a simple if statement for each option to perform a CALL function to the name of each object. Something along these lines in your master code:
IF Plan_Symbol_Det = "Bikerack" THEN CALL "Bikerack_Symbol" PARAMETERS ALL
IF Plan_Symbol_Det = "Tree" THEN CALL "Tree_Symbol" PARAMETERS ALL
Refer:https://gdl.graphisoft.com/reference-guide/macro-objects
This option is more difficult to modify the linework of each symbol as Archicad will convert all your linework into hundreds of lines of GDL when you use (Save as Object.. function), but keeps symbol better organised.
Tip - when you draw your symbol linework, do it at 0,0 origin.
Cheers,
Scott
2022-03-25 02:25 PM
The gdl for something like this is super simple.
You need values for a parameter to specify which object you want, then in 2d if parameter equals the given name call the object
2022-03-25 03:18 PM
Super simple is encouraging,..
2022-03-25 11:57 PM - edited 2022-03-26 12:00 AM
Hi Nicholas,
I bookmarked this page awhile ago, but haven't gotten around to trying it yet. I hope it helps! All credit goes to Patrick May!
https://sites.google.com/site/noscriptgdl/some-scripting-required/creating-multiple-2d-3d-views
2022-03-26 06:29 AM - last edited on 2022-03-27 03:43 AM by Laszlo Nagy
There are two simple ways you can do this with super basic GDL.
1. Place your 2d linework onto a separate layer in the 2D Symbol window. Have a parameter with different options (Refer the steps 1&2 in @Jeff Griffin link). Then a simple if statement for each option to call a FRAGMENT2 for the relevant 2D symbol layer. Something along these lines in your master code:
IF Plan_Symbol_Det = "Bikerack" THEN FRAGMENT2 1,0 !Shows only 2D Symbol Layer 1
IF Plan_Symbol_Det = "Tree" THEN FRAGMENT2 2,0 !Shows only 2D Symbol Layer 2
Refer: https://gdl.graphisoft.com/reference-guide/binary-2d
Get's a bit messy when you want to edit the linework of a symbol, but it's easy to do.
2. (As @SenecaDesignLLC suggested) Create an object for each 2D symbol (use the Save as Object.. function). Make each of these objects un-placeable. Have a parameter with the different options (Refer the steps 1&2 in @Jeff Griffin link). Then a simple if statement for each option to perform a CALL function to the name of each object. Something along these lines in your master code:
IF Plan_Symbol_Det = "Bikerack" THEN CALL "Bikerack_Symbol" PARAMETERS ALL
IF Plan_Symbol_Det = "Tree" THEN CALL "Tree_Symbol" PARAMETERS ALL
Refer:https://gdl.graphisoft.com/reference-guide/macro-objects
This option is more difficult to modify the linework of each symbol as Archicad will convert all your linework into hundreds of lines of GDL when you use (Save as Object.. function), but keeps symbol better organised.
Tip - when you draw your symbol linework, do it at 0,0 origin.
Cheers,
Scott
2022-03-26 01:21 PM - edited 2022-03-26 01:24 PM
I think this should be:
IF Plan_Symbol_Det = "Tree" THEN FRAGMENT2 2,0 !Shows only 2D Symbol Layer 2
From the GDL Reference Guide:
FRAGMENT2 fragment_index, use_current_attributes_flag
David
2022-03-27 03:44 AM
I noticed that, too.
I have now corrected the script in scottjm's post.
2022-03-27 04:34 AM
Whoops my bad. Was a bit too quick with my copy/paste. Thanks for fixing that @Laszlo Nagy .
Cheers,
Scott
2022-04-11 05:11 PM
Awesome Scott !
thanks for this I will give it a try.
2022-04-11 05:12 PM
Many thanks! this was just the sort of thing I was after.