Choose your top Archicad wishes!

Read more
GDL
About building parametric objects with GDL.
SOLVED!

label object placement

Bawar Tanay
Enthusiast

Hi There,

 

i am working on automatic labels using custom picture method (gs_picture)

just wondering i cant figure out how the automatic / and non automatic placement is done.

 

i can give the label a fixed place, for example the object which has to be labeled is section / elevation 1500 x 1200 mm

i want the center label to be the center of the object.

 

i already requested the zzyzx en a parameter using:

 
rrr = REQUEST ("ASSOCLP_PARVALUE", "ZZYZX",

rrr = REQUEST ("ASSOCLP_PARVALUE", "A",
 
and for the placement i used this code
 
if gs_picture_name <> "" then
add2 -a/2, -zzyzx/2
picture2 gs_picture_name, AW, AH, 1
endif
 
can someone help me thanks a lot.
Archicad 16 - 26
Laptop: Alienware M18 R1 | windows 11 pro | i9-13900HX | RTX 4070 8 GB | 32 GB RAM
PC office 1: windows 11 pro | I7-10700 | RTX 2060 6 GB | 32 GB RAM
PC office 2: windows 11 pro | i7-12700 | RTX A2000 6GB | 32 GB RAM
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Jochen Suehlo
Advisor

Try the label set to zero routine. Just an idea, I do not know if it helps in your case:

add2 LABEL_POSITION[2][1] + LABEL_POSITION[3][1], LABEL_POSITION[2][2] + LABEL_POSITION[3][2]		
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

View solution in original post

3 REPLIES 3
Solution
Jochen Suehlo
Advisor

Try the label set to zero routine. Just an idea, I do not know if it helps in your case:

add2 LABEL_POSITION[2][1] + LABEL_POSITION[3][1], LABEL_POSITION[2][2] + LABEL_POSITION[3][2]		
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Bawar Tanay
Enthusiast
i was just trying something out with add2 values.
 
add2 LABEL_POSITION[2][1] + LABEL_POSITION[3][1], LABEL_POSITION[2][2] + LABEL_POSITION[3][2]  
add2 -ArtWidth/2, -ArtHeight/2
 
above worked for me,
 
@Jochen Suehlo  thanks a lot, i saw label position in the gdl reference guide, but could not figure how it works.
what does those numbers between brackets mean? is it somewhere in the GUID explained?
Archicad 16 - 26
Laptop: Alienware M18 R1 | windows 11 pro | i9-13900HX | RTX 4070 8 GB | 32 GB RAM
PC office 1: windows 11 pro | I7-10700 | RTX 2060 6 GB | 32 GB RAM
PC office 2: windows 11 pro | i7-12700 | RTX A2000 6GB | 32 GB RAM
Jochen Suehlo
Advisor

The values in the brackets are the Array-Values, because this Global Variable is an Array Variable.
The 2nd Value is either 1 or 2 for the x and y position
The 1st Values define the position of the label pointer, the starting point of the pointer (I think) and the starting point of the label.

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

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!