我们想添加我们的查看器扩展:Autodesk.InViewerSearch
我已经完成了链接中指示的步骤:
https://developer.autodesk.com/en/docs/viewer/v2/tutorials/in-viewer-search-ext/ 变量config3d的声明:
var config3d = {
extensions: ['MyBotonesExtension', 'Autodesk.InViewerSearch']
}
config3d.inViewerSearchConfig = {
searchDefaultText: "",
uiEnabled: true,
clientId: 'adsk.viewer.defaultClientId',
sessionId: 'adsk.viewer.defaultSessionId',
relatedItemsTab:{
enabled: true, //if false we hide the tab
displayName: 'This Item',
pageSize: 20
},
loadedModelTab: {
enabled: true, //if false we hide the tab
displayName: 'This View',
pageSize: 50
}
};
viewerApp.registerViewer(viewerApp.k3D, Autodesk.Viewing.Private.GuiViewer3D, config3d);
在我的 index.html 中:
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/three.min.js"></script>
<script src="scripts/Extension-InViewerSearch.js"></script>
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js?v=2.11.*"></script>
扩展-InViewerSearch.js->
错误:
typeError: n[m] is undefined
i.initSharedPropertyDatabase() viewer3D.min.js:38
i.initCurrentPropertyDatabase() viewer3D.min.js:38
i.getCurrentGeometryAttributes() viewer3D.min.js:38
f/h.initializeAllAttributes() viewer3D.min.js:38
j.InViewerSearchThisView.prototype.initialize() viewer3D.min.js:38
a() viewer3D.min.js:36
h/p() viewer3D.min.js:36
f/<()
我通过 viewer3d.js 更改 viewer3d.min.js
viewer3D.js 中的错误:
typeError: geometriesFlat[current] is undefined
proto.initSharedPropertyDatabase() viewer3D.js:89706
proto.initCurrentPropertyDatabase() viewer3D.js:89724
proto.getCurrentGeometryAttributes() viewer3D.js:89778
Controller/ctrl.initializeAllAttributes() viewer3D.js:88945
viewerSearchNameSpace.InViewerSearchThisView.prototype.initialize() viewer3D.js:88260
initializeSearchTabs() viewer3D.js:85412
initialize/onGetGeometriesDone() viewer3D.js:85603
getGeometries/<()
当几何被加载并且......结果是相同的......同样的错误时,我做了另一个以不同方式运行开发的扩展:
viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,
function (event) {
var options = {
searchDefaultText: "",
uiEnabled: true,
clientId: 'adsk.viewer.defaultClientId',
sessionId: 'adsk.viewer.defaultSessionId',
thresholdSearchMaxNodes: 50000,
loadedModelTab: {
enabled: true,
displayName: 'This View',
pageSize: 50
},
relatedItemsTab: {
enabled: true,
displayName: 'This Item',
pageSize: 20
}
};
viewer.loadExtension("Autodesk.InViewerSearch", options);
在显示屏上只显示放大镜图标。
我希望很快能听到某人的消息...
太感谢了