Skip to content

Instantly share code, notes, and snippets.

@xeolabs
Created August 20, 2015 01:12
Show Gist options
  • Save xeolabs/4c146797d1f772833865 to your computer and use it in GitHub Desktop.
Save xeolabs/4c146797d1f772833865 to your computer and use it in GitHub Desktop.
Usage of BIMViews Download component
// Initiate a download of a bunch of objects
var download = new BIMSURFER.Download(viewer, {
downloadType: "oids",
models: [myModel],
roid: ["xyz","xyz2"],
oids: ["xyz","xyz2"],
schema: "xyz"
});
// Subscribe to progress updates
download.on("progress", function(e) {
// Total number of Objects being loaded
var numObjects = e.numObjects;
// Number of Objects loaded so far
var numObjectsLoaded = e.numObjectsLoaded;
// Percentage of Objects loaded so far
var progress = e.progress;
//...
});
// Subscribe to completion
download.on("completed", function(e) {
// Number of Objects loaded
var numObjectsLoaded = e.numObjectsLoaded;
//...
});
// Subscribe to errors
download.on("error", function(e) {
// Error message
var message = e;
//...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment