View and Data API tips:conversion between DbId and node

Source: Internet
Author: User
Tags unique id

by Daniel Du

In View and Data client side APIs, the assets in the Autodesk Viewer has an object tree, a tree structure that represents The model hierarchy. Each element in the model can be representing as a node of model tree. Each node have a dbId, this is a unique ID for the element in the model. There is a one-to-one correspondence between a node and a dbId.

In View and Data client APIs, some methods use DbId as parameter and some methods with node as parameter, in this case you w Ill need to do the conversion. To get the node object from DbId, this is code snippet:

var node = viewer.model.getData ()     . Instancetree.dbidtonode[dbid];

To get dbId of a node, just with the DbId property:

var dbId = Node.dbid

Just a small tip in case you don ' t know.

View and Data API tips:conversion between DbId and node

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.