0

Forge Viewer - can we make selections/highlight on loaded models and save in database so that we can show that selection next time user loads it? Is this possible? Or how can we add sticky notes/RFI information /issues spot in the model. I am working in a web application, how do we manage that information and save to some database so that we can show that information later when the same model is viewed again?

Thanks in advance

A DEv
  • 255
  • 1
  • 19

1 Answers1

1

You can get or set the selection using Viewer APIs. Specifically, the getSelection method returns a list of object IDs that you can store wherever you want, and the select method accepts a list of object IDs that you want selected.

For more advanced extensions, feel free to browse our samples over at https://github.com/Autodesk-Forge. One demo that could be of particular interest is the "Forge Digital Twin" (source code, and live demo) which stores "reported issues" to a database, and later shows them as 3D annotations on the model: Forge Digital Twin

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • Thank you Petr for your reply. However what exactly I need is, user should be able to select some region or multiple components and should have a pop up thereby to store details about selection. Is this doable? Any examples or references close to this. – A DEv Dec 03 '19 at 10:36
  • In my web application, I have already RFI workflows are there. So by this capability, user can select and kickoff workflows from selecting models. And those popup and components information can be saved in DB. – A DEv Dec 03 '19 at 10:40
  • Yes, that is possible. As I mentioned in the answer, after your user has selected one or more components, you can use `viewer.getSelection();` to get a list of IDs of the selected components, and store them in your DB. Later on you can use this list of IDs to select them in the viewer again using `viewer.select(listOfIDs);`. – Petr Broz Dec 04 '19 at 09:05