Search code examples
autodesk-forgerevit

Getting meters instead of English feets from Autodesk Forge


I'm using Autodesk Forge via the official Node.js SDK. All dimensions in my Revit model are set in meters, but, for some reason, when I retrieve the model from Forge, I get everything in English feets (preliminary I convert my .rvt file to .nwc). While I can convert feets to meters on my own, this is really inconvenient. Is there any straightforward way to get everything in meters?


Solution

  • Unfortunately, this might be not possible. According to my experience, it depends on the internal units of the source model. For example, the internal length units of the Revit model is English foot, so the units of the svf, the translated result format of the Forge, will still remain foot. Forge model loader won't change this during loading model, although the default units of the Forge Viewer is meter. We apologize for any inconvenience caused. However, there is a helper function to help you convert units in the Forge Viewer like this:

    var length = 1; // 1 feet
    var lengthConverted = Autodesk.Viewing.Private.convertUnits( viewer.model.getUnitString(), 'm', 1, length );
    

    Hope this help.