License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

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
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11