Autodesk Forge - Initial focus on 3d view - autodesk-forge

our initial focus within our 3d views needs tweaking. Currently it is zoomed out ~x2 too far.
Can anyone get me started in the right direction for the controls for this?
I've tried changing the cropregion/ section box etc in the original revit model, but that hasn't made a difference.

A simple way to handle that would be to position the camera as you wish then save the current state and restore it upon loading the model, see my blog post about managing viewer states: Managing viewer states from the API

Related

Autodesk Forge Viewer don't automatically align the model to the center of the viewer

I have an IFC file, with the model component located quite far from the origin (Due to using the correct actual coordinates of the project). After uploaded and translated to Forge, the viewer does not display properly at the location where the model is located. While the url thumbnail still shows the model fit to view. I attach 2 image as follow. Please help how to fix this.
Thumbnail when translation finished:
[1]: https://i.stack.imgur.com/lQTLR.png
Viewer result:
[2]: https://i.stack.imgur.com/hiqS5.png
Forge is usually able to handle BIM models "far away from the origin" quite well. I'd try the following:
check if this isn't just some strange camera preset; when the model is loaded, try double-clicking somewhere on the empty space; this should transition the camera so that it's covering the bounding box of the entire model
alternatively, open the Model Browser panel, and select one of the nodes in the tree to move the camera to it
the Forge Model Derivative service allows you to switch between different loaders when processing an IFC file (go to https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST > "Attributes by Output Type" > "SVF Output", and search for conversionMethod in the advanced properties); give it a try and see if you get better results
And finally, if none of the above helps, consider sharing your IFC design with us (confidentially; we will not share the design with anyone outside of Autodesk) via forge (dot) help (at) autodesk (dot) com so that we could debug the issue on our end.

Mirrored model has its materials flipped inside out when viewed in Autodesk Forge Viewer

Description
Mirrored model has its materials flipped inside out when viewed in Autodesk Forge Viewer.
Adding a section plane reverts the mirrored model back to what it should look like.
We are using this sample viewer from Autodesk.
This weird behavior does not occur when looking at the model in BIM 360 Docs.
We've included screenshots and steps to reproduce this here.
EDIT: while writing this post, we came across Problems with forceDoubleSided setting. Has this been fixed?
Thanks.
Simply loading the 'Autodesk.AEC.LevelsExtension' might fix the problem.
See https://forge.autodesk.com/blog/bim-360-viewer-vs-forge-viewer

crop particular room/area from the forge viewer

We are using forge viewer(v7) in our web application.
Our requirement is to crop particular room/area from the forge viewer. For example, if we have shown a house model in the forge viewer then if a user select a kitchen(from menu or navbar) then the viewer should show only kitchen area (including all its objects like cabinets, burner, fridge, sink etc.) and all other objects/sections should be hidden. Similarly for bedrooms, baths etc. It will be just for viewing purpose at run time and not for any automation.
Does any help that how can we achieve this?
You could use the SectionExtension - mentioned here:
Create a section plane leaning against one object
Documented here:
https://forge.autodesk.com/en/docs/viewer/v7/reference/Extensions/SectionExtension/
This also has a function called setSectionBox(box) which might be best for what you want.
If you can figure out the extents of the room then you could pass those values to it.
Here is a blog post on getting room related information extracted to SVF:
https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces
The other option would be to find all the objects inside the given room and hide everything else. If there is a property for each object that specifies which room they are in, then you could do it based on that using Viewer.search()

Autodesk Forge Viewer - Inaccurate Pushpin Location

I am following the tutorial available here, in order to add Pushpins to a clicked location on the Forge viewer. My issue is that the pushpin is drawn on a different location to where I clicked on the viewer. I am using the exact same code that as available in the tutorial, although I have implemented it as a separate extension.
Following is a screenshot of where the Pushpin was drawn, and where the mouse pointer was at the time it was clicked.
I have been trying to play around with the code by even manually changing the location to get the correct position, but wasn't really successful. Any help on this regard would be appreciated.
Thanks in Advance!
I have this problem when my app was doing components size changes with css, and I solve this calling the method resize of the viewer, after the visual size changes, and before the pushpin creation, like above:
viewer.resize()
Link: https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#resize
I hope this can help you!

Forge Viewer Compass Rose

When viewing a model the view cube shows the orientation of the model in terms of top, bottom, left, right etc.
How would I display a compass rose graphic that would display in terms of North, South etc? Similar to Navis cube.
Note: Currently using V2.11 viewer.
Thanks
Update 2019-11-08: This whish list item, LMV-2837, has been implemented by our engineering team now. You can see the compass under the ViewCube with the viewer v7.6 by default!! Here is the snapshot:
=============
After v2.16, viewer has capability to display labeled axis lines, see here for more detail. But there still is no API available to add custom graphic to the viewer ViewCube in my experience unfortunately, in part because there has been no known user interest.
However, we are interested in your need for displaying custom graphic with the ViewCube and what benefits it would have for you. Could you share with us, please? If it cannot be shared publicly, you can sent those information to forge.help#autodesk.com.
P.S. Please don't sent any sensitive data or information of yours and your company to us.