How do I define a component as a parent, or child of a given component?


#1

BEN Sensor Structure_AM_04.skp (2.6 MB)
I have a pair of frames that rotate on a hinge assembly. Using DC animate, I can show where components should end up. What I cannot figure out is how to make a rotational attribute of a hinge affect the attached frame. I believe that I need to create a parent/child relationship where attributes are inherited by the child without specifically scripting the final rotational and spacial translation.


#2

I’ve not spent much time looking at your attributes, but it it looks like it’s working to me. I’ve not changed anything and this is what happens when you click the green button:

What is it supposed to do if not that?


#3

Gordon-
Thanks for looking into this. If you look closely at the animation, the upper frame rotates on its own axis, the hinges rotate on their own axes. I did this by manually applying attributes that rotate then position the frame, while also rotating the hinges independent of one another. From my imperfect understanding of the parent/child relationship, I should be able to make the hinges the parent component and the frame child. Then the upper frame will remain glued to the face of the hinge because it accepts attributes from the hinges.

Does this make sense?

I have uploaded a updated version to make this clearer. We see an antenna array that should be folding forward as the frame folds backwards. All this to fold the antennas inside the aluminum frame for protection during shipping and deployment/retrieval operations.

Oh, ya. This is an antenna and sensor frame for an autonomous boat.

Andy


#4

I think if you “cut” the frame and then open the hinge component and “paste” it in there it will then attach to the hinge and subsequently its motion as it becomes part of the hinge.


#5

One thing you can do to simplify formulas is to move the UFrame1 Axes to be the at the center of the Hinge - that way you will only need to rotate the UFrame1 Component instead of also moving it along the Y and Z axes.

I would have the button animate a custom attribute in the top-level component:

Button:
onclick: animate(Parent!anim, 0, 1)

Then use this attribute in each of the child components to control their movements. For example, UFrame1 would eliminate its own onclick, and use Parent!angle for its RotX instead:

UFrame1:
RotX: =Parent!anim*180

Here;s the component with only those changes:

BEN-parent-anim.skp (2.6 MB)


#6

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.