0

I have a couple of DWG drawings which I have converted into F2D files for offline viewing. There is a base model which I load on the viewer initialization. Other drawings are loaded using viewer.loadModel as in when required.

These drawings get loaded fine. The problem is that it messes up the selection. Only one of the loaded models gets selected (and gets highlighted) on mouse down.

When I check the selection on the event received in AggregateSelectionChangedEvent, the selection has only the first model. So, I cannot even distinguish the model which has been selected.

Since some of the drawings can be loaded multiple times, (Consider a car drawing where one can load same wheel drawing and place at 4 positions) the dbId of the selected entity is same for multiple models. So, dbId can not be used as the only parameter. What I need is dbId + model.id combination to tell the selected object apart.

As per the suggestion received from elsewhere, I was setting

renderer.settings.numIdTargets = 2.

This made the selection work for multi-model pretty much as normal selection. It worked a while, then suddenly stopped working. I am not able to figure out why.

Can anyone suggest a lasting solution to this problem?

ashish
  • 425
  • 4
  • 11
  • Hi @ashish, as you know, the related APIs of Forge Viewer has not well supported the scenario. Could you share a test sample that can reproduce the problem? And when you said 'stop working' , does this mean viewer cannot respond with any selection or it can only work with one model selection again? – Xiaodong Liang Nov 13 '17 at 14:00
  • Hi Xiaodong, Thanks for the response. What I meant was that the selection works only for one model. I am sending you a test case soon. You can see that very few times the selection on multiple models actually works as expected. It's not consistent though. – ashish Nov 13 '17 at 15:47

0 Answers0