Reputation: 1
I'm new to Autodesk forging, I'm wondering if I can select elements in 2d plans using a window selection extension. i've seen some blogs and i know that it's possible on 3d models
Upvotes: 0
Views: 202
Reputation: 7070
Started from v7.32, Forge Viewer has the native window selection extension called Autodesk.BoxSelection
. It supports both 2D and 3D views, but its button is hidden by default. You can add it back with the following code snippet.
viewer.addEventListener(
Autodesk.Viewing.EXTENSION_LOADED_EVENT,
(event) => {
if(event.extensionId != 'Autodesk.BoxSelection') return;
var viewer = event.target;
var boxSelExt = viewer.getExtension('Autodesk.BoxSelection');
boxSelExt.addToolbarButton(true); //!<<< Show the toolbar button for this extension
});
Note. This code snippet should be added before loading the model.
Upvotes: 1