Forge Viewer: How to Link Spaces to 2D Sheets - autodesk-forge

I have a Revit file with spaces information in a 2D view. However, when I access that view through Forge, the spaces information is gone. Looking deeper, I find the spaces are in the 3D "New Construction" view (generated by BIM 360). How can I use the spaces information with the 2D view? I would like to be able to select a space and go to its corresponding location on the 2D view.

Switching from 3D to 2D or vice versa is demonstrated in this example:
https://github.com/Autodesk-Forge/forge-extensions/blob/master/public/extensions/NestedViewerExtension/README.md

Related

In Autodesk Forge 2D .dwg drawings is space/region selection possible?

Autodesk Forge :In case of 2D .dwg drawings is space/region selection possible? in .rvt files the region/space selection is possible can we have a similar selection in .dwg files also?
from 1st pic if we select a particular room the selection should look as in the second pic is that possible?
It's not possible. In a 2D drawing, that region is like empty space, you can't select it.

Forge viewer displays elements blurry in 2D views and the Measure extension does not work on them

For some of our Revit models, in Forge viewer, 2D views are display blurry, no element can be selected and the Measure extension does not work on elements and only works on the dimensions and the titleblock.
Like this example:
here and here
But it should be like this
I have tested it with our viewer, A360 viewer and Autodesk Forge Tools vscode extension.
This is because 2D drawings or PDFs can contain both vector graphics and raster graphics (this article explains the difference between the two). The measure extension needs vector graphics in order to work properly.
Thanks to Petr Broz and his hint, by changing the Model Display Style in Revit side to Hidden Line instead of Shaded the problem was solved.
Like this.
Update:
The Shadows in Graphic Display Options, also should be unchecked.

Exporting markup data in RVT/CAD format

I am using Autodesk Markupscore Extension to draw markups on 2D view. I want to create a separate rvt or CAD file for the drawn markup, which can further be used/opened in Revit soft. So the newly created 2D view(rvt/CAD) will contain only that part of 2D view which is inside the drawn markup, How can I achieve this?
I can't comment on the Revit specific piece (for that I would suggest that you check out the Revit discussion forums) but if we're talking about where Forge can help, I see two options:
you could have a Revit plugin running in the Forge Design Automation service, accepting a Revit document and some coordinates of 2D markups on the input, removing design elements that are outside of the 2D markups via Revit APIs, and generating a new Revit document on the output.
you could customize Forge Viewer to hide or occlude the parts of the 2D drawings you don't want to be visible, for example, by "hiding" them (making them semi-transparent), by changing their color, or by overlaying them with another content such as a blank SVG rectangle.

Viewing Multiple .DWG files in viewer using Forge API

I need to see multiple .DWG in the Forge viewer in 3D format. There are some buttons on the viewer screen using which we can toggle between 2D and 3D views. On using those toggle buttons, currently we are able to see only one file at a time in the 3D view. Is there any option to view multiple files in 3D format?
You can use three ways to see multiple views of the same model.
Split the screen into multiple screens (SplitScreenExtension): https://forge.autodesk.com/en/docs/viewer/v7/reference/Extensions/SplitScreenExtension/
Place a view inside a div: https://github.com/Autodesk-Forge/viewer-navigation.sample/blob/master/www/scripts/model.js
Creating a div that renders a view within a DockingPanel.
I may have already answered this in your other Stackoverflow question, but, it is the same answer here. Try loading multiple models into a scene, using this blog post as your guide:
https://forge.autodesk.com/blog/loading-multiple-models-forge-viewer-v7
One neat trick with Forge Viewer, is the ability to load a 2D sheet inside the 3D world. The 2D sheet, if it comes from DWG, it will be vector lines, and if it's an old PDF, it will be image tiles.
Here's a video of combining 2D sheets into a 3D scene, into something more useful to your user...

Is there a way to match coordinates from 2D sheets to 3D view for an item?

I work on forge viewer to display Revit converted files. I try to put points into 2D sheets view that I would then display into 3D view. (e.g. in revit red house sample file, from sheet "A-102 plans" to 3D view {3D} ).
Currently, I see only something like:
From 2D view:
Extract coordinates of point from 2D view relatively to item 2d-bouding-box
Convert these relative coordinates into a x,y,z ratio to the size of the item (plus solve from x,y,z, what are the 2 axes we see in 2D)
Into 3D view:
Get 3D bounding box of the item
Compute point position from previous info
Since coordinates are different between the 2 views (which sounds expected), is there a more straightforward way to do this?
Thank you,