Pocket door animate not working?

Hi, im currently trying to make onclick animate interaction on my pocket door. I’m trying to learn from older post and kinda understand about the custom parameter and IF logic, i think my IF logic is correct (?) since it got into the right position but the animate command is not working and it just skipping some animation. is anyone have an answer for this?

Trial.skp (147.8 KB)

Trial.skp (150.8 KB)

amended axis position, so pivot at front and 20mm in

better for a smooth animation use custom with say 2 second interval
use a timeline, 28 cm and 90 degs (118 steps)
then create the conditions for change

Your first attempt show promise and intelligence, reminds me of some of my first attempts. Years of experience makes the difference.

Thank you so much for explaining the logic behind the step. So if i’m not mistaken we can use steps as something like frames in animation right?

i’m currently trying to recreate and understanding about the mechanics behind the step system and i understand it a little bit after trying to recreate some of your formula.

Yes; Animate() takes the range of values and divides the sample into intervals to produce a series of drawings, snapshots. So this is like a timeline. You can dictate the time period with the animatecustom(), first value, I don’t bother with easein or out.
With your example of animationslow you placed 3 values, so first click it samples 1 to 2, second click: 2 to 3, then third: 3 to 1. Stringing values has merit for multiple clicks. but generally, two is sufficient, then on next click, it returns to original. Careful not to have same values in string, as will always go to the first instance. You can create a car(?) that updates without returning to original, by using current() instead of fixed value. With current() must convert by 2.54 if using centimeters as it returns inches.
note: Current() is required for saved DCs if you want them to use the same size values with a swap. An example of a C cannel swap with a L lintel will take same length if on Y axis with current(“leny”)*2.54

I used smallest() as first period, could use if(steps<=28,steps,28) maybe neater?
intermediate would be if(and(steps>28, steps<=60), steps-28,32)
Any step could be multiply or divided for position to speed or slow the animation.
You could have multiple actions at any period

You can plug a number in to the “steps” attribute to test or see the frame at that value.

Another point, which is similar to the extra component shell in
your other post (Dynamic Components - mirrored components)
If more than two rotation, add a protective level.
There are a few weird workarounds with DCs as it a ruby extension and not native. so native updates the drawing giving unexpected outcome. So if notice these abnormalities, the isolation of axis is the fix.

it’s such a detail answer, i’m really thankful for your explanation.
you really help me a lot to understanding the basic behind the animation in sketchup, i will try to learn and explore more command since i already understand about the basic behind it.

once again thank you so much for make everything easier. :slight_smile: