Install a dizmo

In order to instantiate a dizmo you must first install it. Use viewer.installBundle to do this. The installation is done asynchronously so the rest of the environment does not have to wait for procedure to be finished.

To get notified you may specify a callback function that will be executed one the installation is complete. For example this allows to instantiate a dizmo from your bundle as soon as it becomes available.

// install a dizmo that is located inside of my own bundle in the assets directory
viewer.installBundle(“bundle://assets/my_dizmo_v0.1.2.dzm”, startDizmo);

// instantiate the dizmo from its bundle
function startDizmo(bundleid,error) {
var newBundle = new dizmojs.Bundle(bundleid);
var newDizmo = newBundle.instantiateDizmo();
}

To check if your bundle has been installed already, you may request a list of bundles installed (viewer.getBundles) and check if the dizmo is part of this list.