Animating Dynamic Components


#1

I am trying to animate a Dynamic Component. I have succeeded in getting a drawer to come out and go in on the Y-Axis. However, the code I have used (from examples) seems to lock the component on the Y-Axis - if I try to move it it snaps back to a fixed position.

I want to be able to freely move the component around the model and make copies in different positions.

Help would be appreciated


#2


#3

found you on the warehouse

drawer.skp (141.0 KB)

generally this drawer would be inside another component, have modified your model to suit,

perhaps you could divide the drawer component so that the external housing of the runner stays in place and a inner sleeve moves with the drawer

drawer2.skp (156.0 KB)

I did this in outliner by selecting and dragging the runner component to the newly formed component1


#4

I see your point about a drawer usually being inside something that is fixed., imagine though that I was modelling things at the highest level that I wished to animate. There would then be no container and the same problem would occur.


#5

I think this might be fairly easy: At the highest level of your component, do NOT set X, Y or Z to a fixed value. Leave them alone! Don’t enter any value for them in the Component Attributes. That allows your user to put the component anywhere they want (absent the restrictions of any gluing plane(s) you have specified).

Heck, don’t even expose them to yourself! If you need to refer to them from a child component, they’re still there (parent!X, parent!Y, and parent!Z) if you need them.

If they aren’t nailed (with a formula or constant beginning “=”, or a user input ability in Component Options) they can be moved anywhere the user wants to put them.

For that matter, since the X, Y, Z positions of any child components refer to the axes origin of the child component relative to the axes origin (and any further rotations) of the parent, you probably won’t need the use parent!X, parent!Y, or parent!Z at all!