码迷,mamicode.com
首页 > 数据库 > 详细

View and Data API Tips : Conversion between DbId and node

时间:2016-01-22 00:03:15      阅读:377      评论:0      收藏:0      [点我收藏+]

标签:

By Daniel Du

In View and Data client side API, The assets in the Autodesk Viewer have an object tree, a tree structure that represents the model hierarchy. Each element in model can be representing as a node of model tree. Each node has 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 API, some methods use dbId as parameter and some methods use node as parameter, in that case you will need to do the conversion. To get the node object from dbId, here is code snippet:

 var node = viewer.model.getData()
     .instanceTree.dbIdToNode[dbId];

To get dbId of a node, just use 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

标签:

原文地址:http://www.cnblogs.com/junqilian/p/5149756.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!