We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Substitute Object Given X = 1

Lingwisyer
Guru

Hi all,

 

I was wonder how you would go about scripting an object substitution. Given a parameter in Object A, I want to replace it with Object B. I tried adding a CALL for Object B and script skip to the start of each of the scripts within Object A but that does not seem to have worked...

 

As a last resort I figured I could always extract the entire Object A into a new object with Object A would then call though I would rather not add more objects. IF X = Y then CALL "Object A" else CALL "Object B"

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
2 REPLIES 2
Podolsky
Ace

What I have found out, that CALL function must be in the form CALL ... PARAMETERS ... to work properly. It can be CALL ... PARAMETERS ALL or listed specific parameters, needed for this macro call. You can use CALL without PARAMETERS extension mostly when you call a text file with GDL extension rather then GSM file. Also you can specify a file name for your call as a string and after use it in CALL function: IF X=Y THEN s='Object A' ELSE s='Object B' : CALL s PARAMETERS ALL.

Lingwisyer
Guru

I am not sure what I did, but a few days after this query, the object substitution was working...

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