Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Need help with a idea for a time lapse using the feature tree.

I am not a feature script guy so this is a request. Sometimes I need to record my build and most of the time I forget to hit record, yes it is lame but it happens. Is there a feature script that could walk through each feature, sketch etc and make a screenshot starting at the top of the feature tree. Then I can take that into my editing software and make a pseudo timelapse.
0
Comments
Simon Gatrall | Staff Mechanical Engineer | Carbon, Inc.
1. Get the list of features (https://cad.onshape.com/glassworks/explorer#/PartStudio/getPartStudioFeatures)
2. For each feature, move the rollback bar by 1. ( https://cad.onshape.com/glassworks/explorer#/PartStudio/updateRollback )
3. Get a snapshot of the part studio ( https://cad.onshape.com/glassworks/explorer#/PartStudio/getPartStudioShadedViews ) & save to file.
4. Repeats step 2,3 until you are done with features.
HTH.
@Ben_
I do something similar on Linux with a little (very hacky) shell script.
It basically works like this:
I might try to make a little python script that does something similar using the API (so you don't need to set the number of features manually) but for now this works fine for my needs. If you're on Windows / Macos there are many apps that let you control your system in a similar way (for Windows there is AutoIt for example). You could use one of those programs to set up a similar loop.
In the end I use ffmpeg to combine the frames into an animation (but again there is also GUI based software that can do this for you).
ffmpeg -framerate 24 -pattern_type glob -i "*.png" -c:v libx264 -pix_fmt yuv420p output.mp4
My shellscript (also online as a gist on Github )
#!/bin/bash
sleep 3
for i in $(seq 1 55); do
echo "Iteration: $i of 55"
# Press the Arrow Down key using xdotool
xdotool key Down
sleep 1
# Replace "Part Studio" with the actual window title or part of it
WINDOW_ID=$(xdotool search --name "Part Studio" | head -n 1)
import -window "$WINDOW_ID" ~/screenshots/screenshot_$(date +%Y%m%d_%H%M%S).png
sleep 1
done
I've written a quick test script using the API as described by @Paul_J_Premakumar. The script is very much WIP (but does work), but I like the result less than the 'real' screenshot option; seeing the sketches and some of the UI is a bit more interesting. Might depend on your needs though.
As this forum doesn't allow formatting code, and Python code breaks when it looses the right indentation, I've made a gist on Github:
https://gist.github.com/javl/b0ec23ce20e3a06160ed28aada3a5a34