Request

Response

    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

    getBulkProperties(dbIds, propFilter, onSuccess, onError, ignoreHidden)

    Bulk property retrieval with property name filter.

    Parameters

    dbIds*
    Array.<number>
    array of object dbIds to return properties for.
    propFilter
    object
    array of property names to retrieve values for. If empty, all properties are returned.
    onSuccess*
    function
    Callback function for when results are ready.
    onError*
    function
    Callback function for when something went wrong.
    ignoreHidden
    boolean
    true to ignore hidden properties.
    * 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

    typedescription
    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

    typedescription
    number in the range 0..100

    isLoadDone()

    Returns true if loading is finished (either with success or with error)

    Returns

    typedescription
    boolean