How to find Speckle BIM object name like wall name ,room and more data?

I am trying to find the name of elements used in building like wall ,room and others

1 Like

Hey @Sachin_Kannaujiya ,

Can you please provide information on the application you used to create your model and where you are attempting to locate the object name? Specifically, are you searching within our web application, another software such as Grasshopper or Power BI, or a coding environment? Providing additional context will allow us to assist you more effectively.

I am searching on web application

I want query for this data.

The location of this information may vary depending on the application it comes from. Typically, it is stored in the object under the “name” key. In the case of Revit elements, the name information usually refers to the type name. To assist you better, please provide as much context as possible.

opera_QP345FKphd

can you plaese send me query for these data.

Hey Sachin,

I’m sorry, but I’m unable to provide the query as the information you are requesting may vary based on the category of elements you’re working with. Could you kindly provide us with more details on what you’re trying to achieve with this? In the future, it may be helpful to consult our documentation before asking for assistance.

I need to show area and name of elements.

@Sachin_Kannaujiya Assuming you are making these queries programmatically, in the case of these metadata on objects, we don’t have a direct API to get these.

However, when you make a GraphQL query, you can filter the returned data in various ways to get close to only the data you are interested in.

For example:

query {
  stream(id:"STREAM_ID"){
    id
    name
    object(id:"REFERENCED_OBJECT_ID"){
      id
      children {
        cursor
        objects{
          id
          data
        }
      }
    }
  }     
}

This will get the top-level objects stored in a commit where the Version Commit has an ID you can use for REFERENCED_OBJECT_ID. The data prop will return that JSON blob.

The best place to see this in action is to use the GraphQL explorer: Speckle GraphQL API

You can amend the query to traverse the detached referenced objects to get more objects. I’ll pick an arbitrarily large number:

children(depth: 1000) {

When you refer to the result, you’ll see more detail per top-level object, including all parameters.

You can see the data structure that can now nuance what is returned:

{
  "data": {
    "stream": {
      "object": {
        "children": {
          "objects": [
            {
              "id": "0004a6312bccb6bae46a89bf33ea10b2",
              "data": {
                "id": "0004a6312bccb6bae46a89bf33ea10b2",
                "level": {
                  "id": "c742953de5254033a3f81764369be41c",
                  "name": "L2",
                  "units": "ft",
                  "category": "Levels",
                  "elementId": "9946",
                  "elevation": 8.083333333337128,
                  "createView": true,
                  "parameters": {
                    "id": "487fb074d2dd0535ce7d2c673655e472",
                    "IFC_GUID": {
                      "id": "28120aa68cde94b99646b58fb732966c",
                      "name": "IfcGUID",
                      "value": "1ZGO8hrFCHqw0v0026FpFv",
                      "speckle_type": "Objects.BuiltElements.Revit.Parameter",
                      "applicationInternalName": "IFC_GUID"
                      ... 

In the example above, you’ll see it retrieved the Level property (and all the others) and the Level’s properties.

With insight into the structure, you can now use filters.

children(select: ["category", "type", "level.name"]) {

the returned data object will now only be those properties you selected:

{
  "data": {
    "stream": {
      "object": {
        "children": {
          "objects": [
            {
              "id": "0004a6312bccb6bae46a89bf33ea10b2",
              "data": {
                "category": "Duct Fittings",
                "type": null,
                "level": {
                  "name": "L2"
                }
              }
            },
            {
              "id": "000c45ddc6014c348316fb727027d8ae",
              "data": {
                "category": "Ducts",
                "type": "Tees",
                "level": {
                  "name": "L4"
                }
              }
            },
            {
              "id": "002aef2a0aab105a58ee59bc928c68bf",
              "data": {
                "category": "Duct Fittings",
                "type": null,
                "level": {
                  "name": "L2"
                }
              }
            },
            ...

If you want to limit the objects to return data, you can add a query object to the base query. Lets use rooms per your last question:

query($myquery: [JSONObject!]) {
  stream(id:"ffb0106e64") {
    object(id: "8487f5ce1666038d7383e2d737d096a0") {
      children(query: $myquery, select: ["name", "area", "speckle_type", "level.name" ]) {
        objects {
          data
        }
      }
    }
  }
}

Depending on the GraphQL methodology you use, you define the query as a request variable:

{
  "myquery": [
    {
      "field": "speckle_type",
      "value": "Objects.BuiltElements.Room",
      "operator": "="
    }
  ]
}

Objects.BuiltElements.Room is the Speckle Object definition class for Rooms.

another query in this instance can be:

{
  "myquery": [
    {
      "field": "category",
      "value": "Rooms",
      "operator": "="
    }
  ]
}

The results:

        "children": {
          "objects": [
            {
              "data": {
                "name": "Kitchen & Dining",
                "area": 72.56476003661832,
                "speckle_type": "Objects.BuiltElements.Room",
                "level": {
                  "name": "Level 1"
                },
                "id": "0fad82a565bad4788fa9552375724233"
              }
            },
            {
              "data": {
                "name": "Bath",
                "area": 3.982655199442587,
                "speckle_type": "Objects.BuiltElements.Room",
                "level": {
                  "name": "Level 2"
                },
                "id": "3c5c8f829b56c4b8d600fabfd0d5fa80"
              }
            },
            {
              "data": {
                "name": "Bedroom",
                "area": 13.693578399999017,
                "speckle_type": "Objects.BuiltElements.Room",
                "level": {
                  "name": "Level 2"
                },
                "id": "459a39951ee3f55f9fbeef842c2528d5"
              }
            },

This flexibility is immense, but the power is in your hands. Experiment
over at Speckle GraphQL API. The API docs are available directly on that page under:

image

You can name each query as you learn, which is stored on a local browser session.

One thing our GraphQL is not currently doing is resolving Instance definitions, but this is a nuance for another day. If you are working on an application of your design, then you can make subsequent queries for Instances and Definitions and stitch them together yourself. In principle, following the same logic I demonstrated for PowerBI Propagate Rhino Layer Names to Geometries in Power BI but translated to whatever language you are working with.

1 Like

2 posts were split to a new topic: Duplicating Project Streams