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.
API rollbackBarIndex functionality

Hi,
I'm trying to output the feature tree from a part studio via python - specifically via onshape-client.client.Client.api_client.request(…) (here)
With a standard request, I can output the appropriate response json via the link:
https://cad.onshape.com/api/partstudios/d/34194a7792ea9db6d10188d3/w/2603dadfb9d5ccf8117390d0/e/140112c65afa2d3dddb074ba/features
However, when I include extra parameters (rollbackBarIndex, noSketchGeometry, etc), I can see the response via the link:
https://cad.onshape.com/api/partstudios/d/34194a7792ea9db6d10188d3/w/2603dadfb9d5ccf8117390d0/e/140112c65afa2d3dddb074ba/features?rollbackBarIndex=2&noSketchGeometry=false
but there are 2 problems:
- the Client.api_client.request runs into a 403 "Resource does not exist, or you do not have permission to access it." This is confusing since I seemingly have access based on the successful response of my initial request. As for my arguments, method='GET', url=the above url, query_params={}, headers={the usual stuff}…
- the 'rollbackIndex' is defined as '4' in the response (the end of the feature tree) rather than the '2' that I specified. This problem also exists when executing via the glassworks REST API Explorer, indicating that this parameter is ignored:
So what's happening here? Why are these requests being forbidden by the API? Why isn't the rollbackBarIndex being acknowledged? Any help is appreciated!
Answers
I just tried, and while I am not seeing a 403, I also see that the rollback bar index parameter doesn't seem to do anything.
What do you need the rollback index for? The definitions of the features shouldn't change when the rollback index is changed.
I know that the rollback index works for other endpoints (such as evaluate featurescript)
Custom FeatureScript and Onshape Integrated Applications
Thanks for the response. True, I didn't need it for the features endpoint, I thought it might just be non-functional for other endpoints as well, but they seem to be working.
I solved my 403 error by using the standard requests library to call the REST API rather than using the onshape-client library.
Actually, the rollbackBarIndex functionality is still giving me issues. Here's my use case:
I want to find the geometric definition of edges and faces based on their known ID's (e.g. 'JHK', or 'KIlC') . These IDs are pulled from the /features endpoint, which you are right @Caden_Armstrong I don't need the rollbackBarIndex for.
The method I was attempting: to use the /tesselatededges or /tesselatedfaces endpoints with the rollbackBarIndex set just before the feature which references a face/edge to find this geometric definition. For example:
The 3rd feature is a fillet, which references a face, 'JHK.' To find this face, set the rollbackBarIndex to 2 in the /tesselatedfaces endpoint, find this face ID, and pull the geometric definition.
However, it seems that these endpoints ALSO don't have a functioning rollbackBarIndex parameter (i have also checked for /part/{pid}/tesselated edges and the results are the same) - it is always set to the end of the feature tree. Thoughts? Ideas?
Is there a different way to do this with evaluate featurescript (which does have a functional rollbackBarIndex parameter)?
Sounds like you should be using evaluateFeaturescript. You can pass your id into the featurescript, us qTransient to turn it into a query, and then use evCurveDefinition.
What are you trying to achieve? Understanding the bigger picture might help in what to suggest for a solution.
Custom FeatureScript and Onshape Integrated Applications
Thanks for your help Caden - couldn’t find qTransient in the docs but that’s just what I needed. I’m trying to build an AI agent that can visualize the geometry in a part studio - so resolving queried entities is important to build the full picture!