Search code examples
heatmapautodesk-forgeautodesk-viewerautodesk-data-visualization

Autodesk aps-iot issue: heatmap failed, sprite is not bounding with rooms


I just start learning about the forge viewer, and currently trying to create data-visualization in forge viewer.

I cloned the Autodesk Data Visualization service, aps-iot-extensions-demo-master.

I followed previous similar question I solved this issue by setting

const APS_MODEL_VIEW = '' 

and changing

getDefaultGeometry() 

to

getDefaultGeometry(true).

I just replaced APS_CLIENT_ID, APS_CLIENT_SECRET, APS_MODEL_URN and APS_MODEL_VIEW; the URN and GUID.

I used the same model racbasicsampleproject.rvt, i couldn't find rooms in model structure with the below command:

const structureInfo = new Autodesk.DataVisualization.Core.ModelStructureInfo(model);

Then I found a blog to get the rooms information from the revit file. I followed the instruction and create a job to generateMasterViews.

{
  "input": {
    "urn": "<<URN>>"
  },
  "output": {
    "formats": [
      {
        "type": "svf",
        "views": [
          "2d",
          "3d"
        ],
        "advanced":{
          "generateMasterViews":true
        }
      }
    ]
  }
}

But, I'm still not getting the rooms in model structure.

However, the heatmap is not visualized in the Web and there is no error existing in the console.

How can I get the rooms structure from the revit model from racbasicsampleproject.rvt model?

How can I ensure that sprites are bound with the rooms?

How can I get bound of the rooms, so I can show heatmap?

I have not changed the sensor detail in io.moked.js.

{
    'sensor-1': {
        name: 'Living Room',
        description: 'Basic sensor in the middle of the living room.',
        groupName: 'Level 1',
        location: {
            x: 31.92,
            y: 11.49,
            z: -12.97
        },
        objectId: 4124
    },
    'sensor-2': {
        name: 'Dining Table',
        description: 'Basic sensor at the dining table.',
        groupName: 'Level 1',
        location: {
            x: -10,
            y: 41.64,
            z: -12.15
        },
        objectId: 4111
    },
    'sensor-3': {
        name: 'Kitchen',
        description: 'Basic sensor in the kitchen.',
        groupName: 'Level 1',
        location: {
            x: 10,
            y: 41.64,
            z: -12.15
        },
        objectId: 4111
    },
    'sensor-4': {
        name: 'Bedroom',
        description: 'Basic sensor in the bedroom.',
        groupName: 'Level 2',
        location: {
            x: -7.46,
            y: 41.47,
            z: 2.97
        },
        objectId: 4085
    }
};

Solution

  • Please create the master view of the revit model with the following api Create job link detail

    send x-ads-force = true in header

    {
      "input": {
        "urn": "<<URN>>"
      },
      "output": {
        "formats": [
          {
            "type": "svf",
            "views": [
              "2d",
              "3d"
            ],
            "advanced":{
              "generateMasterViews":true
            }
          }
        ]
      }
    }
    

    after that by using the following command to console the update floor map.

    const structureInfo = new Autodesk.DataVisualization.Core.ModelStructureInfo(model);
    let levelRoomsMap = await structureInfo.getLevelRoomsMap();
    console.log(levelRoomsMap)