选择对象时如何替换上下文菜单?
目前我正在尝试基于 API 和 Philippe Leefsma 的 Autodesk.ADN.Viewing.Extension.ContextMenu.js 示例。
var contextMenu = new Autodesk.Viewing.UI.ObjectContextMenu(viewer);
contextMenu.buildMenu(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT, [{ title: 'This is a menu item', target: function () { alert('Menu item clicked'); } }]);
viewer.setContextMenu(contextMenu);