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

Nested Macro Calls

GDL Enthusiast
Booster

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

Solution
DGSketcher
Virtuoso

@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 macOS Big Sur / AC24UKI (most recent builds)

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

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!

Solution
DGSketcher
Virtuoso

@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 macOS Big Sur / AC24UKI (most recent builds)

View solution in original post

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!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!