Sample application showing how to view and manipulate BIM 360 content from a HoloLens device using AR/VR Toolkit, Mixed Reality Toolkit, and Forge/BIM360 APIs.
- Unity 2018.2.17f1 with UWP Build Support (IL2CPP) component
- older versions might work, too, but have not been tested
- Node.js v8.0 or newer
- Visual Studio 2017
- install Node.js dependencies:
npm install
- if you don't have one, create a Forge application with access to a BIM360 project (tutorial)
- obtain a lineage ID and a version URN of one of your documents in the BIM 360 project (tutorial)
- obtain an ID of the issue container in the BIM 360 project (tutorial)
- generate a couple of AR/VR toolkit scenes for the document version URN (tutorial)
The server requires several env. variables:
SERVER_URL
- URL on which this server can be accessed by other devices, for example, http://192.168.0.123:3000FORGE_CLIENT_ID
- client ID of your Forge applicationFORGE_CLIENT_SECRET
- client secret of your Forge applicationFORGE_API_HOST
- base URL for all requests to Forge; use https://developer.api.autodesk.comREDIRECT_URL
- callback URL for the 3-legged auth workflow, for example, http://192.168.0.123:3000/api/auth/3-legged/callbackBIM360_CONTAINER_ID
- BIM360 issues container IDBIM360_DOCUMENT_LINEAGE_ID
- ID of a specific BIM360 document lineage; will be used for listing/creating issuesBIM360_DOCUMENT_VERSION_URN
- URN of a specific BIM360 document version; will be used for viewing and for AR/VR toolkit scenesBIM360_DOCUMENT_SHEET_GUID
- GUID of a specific sheet; will be used for creating issuesTOOLKIT_API_HOST
- base URL for all requests to AR/VR toolkit; use https://developer-api-beta.autodesk.io
If you're using Visual Studio Code, here's an example configuration you can use in .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/index.js",
"env": {
"SERVER_URL": "http://<your ip address>:3000",
"FORGE_CLIENT_ID": "<your client id>",
"FORGE_CLIENT_SECRET": "<your client secret>",
"REDIRECT_URL": "http://<your ip address>:3000/api/auth/3-legged/callback",
"FORGE_API_HOST": "https://developer.api.autodesk.com",
"TOOLKIT_API_HOST": "https://developer-api-beta.autodesk.io",
"BIM360_CONTAINER_ID": "<your BIM360 issue container id>",
"BIM360_DOCUMENT_LINEAGE_ID": "<your BIM360 document lineage ID, without base64-encoding>",
"BIM360_DOCUMENT_VERSION_URN": "<your BIM360 document version URN, base64-encoded>",
"BIM360_DOCUMENT_SHEET_GUID": "<your BIM360 document sheet GUID>"
}
}
]
}
To setup the Unity project for development and building:
- go to Mixed Reality Toolkit > Configure, click Apply Mixed Reality Project Settings, and apply the predefined options
- go to Mixed Reality Toolkit > Configure, click Apply UWP Capability Settings, and enable Microphone, Webcam, Spatial Perception, and Internet Client
- go to Edit > Project Settings > Player, and in the Other Settings section, make sure the Scripting Runtime Version is .NET 4.x Equivalent, and the Scripting Backend is IL2CPP
- go to Mixed Reality Toolkit menu, and click Build Window
- in the build window:
- click Build Unity Project; this will create a Visual Studio 2017 project in UWP subfolder
- click Open in Visual Studio to open the generated solution
- configure the UWP solution for deployment to HoloLens following this tutorial: https://docs.microsoft.com/en-us/windows/mixed-reality/using-visual-studio#deploying-an-app-over-wi-fi-hololens
- build and deploy the Unity application to your HoloLens device
- start the server and open its URL in the browser
- use the Login link in the sidebar to log in with your Autodesk ID
- the sidebar should now include a list of BIM360 documents and issues, AR/VR scenes, and a QR code
- the QR code encodes a URL providing all config parameters such as server URL or access token
- start the Unity application on your HoloLens device, and look at the QR code with the headset on
- after scanning the QR code, the Unity application is configured and should greet you with a list of scenes
- airtap on one of the scenes to load the geometry as well as any BIM360 issues associated with it