Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.
The @itwin/reality-data-transfer package contains a sdk to upload local data to ContextShare and download reality data. Doesn't work in a node environment.
A registered application in the iTwin Platform is needed for using reality data transfer package. Documentation for registering an application can be found here. Make sure that your application has realitydata:read realitydata:modify
scopes enabled.
To use the data transfer package, you will need to have an access to a project. If you don't have one already, contact one of your Organization Administrators or take some time to go through the following tutorial: Create a Project.
To build and run reality data transfer, you will need Node.js v18 (must be greater than 18.12.x).
Sample progress hook for upload and download
setUploadHook
: Set the upload progress hooksetDownloadHook
: Set the download progress hookgetScopes
: get the required scopes to use this client.downloadRealityDataBrowser
: download reality data from ProjectWise ContextShareuploadRealityDataBrowser
: upload reality data to ProjectWise ContextShare
Stores the local path and cloud id of each uploaded data. When uploading a new reality data such as context scene, it might contains local paths, which doesn't mean anything in the cloud. The reference table will check for any local path in the context scene and replace it with the corresponding cloud id.
save
: open a file picker and save references as txt fileload
: load references from selected file. Open a file picker to select the reference fileaddReference
: add a new entry in the reference tableremoveReference
: remove entry from the reference tablehasLocalPath
: check if the provided local path exists in the reference tablehasCloudId
: check if the provided cloud id exists in the reference tablegetCloudIdFromLocalPath
: get a reality data id from a local pathgetLocalPathFromCloudId
: get a local path from a reality data id
An example is available to show how to upload local data and download reality data. See Reality Reality data example