Fetching ETABS analysis results using GraphQL

I am trying to fetch Analysis Results from my ETABS model using GraphQL, I am trying to test on Apollo Server, but I cannot find in the documentation for the query I need, did I miss anything? How can I fetch this information?

Update: I found the analysis results by using this

query ObjectDataQuery($projectId: String!, $objectId: String!) {
  project(id: $projectId) {
    object(id: $objectId) {
      data
      }
    }
  }

The returned data give me a lot of results; is there a way I can filter the data returned to get only analysisResults? and furthermore, filter to get specific result in analysisResults?

Hey @phong.duong,

Here is the documentation for the GQL Api: https://speckle.guide/dev/graphql-api.html

you will need to add the “children” in the query and then use the Arguments to fetch exactly what you need. You can use the “select” argument to choose specificly what property you need. Make sure to type the full path correctly.

I don’t have any ETABS example at the moment, maybe @bjoern can help you.

1 Like

Hi @Nikos cc: @bjoern , I tried this approach, not sure if I missed anything but using “children” in the query does not give the analysisResults data.

I think the data coming back is just geometry data.

do all the objects have analysisResults?

fyi the return query is limited to the first 100 items, so if not analysisResults exist in the first items then you will not see.

will be easy if you give us a sample URL to help you

Hey,

Since all the analysisResults are attached to the root object, querying the objects for their children are not going to be helpful to retrieve them. We did this design on purpose based on performance concerns.

This snippet will return the root object -including the results- as a JSONObject which means not queryable. We are working on some solutions to assign results to the corresponding objects in the post-process.

What is your workflow though? Could you parse this JSON in the client-side?

1 Like

Hi @dogukan, @Nikos , thank you for your responses.

Per my understanding, the only way to get the analysisResults is by querying the root object, and this is not queryable right?

What is your workflow though? Could you parse this JSON in the client-side?

I am fetching data from Speckle model to perform some reporting task and display results on a web app. Yes, I can parse this JSON in client-side, I just want to improve a little performance for the web by not holding some unused information in the returned data (since I do not know what results users might push into Speckle, maybe someone will try to push a bunch of redundant data to it)

You’re right that it’s not optimum. I already had some plans about it, so I will ping this channel if I can manage to come with a better solution.

2 Likes

Great, looking forward to it. Thank you for your help @dogukan

This topic was automatically closed after 180 days. New replies are no longer allowed.