I want to draw room polygons onto a DWG background plan using the Autodesk forge viewer. As I learned in this post, I can get the transformation matrix "pageToModel" like this:
model.getPageToModelTransform(viewportId)
In the post linked above, the viewport ID is extracted in a quite complicated fashion using a 2D geometry and the vertex buffer reader. Running the proposed code with different DWG files, I realized, that the returned viewport ID was always "1".
Can I rely on the fact, that the current viewport ID is "1" in all cases? If not, is there a simpler approach to get the viewport ID? I want to draw the rooms right after the geometry is loaded and I don't want to force the user to click on a 2D geometry first...
I already tried to use the viewport extension, but as someone else already stated here, I also encountered the problem, that no viewport was returned.