BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.
SOLVED!

Nested Macro Calls

GDL Enthusiast
Enthusiast

Hi All,

 

I am trying to create a two level Macro, where the Parent Object can call various Child Objects, that have moveable hotspot parameter. It is super confusing for me.

 

The child objects A and B are the same, except the length parameter changes between them. The child objects have a moveable hotspot for length that needs to be present in the Parent Object. For the trial, I made Object A, then duplicated & renamed Object A as Object B with the larger length parameter. So the child objects are the same but with different lengths parameters. The parent object has the same length parameter to allow the movable hotspot to come through.

 

In the Parent Object Master Script, the call function works fine:

 

IF (Select = 1) THEN
Call "Child Object A"
PARAMETERS Length = Length
ENDIF

IF (Select = 2) THEN
Call "Child Object B"
PARAMETERS Length = Length
ENDIF

 

But the in the Parent Object, the length parameters are now the same in both called objects. Length is set to the Parent Object length parameter. The moveable hotspot works, but I need the length parameter to start at the value of each Child Object.

 

Is there a way to call child objects and have the parameters of the child objects come through at the start? I can set the length to a set length in the Parent Object Call Parameters (i.e PARAMETERS Length = 0.1) but that prevents the moveable hotspots from working.

 

Is it possible to do?

 

Thank you so much in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
DGSketcher
Legend

@GDL Enthusiast from your description you probably need two hidden parameters Length_A & Length_B in the parent object and a way of passing their values both ways to the Length parameter according to the select option value e.g. if select = 1 then Length = Length_A else Length = Length_B. And if the Hotspot changes then Length_A or B should be updated in the Master Script to the Length value prior to the CALL...

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

View solution in original post

4 REPLIES 4

You have to remember to get proper hotspot numbering passed as parameter to the child-macros.

The parameter names must be the same in both caller and macro (if "" quoted parameters were possible... dreaming)

Piotr

Solution
DGSketcher
Legend

@GDL Enthusiast from your description you probably need two hidden parameters Length_A & Length_B in the parent object and a way of passing their values both ways to the Length parameter according to the select option value e.g. if select = 1 then Length = Length_A else Length = Length_B. And if the Hotspot changes then Length_A or B should be updated in the Master Script to the Length value prior to the CALL...

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Hi DG Sketcher, Thanks so much for the reminder that two hidden parameters are needed in the parent object, I had totally forgotten about that and you saved me weeks of head scratching! Best regards!

Hi Piotr, thank you for responding, I will try rebuild the object with proper hotspot numbering, not just a parameter+1 function. Really appreciate your help and best regards!

Learn and get certified!

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!