Request

Response

    Core

    Autodesk.Viewing.Model

    new Model()

    Core class representing the geometry.


    Methods

    fetchTopology(maxSizeMB)

    Downloads the topology file, if one is available. The file may not get downloaded if the topology content size in memory is bigger than a specified limit (100 MB by default, 20 MB for mobile).

    Parameters

    maxSizeMB*
    number
    Maximum uncompressed topology size allowed (in MegaBytes).
    * Required

    Returns

    TypeDescription
    Promise that resolves with the topology object.

    geomPolyCount()

    Returns the polygon count.

    Returns

    TypeDescription
    number

    getBoundingBox()

    Returns

    TypeDescription
    THREE.Box3 Bounding box of the model if available, otherwise null.

    getBulkProperties(dbIds,options,onSuccessCallback,onErrorCallback)

    Returns properties for multiple objects with an optional filter on which properties to retrieve.

    Parameters

    Expand all
    dbIds*
    array.<int>
    IDs of the nodes to return the properties for.
    options*
    object|undefined
    Dictionary with options.
    propFilter
    array.<string>
    Array of property names to return values for. Use null for no filtering. Filter applies to “name” and “externalId” fields also.
    ignoreHidden
    boolean
    Ignore hidden properties
    onSuccessCallback*
    function
    This method is called when request for property db succeeds.
    onErrorCallback*
    function
    This method is called when request for property db fails.
    * Required

    getData()

    Returns the geometry data.

    getDefaultCamera()

    Returns the default camera.

    getDisplayUnit()

    Returns a standard string representation of the model’s display unit.

    Returns

    TypeDescription
    string Standard representation of model’s display unit or null if it is not known.

    getDocumentNode()

    Returns an object wrapping the bubble/manifest entry for the loaded geometry. Contains data such as the viewableID, guid, role…

    getExternalIdMapping(onSuccessCallback,onErrorCallback)

    Returns an object with key values being dbNodeIds and values externalIds. Useful to map LMV node ids to Fusion node ids.

    Parameters

    onSuccessCallback*
    function
    This method is called when request for property db succeeds.
    onErrorCallback*
    function
    This method is called when request for property db fails.
    * Required

    getFastLoadList()

    Helper functions for fastLoad

    getFragmentMap()

    Returns

    TypeDescription
    DbidFragmentMap|InstanceTree Maps dbIds to fragment ids.

    getInstanceTree()

    Returns

    TypeDescription
    InstanceTree Instance tree of the model if available, otherwise null.

    getLayersRoot()

    Returns the root of the layers tree.

    Not yet implemented in 3D.

    Returns

    TypeDescription
    object The root of the layers tree or null if it doesn’t exist.

    getMetadata(itemName,subitemName,defaultValue)

    Return metadata value.

    Parameters

    itemName*
    string
    Metadata item name.
    subitemName
    string
    Metadata subitem name.
    defaultValue
    *
    Default value.
    * Required

    Returns

    TypeDescription
    * Metadata value, or defaultValue if no metadata or metadata item/subitem does not exist.

    getObjectTree(onSuccessCallback,onErrorCallback)

    Returns object tree.

    Parameters

    onSuccessCallback*
    function
    This method is called when request for object tree succeeds.
    onErrorCallback*
    function
    This method is called when request for object tree fails.
    * Required

    getProperties(dbId,onSuccessCallback,onErrorCallback)

    Returns object properties.

    Parameters

    dbId*
    int
    ID of the node to return the properties for.
    onSuccessCallback*
    function
    This method is called when request for property db succeeds.
    onErrorCallback*
    function
    This method is called when request for property db fails.
    * Required

    getRoot()

    Returns the root of the geometry node graph.

    Returns

    TypeDescription
    object The root of the geometry node graph. Null if it doesn’t exist.

    getRootId()

    Returns the root of the geometry node graph.

    Returns

    TypeDescription
    number The ID of the root or null if it doesn’t exist.

    getTopoIndex(fragId)

    Return topology index of the fragment.

    Parameters

    fragId*
    number
    Fragment ID.
    * Required

    Returns

    TypeDescription
    number Topology index.

    getTopology(index)

    Return topology data of one fragment.

    Requires topology data to have been fetched with fetchTopology().

    Parameters

    index*
    number
    Topology index.
    * Required

    Returns

    TypeDescription
    object Topology data.

    getUnitData(unit)

    Returns an object that contains the standard unit string (unitString) and the scale value (unitScale).

    Parameters

    unit*
    string
    Unit name from the metadata
    * Required

    Returns

    TypeDescription
    object This object contains the standardized unit string (unitString) and a unit scaling value (unitScale)

    getUnitScale()

    Returns the scale factor of model’s distance unit to meters.

    Returns

    TypeDescription
    number The scale factor of the model’s distance unit to meters or unity if the units aren’t known.

    getUnitString()

    Returns a standard string representation of the model’s distance unit.

    Returns

    TypeDescription
    string Standard representation of model’s unit distance or null if it is not known.

    getUpVector()

    Returns up vector as an array of 3.

    hasTopology()

    See also fetchTopology().

    Returns

    TypeDescription
    boolean true if topology data has been downloaded and is available in memory

    instancePolyCount()

    Returns the instanced polygon count.

    Returns

    TypeDescription
    number

    is2d()

    Returns

    TypeDescription
    boolean Whether the model is 2D.

    is3d()

    Returns

    TypeDescription
    boolean Whether the model is 3D.

    isAEC()

    Returns whether the “AEC” loader settings were used when loading the model

    isLoadDone()

    Returns true if the model with all its geometries has loaded.

    Returns

    TypeDescription
    boolean

    isObjectTreeCreated()

    Returns true if the frag to node id mapping is done.

    Returns

    TypeDescription
    boolean

    isObjectTreeLoaded()

    Returns true only when the object tree is loaded into memory. Will return false while the object tree is still loading, or when the object tree fails to load.

    Available since version 2.13

    Returns

    TypeDescription
    boolean

    pageToModel()

    Paper coordinates to Model coordinates

    pointInClip()

    Find the viewports that point lies in its bounds.

    search(text,onSuccessCallback,onErrorCallback,attributeNames)

    Searches the object property database.

    Parameters

    text*
    string
    The search term (not case sensitive).
    onSuccessCallback*
    function
    This method is called when request for search succeeds.
    onErrorCallback*
    function
    This method is called when request for search fails.
    attributeNames
    Array.<string>
    Restricts search to specific attribute names.
    * Required

    setData(data)

    Set the geometry data.

    Parameters

    data*
    object
    Data that represents the geometry.
    * Required

    setUUID(urn)

    Set a UUID to identify the SVF model

    Parameters

    urn*
    string
    Data that represents the geometry.
    * Required