Autodesk.Viewing.Private
PropDbLoader
new PropDbLoader()
Per model property database interface, talks to the worker thread behind the scenes.
Methods
getProperties(dbid, onSuccess, onError)
Gets the properties for an ID.
Parameters
dbid* number | The database identifier. |
onSuccess Callbacks#onPropertiesSuccess | Callback for when the properties are fetched. |
onError Callbacks#onGenericError | Callback for when the properties are not found or another error occurs. |
* Required
executeUserFunction(code)
Allows executing user supplied function code on the worker thread against the
PropertyDatabase instance. The returned value from the supplied function will
be used to resolve the returned Promise. The function must be named userFunction
.
Parameters
Returns
type | description |
---|---|
Promise | Resolves with the return value of user function. |
Examples
executeUserFunction(function userFunction(pdb) {
var dbId = 1;
pdb.enumObjectProperties(dbId, function(propId, valueId) {
// do stuff
});
return 42;
}).then(function(result) {
console.log(result); // result === 42
})
Show More
getLoadProgress()
Estimated load progress in percent.
Returns
type | description |
---|---|
number | in the range 0..100 |
isLoadDone()
Returns true if loading is finished (either with success or with error)
Returns
type | description |
---|---|
boolean |