The problem of ForgeViwer loading multiple models

because of the requirements of the project, I just came into contact with forge.

currently I have converted the rvt model to svf format and exported it offline to my local,

then load the model through viewer.loadModel ("static/model/xxx/Resource/_/_3D_ 1562931). Since the model files provided by the customer are scattered, you need to call viewer.loadModel again to load multiple similar models.

then here comes the problem,

  1. after loading, on the instance of viewer (constructed by Autodesk.Viewing.Private.GuiViewer3D), accessing viewer.model, can only get the first model, but not all the models that have been loaded. For this problem, you can record all models by callback after loading successfully. But do ForgeViwer officially provide an interface to manage multiple models?
  2. in the case of multiple models, the "Model browser" function of the lower toolbar can only display the information of the first model. Is there a way to add a layer of model selection to the model part tree in the case of multiple models
  3. the parts selected by other models cannot be obtained through viewer.getSelection, but only the selected parts of the first model can still be obtained
Mar.20,2021

the answers to your questions are as follows:

  1. you can get other loaded models through viewer.impl.modelQueue (). GetModels () , " Link "
  2. Forge Viewer 4.0 or later "Model browser" already supports the display of multiple models, " link "
  3. "
  4. can be obtained from viewer.getAggregateSelection () , " link "

Boss, how do you convert offline RVT to SVF format? thank you for your advice.

Menu