Choose your top Archicad wishes!

Read more
GDL
About building parametric objects with GDL.

Mirror objects boolean in GDL

Anonymous
Not applicable
Hi all,

I'm relatively new in GDL and creating scripts.
I was looking for how to create a mirror parameter in existing AC library parts through GDL scripting, so the object can be mirrored with a simple click, rather than mirror the geometry manually (for instance, a sink but with the door turning the other way).
I came across commands and variables like MULX, SYMB_MIRRORED, but I can't really put together how to create a checkbox parameter to mirror the object.

Is there a simple GDL script for this?

Thanks!
1 REPLY 1
Barry Kelly
Moderator
jeronimoHill wrote:
I was looking for how to create a mirror parameter in existing AC library parts through GDL scripting, so the object can be mirrored with a simple click, rather than mirror the geometry manually (for instance, a sink but with the door turning the other way).

All objects already have a 'mirror' option - one click and the entire object is mirrored.
This sets the SYMB_MIRRORED value.
No need to do anything in GDL.

If you want to mirror the sink but not the door in a single object, then yes, you need to use MUL commands flip the part of the object in the direction you want (both 2D and 3D scripts).
Create a boolean parameter 'flip_sink'.

2D script...
IF flip_sink = 1 then
MUL2 -1,1
sink script here
DEL 1
ENDIF
3D script...
IF flip_sink = 1 then
MULx -1
sink script here
DEL 1
ENDIF

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11