Forge Viewer: Search or Model Browser - autodesk-forge

How do I enable search on a 2D view in the forge viewer. Looks like the model browser is only available on 3D views. Is there a way to enable it on 2D views as well

Explicitly adding loading the ModelStructure extension does the trick.
viewer.loadExtension('Autodesk.ModelStructure')

Related

Forge viewer does not respect the up direction of some Inventor models

We are having an issue with some Inventor models, where the orientation and up direction in the forge viewer does not match the home view within Inventor.
This screenshot is of a sample model in Inventor (home view):
cylinder pointing upwards
This screenshot shows how it is displayed in the viewer:
cylinder on it's side
We are creating the svf file directly from Inventor design automation, in exactly the same way as the forge configurator sample https://github.com/Autodesk-Forge/forge-configurator-inventor
Is there anything that we need to do explicitly to have the viewer use the home view and up direction from the Inventor model?
I think I have now found the answer to my own question!
In the svf exporter I had turned off the option to export file properties:
oOptions.set_Value("ExportFileProperties", false);
Thinking that this would just eliminate the part properties, but it seems like it must remove the up direction and home view also.

Preventing translating child 3D View in Autodesk Forge

Is there any way to prevent translating child 3D view in Model Derivative API?
As you can see in the following image, I don't want to see that child view in my document browser.
No, it's not possible to customize which viewable can be translated. All the available viewables will be translated.
As an ad-hoc method, you can remove that document browser UI element.

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.

Autodesk Forge Viewer - show markups all the time

We are using the Forge viewer to show both 2D and 3D models. For the 2D models, we would like to be able to show markups all the time, like you can with the viewer inside BIM360.
I tried the solution mentioned here: Forge Viewer: Show bottom toolbar and markups at the same time - but I have not been able to get that to work. It seems like when I call:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
It hides the markups.
How is this done in BIM360? - are they using a custom viewer, where this has been enabled somehow?
Unfortunately I was able to get it to work with:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
See live sample here:

Custom texture autodesk forge

Is it possible to show custom textures applied to materials in Revit using the forge viewer?
Thanks for your help in advance.
My understanding is that you want to use custom JavaScript to modify textures of the model after having translated it. If this is the case here is an example on how you can modify textures in the viewer: Viewing.Extension.Material
You can test the live version using a revit model here. Click the + from lower-right control and select "Office" for example.