cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The 2025 Technology Preview Program is now live. Join today!

GDL
About building parametric objects with GDL.

macro parameters

silvermat
Participant

Hello,

It's my first time, when I try using macros and don't understand it workflow.
I created label as macro and wanted to add it to my host object as several instances

 

label is simple:
generate text with ID and hotspots which determinate localization of label.

 

When I try to call it in host, it generate error "ID_X is not propper parameter name.


 

! Styl czcionki
define style{2} font_style Arial, gs_font_size*5, 1 
style font_style 

! Unikalny paragraf dla ID
ID_paragraph = ID + "_paragraph" 

! Pozycjonowanie tekstu
add2 ID_X, ID_Y
    mul2 1 - 2 * SYMB_MIRRORED, 1
        rot2 -SYMB_ROTANGLE * (SYMB_ROTANGLE <> 0)
        paragraph ID_paragraph 1, 0, 
            0, 0, 1 
            pen font_pen 
            style font_style 
            ID 
        endparagraph
        textblock 'ID_textblock' 0, anchor, 0, 1, 1, 0, 
            ID_paragraph 
        richtext2 0, 0, 'ID_textblock' 
del 3

!----------------------------------------
! Hotspoty do zmiany lokalizacji
!----------------------------------------
hsid = 1
! MACRO LABEL
! Hotspoty w poziomie
hotspot2 0, ID_Y, hsid, ID_X, 1 + 128, ID_X: hsid = hsid + 1
hotspot2 ID_X, ID_Y, hsid, ID_X, 2, ID_X: hsid = hsid + 1
hotspot2 -1, ID_Y, hsid, ID_X, 3, ID_X: hsid = hsid + 1

! Hotspoty w pionie
hotspot2 ID_X, 0, hsid, ID_Y, 1 + 128, ID_Y: hsid = hsid + 1
hotspot2 ID_X, ID_Y, hsid, ID_Y, 2, ID_Y: hsid = hsid + 1
hotspot2 ID_X, -1, hsid, ID_Y, 3, ID_Y: hsid = hsid + 1

 

parameters in editor:
ID, ID_X, ID_Y, gs_font_size, font_pen, anchor, font_style

 

!Host code
!...
call "JA_Etykieta_ID" parameters all,
				ID_X = ID_X_chair,
				ID_Y = ID_Y_chair,
				ID = _chair_ID,
				anchor = 5
!... rest of code

 

in parameters i have ID_X_chair, ID_Y_chair, _chair_ID and others

Why it is not working? 😞

3 REPLIES 3
Jochen Suehlo
Moderator

You should have the same Parameters in the caller as in the macro. E.g. if you add ID_X and ID_Y as Parameters in the caller, the you will not have this error message, even if you do not use this parameters.

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

 

I want to use that label multiple times in some objects, E.g. in sink object I add mirror, bin, soap etc.
Every item has their own ID label with own coords. I don't want create in macro 5 times parameters with coords named "ID_X_mirror", "ID_X_soap" etc.
because I use that label in desk object where I dont have mirror, soap and so on but chair, box, pc etc.

second fact is that when I create different hotspots in label with different coords, then it all move same label even if I place it in different location when I move label 1 it move label 2 with one hotspot.

silvermat_1-1758176704900.png silvermat_2-1758177355828.png

 

 

 

 

It would only need to be ID_X and ID_Y that would be added to the host object, that is overrided with the desired value when you call the macro.

 

Ling.

AC22-28 AUS 3110Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | R5 2600 | 16GB | GTX1660