September 21, 2018

Enumerate dbIds on 2D views

Default blog image

Some 2D views of documents will not have the InstanceTree, if you try to enumerate leaf nodes you will get F2D files do not have an InstanceTree error.

The alternative is to use the fragmentId to dbId mapping, the following code shows the idea for Viewer v6:

var frags = _viewer.model.getFragmentList().fragments.fragId2dbId;
frags.forEach(function(frag){
  frag.forEach(function(dbId){
    if (dbId<0) return;
    // do something with the dbId
  });
});

One interesting application is to use .setThemingColor, which requires the dbId.

Related Posts

May 10, 2019

Consume AEC Data which are from Model Derivative API

Model Derivative API has been able to extract AEC data of Revit model such as level, grid, views, phase, linked documents etc. And Forge Viewer also provides the corresponding methods ...

Read More

May 9, 2019

Basic point clouds in Forge Viewer

Developers often ask us whether point clouds are supported in Forge Viewer. Unfortunately, the official answer is "no".

Read More

May 9, 2019

Quick deployment of Forge applications to Azure

Microsoft Azure has recently introduced Azure Resource Manager (or ARM) - a service for

Read More