Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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 get request: Get all Variables over all configurations

dsteineggerdsteinegger Member Posts: 5 PRO

Hello i'm Daniel,

I want to use the API of Onsahpe to get all the variables of all configurations in a Part Studio. Actually, i was already able to do this with the following REST Api endpoints.

Step 1: First catch all the configurations in the partstudio

/elements/d/{did}/{wvm}/{wvmid}/e/{eid}/configuration
https://cad.onshape.com/glassworks/explorer#/Element/getConfiguration

Step 2: Create a for loop in python over all configuration and call the following API endpoint

/variables/d/{did}/{wv}/{wvid}/e/{eid}/variables
https://cad.onshape.com/glassworks/explorer#/Variables/getVariables

So far so good, but each call takes a wile and if you have some configurations the program runtime is too long. The second API endpoint does have the parameter "configuration" and the note next to it mentions that it is possible to request multiple configurations if you separate it with a semicolon. But I tried the following formats and I only get the values of the first configuration. Does someone know how to use this API correctly?

List_YMg2l8wT1PqIXY=Copy_of_TX018_012;Copy_of_TX018_018

List_YMg2l8wT1PqIXY=Copy_of_TX018_012;List_YMg2l8wT1PqIXY=Copy_of_TX018_018

The api can be used and tested via the following link:

https://cad.onshape.com/glassworks

Thanks for your help,
regards
Daniel

Tagged:

Answers

Sign In or Register to comment.