我有一个扩展,它加载一个带有文本字段和按钮的停靠面板。此按钮的功能是显示文本字段中给定项目名称的 DB-ID。
类似于: 橡胶 = 2130
Rubber 是输入,2130(db-id) 是输出
我怎样才能做到这一点?
提前致谢。
最佳答案
建议使用 .search()
方法,这是一种受支持的方式:
viewer.search('Rubber', function(dbIds){
// here the dbIds is a list of dbIds, you can handle it
callback(dbIds); // handle the results async
}, function(error){
// handle errors here...
}, ['name'] /* this array indicates the filter: search only on 'Name'*/
)
然后看这里 how to improve performance在搜索中。
关于javascript - Autodesk Forge 如何从名称中获取 dbid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45482462/