2021-12-03 03:27 PM - last edited on 2021-12-05 08:06 PM by Laszlo Nagy
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!
Solved! Go to Solution.
2021-12-04 12:21 PM
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)
2021-12-04 09:58 PM
@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...
2021-12-13 01:36 PM
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!
2021-12-13 01:38 PM
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!