Request

Response

    Core

    Autodesk.Viewing.BubbleNode

    new BubbleNode(rawNode,parent)

    Wrapper and helper for “bubble” data.

    Bubble is a container of various 2D or 3D viewables (and additional data) that may be generated from a single seed file. The bubble is a JSON structure of nodes that have different roles, for example, they may represent sheets, nested 2D/3D geometry, etc.

    This class wraps the internal representation of the bubble and adds a couple of helper methods.

    Parameters

    rawNode*
    object
    Raw node from the bubble JSON.
    parent
    object
    Parent node from the bubble JSON.
    * Required

    Methods

    findByGuid(guid)

    Returns first node from the bubble matching a GUID.

    Note that some GUIDs in the bubble are not unique, you have to be sure you are looking for a GUID that is unique if you want correct result from this function. Otherwise use the generic search.

    Parameters

    guid*
    string
    Node GUID.
    * Required

    Returns

    TypeDescription
    BubbleNode Matching bubble node, or null.

    findParentGeom2Dor3D()

    Returns

    TypeDescription
    BubbleNode First parent in the hierarchy that is a 2D or 3D geometry.

    findPropertyDbPath()

    Finds shared property DB if there is one.

    Returns

    TypeDescription
    string Shared property DB path, or null.

    findViewableParent()

    Returns

    TypeDescription
    BubbleNode First parent in the hierarchy that is a viewable.

    getLodNode()

    Returns

    TypeDescription
    boolean Is this an LOD node.

    getNamedViews()

    Returns all the named views in the viewable. Named views are obtained from the document’s manifest which contains camera information and a string identifier.

    Available from version 2.15

    Returns

    TypeDescription
    array All named views. Returns empty array if none are found.

    getPlacementTransform()

    Returns

    TypeDescription
    object Placement transform of the node.

    getRootNode()

    Returns

    TypeDescription
    BubbleNode Top-most bubble node.

    getTag(tag)

    Retrieves value of a node tag.

    Parameters

    tag*
    string
    Tag name.
    * Required

    Returns

    TypeDescription
    * Tag value.

    getViewableRootPath()

    Looks for the viewable root path in this node and all its children.

    Returns

    TypeDescription
    string Viewable root path, or null.

    guid()

    Returns

    TypeDescription
    string Node GUID.

    is2D()

    Returns

    TypeDescription
    boolean Is this a 2D node.

    is2DGeom()

    Returns

    TypeDescription
    boolean Is this a 2D geometry node.

    is3D()

    Returns

    TypeDescription
    boolean Is this a 3D node.

    is3DGeom()

    Returns

    TypeDescription
    boolean Is this a 3D geometry node.

    isGeometry()

    Returns

    TypeDescription
    boolean Is this a geometry node.

    isGeomLeaf()

    Returns

    TypeDescription
    boolean Is this a geometry leaf node.

    isMetadata()

    Returns

    TypeDescription
    boolean Is this a metadata node.

    isViewable()

    Returns

    TypeDescription
    boolean Is this a viewable node.

    name()

    Returns

    TypeDescription
    string Node name.

    search(propsToMatch)

    Finds nodes from the bubble matching one or more properties.

    Parameters

    propsToMatch*
    object
    Filter criteria - matching nodes must have the same properties and values.
    * Required

    Returns

    TypeDescription
    Array.<BubbleNode> Matching nodes, or null.

    searchByTag(tagsToMatch)

    Finds nodes from the bubble matching one or more tags.

    Parameters

    tagsToMatch*
    object
    Filter criteria - matching nodes must have the same tags and values.
    * Required

    Returns

    TypeDescription
    Array.<BubbleNode> Matching nodes, or null.

    setTag(tag,value)

    Sets node tag value.

    Parameters

    tag*
    string
    Tag name.
    value*
    *
    Tag value.
    * Required

    traverse(cb)

    Recursively traverses the bubble, calling a callback function for each node, for as long as the callback function keeps returning false.

    Parameters

    cb*
    function
    Callback function, accepts a bubble node as an argument, and returns true if the traversal should be terminated.
    * Required

    Returns

    TypeDescription
    boolean Result of the last callback invokation.

    urn(searchParent)

    Retrieves the URN of the node or its closest ancestor.

    Parameters

    searchParent*
    boolean
    If URN is not available for this node, search through its ancestors, too.
    * Required

    Returns

    TypeDescription
    string Viewable URN.