First I would like to know if there is an exhaustive single resource on DC’s from beginning to advanced with best practices and tips and techniques?
For now, I am creating a DC “on click” with a sequential action.
I have a central triangular block and three cubes one on each face of the triangle. The whole group of four parts rotates around the center of the triangular block, in 120 steps and then returns before making a full rotation.
The three cubes move up and down as one, sliding on the face of the triangular block.
“On click” the three cubes must complete the upward motion before the whole group of four parts rotates 120 degrees, then after the rotation of 120 Deg is completed, the three cubes must drop. Then “on click”, this sequence is repeated, lift, turn, drop. And then on the third click lift, the whole group of four rotates back to the original position before the cubes drop.
For now I am baffled on how to get the lift then drop on a single click. I am sure it must be simple.
See: Dynamic Components Resources
I do not see any way to do it with the current implementation of
onClick(). All of it’s specified animations are started at the same time.
A Ruby script or a third-party animation extension would be a better alternative.
the way to do this would be to use a counter as a time line which is activated onclick, then use the counter values to work conditional statements and/or functions
movement.skp (18.9 KB)
rotate and drop.skp (36.0 KB)
Thanks for your input. Links and samples are helpful. Although not exactly what I need, but something to work with. There are so many functions to learn and use in un-intended but helpful ways. Someone could write a book on programing Dynamic Components. I am not sure how many would buy such a book.
Well most of the SketchUp books out there at least have a chapter on Dynamic Components.
I did a quick search, but had not found a dedicated book on DCs.
I am missing something basic about programming DC’s, and I keep forgetting how it works. It the flow of data between attributes, behaviors, Parent and child components. Could someone take a look at this? I want to click one of the three side blocks to make them lift and drop, which they currently do, but I also want to click the center triangle to make all four objects rotate together in an animation. only the triangle does it. and the three blocks will jump to position when clicked. I could use some principles and concepts to remember.TestGage.skp (123.2 KB)
change the triangle onclick to reference the parent maybe what you require
making the action proactive rather than reactive
TestGage.skp (125.2 KB)