GDL
About building parametric objects with GDL.

Label in mirrored hotlink

rav668
Participant
Hello,
I would like to ask if there is a function in gdl to check if hotlink in which the object is located has been mirrored. To be more specific I am using wall labels in modules. Without this function, hotlinks are almost useless.
Best regards,
Rafał.
14 REPLIES 14

Hi all, I cant remember exactly how I got it to work and I don't have time to look into it right now but I will play around with it later this week. From memory I used the the wall_direction parameter in conjunction with symb_mirrored.

Sorry @Bruce I didn't see your question earlier, I must have missed the notification some how. I will get a solution for you ASAP as I know I did get it working.

Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

I used a user-set parameter (hotlink_use) combined with the WALL_FLIPPED AC parameter to get the label to behave correctly:

 

flip = 1
IF hotlink_use & WALL_FLIPPED THEN flip = NOT(flip) 

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

Bruce, could you post that fixed label? I can't understand how that fits into the script, and I don't know whether it is missing lines that should be obvious to anybody but me, or just different parameter or variable names in your label (I would try to fix a USA library label).

 

 I will try to post more info when I have some more time...

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

So, as stated earlier, what you need to do is add a boolean parameter that the user sets.  I have called this "hotlink_use" with the description of "Flip in mirrored hotlink".  Default OFF.

 

With a wall label, you also will probably have a parameter already where the user can choose which side of the wall the label appears.  In my part, this is a length parameter is called "flipmark1" (forgive the naming...I inherited the part), and can have a positive or negative value (a hard-coded distance for the label).

 

In the 2D script, I have a flag variable to use in my ADD2 statements depending on whether the label should be flipped or not.  This is named 'flip'.  I then run a series of tests to offset the label to the correct side of the wall.

 

In the below sample script, "hdepth" is the offset Y coordinate of the label.

 

 

flip = (flipmark1 >= 0)  ! Set flip to 1 or 0

IF hotlink_use & WALL_FLIPPED THEN
   flip = NOT(flip) ! Adjust for mirrored hotlinks (selected by user)
ENDIF

flip = flip-1*NOT(flip)  ! change 0 and 1 to -1 or 1

 

hdepth = A*(GLOB_SCALE/100) * flip

 

ADD2 0, hdepth

 

There will be more to your script, but this is the fundamentals of the transformations I've used.  I hope this has helped.Current.jpgNew.jpg

 

 

Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!