Query model levels using GraphQL

Is there a way we can query model levels along with its height and elevation?

I found that we can touch the level name by using this query and passing objectId

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

How can I get the story height or elevation information associated to this level?

I usually use the select parameter to pull that data out:

query getObjectType($projectId: String!, $refId: String!, $floorQuery: [JSONObject!]) {
  project(id: $projectId) {
    object(id: $refId) {
      children(query: $floorQuery, select: ["level.elevation"]) {
        objects {
          data
        }
      }
    }
  }
}
Result
  "data": {
    "project": {
      "object": {
        "children": {
          "objects": [
            {
              "data": {
                "level": {
                  "elevation": 2.4797941478027496e-12
                },
              }
            },
            {
              "data": {
                "level": {
                  "elevation": 2.4797941478027496e-12
                },
              }
            }
...

In this example my reference object is pointing to the version object, which contains more than just the level. The input query for that looks like:

{
  "floorQuery": [
    {
      "field": "speckle_type",
      "value": "Objects.BuiltElements.Floor:Objects.BuiltElements.Revit.RevitFloor",
      "operator": "="
    }
  ]
}

Hi @haitheredavid , thank you for your help, I understand your idea but currently I am in ETABS model, and I can not find elevation information attached to any Object (in your case, you are referring to Floor in Revit) :downcast_face_with_sweat:

Update: I found the Joint object will contains the information about the Z coordinates, but I wonder if there is a better query for this? since referring to Elements in ETABS might be dangerous since elements can be offset compared to the real Level Elevation

1 Like

I’m not familiar with the schemas in etabs, but if you’re able to share a link to the model you’re filtering through I can take a quick look. I would imagine there is an object that inherits from Objects.BuiltElements.Level. Sometimes a level object is a simple type parameter and might not be something you can query directly.

I would recommend playing with the frontend viewer a bit and trying to filter out objects by level or by speckle_type, this has helped me a ton when trying to make sense of what is in the model. With the same example above, I can use the filter feature to find all objects that fall under a given level.elevation value

Depending on how the model was pushed through the connector, you might need to filter by level parameter instead. This is the same model but pushed through a different pipeline which ends up stripping out the level object and keeping it as a simple field.

The viewer will be your best friend here

Hi @haitheredavid , I will take a look at your way and see what I can found.

The project model is private, but I made a sample ETABS model in this link to play around with the GraphQL API. I believe the data being pushed to Speckle is the same.

Here is the model link: Speckle

1 Like

@phong.duong thank you! I poked around a bit, it looks like levels are tied to the story object, which in your model is the a generic object of speckle_type=Objects.Data.DataObject:Objects.Data.EtabsObject.

Level can be accessed through that objects props. So if you swap out the level.elevation from my previous example with something like properties.ObjectID.Level (not sure if that is the right naming convention) that should do the trick.

Hi @haitheredavid, thank you, yeah, I found that object but only the name is attached, no information for level height or elevation in the model unfortunately :downcast_face_with_sweat:

Damn, sorry to hear that. I’m not sure who manages the structural converters, but @clrkng and @Jedd have come to rescue when it comes to converters and schemas.

Hi @phong.duong,

Is this data sent from Speckle’s ETABs connector?
Unfortunately, It looks like we don’t support sending story height or elevation information information in our V3 ETABs connector.

What you see there in the dev mode explorer is everything that gets sent.


The data in @haitheredavid screenshots looks to be from our v2 connector, where we did send more level information.

(@haitheredavid, It’s nice to see you’re still prowling our forums, long time no chat!:grin:)


I’ll have a discussion with the team, and see if they think it makes sense for us to make any changes in v3.

2 Likes

Hi @Jedd, thank you, looking forward to seeing this information.

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