Forge viewer model revit position - autodesk-forge

I'm loading multiple models into the viewer but the didn't keep their revit position. Is there a way to load a model at it revit position and rotation ?

Eason Kang solution did the job.
To align the model in their Revit position use globalOffset Property when you load the model inside the viewer.

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.

Revit decals on Forge Viewer

I've got a Revit model with decals applied on some surfaces. I uploaded the rvt model on Forge and translated using SVF2 format, but when I see the viewer no images are rendered on the decals, even if the objects are translated (I can see them on the ModelBrowser). Decals appear as green border rectangles, fully transparent:
Is it possible to view decal native images on Forge?
How can I integrate the images source file in the translation and make them visible in the Viewer?
Thanks
Unfortunately, Decals on Revit are not supported as of today. It’s logged as RVTLMV-509. In the meantime, you can still apply decals using that technique.

How to add hotspot sphere in Autodesk Forge Viewer?

I want to add hotspot sphere to a 3D .nwd model which has to be viewed in Autodesk Forge Viewer. Please suggest how hotspot can be added to .nwd naviseworks file.
There are a couple of ways to add hotspots to a model in Forge Viewer:
by adding custom "point clouds" into the scene: https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
by adding custom 3D geometry: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/advanced_options/custom-geometry/
by overlaying the 3D viewport with HTML elements; the Forge Digital Twin sample code shows how you can compute 2D positions from Forge model coordinates, specifically in the IssueExtension

Getting real world coordinates from Forge model

Is it possible to get the real world coordinates form the original model in the Forge viewer? It looks like when a model is loaded into the Viewer it is placed with the center of the model in the origin of the Viewer.
viewer.model.getData().globalOffset is what you are looking for:
Aligning Coordinate Systems in Autodesk Forge Viewer
Afaik, the Forge viewer centres the model. In other words, the origin of the viewer coordinate system is the centroid of the model. The scale of the model remains unchanged. As a result, you can transform the original model coordinates to Forge viewer and vice versa simply by adding or subtracting the model centroid.

Aligning Coordinate Systems in Autodesk Forge Viewer

I would like to display some reference lines in the viewer that are not shown by default when a drawing is uploaded to Forge.
I know the exact end points of the lines as they were defined in the model, however, it seems that the model in the viewer is translated so that 0,0 is in the center of the bounds.
Is there a way to get the transformation matrix that was applied to the model, so I can align the coordinates of my reference lines with the coordinates of the model in the viewer?
Use viewer.model.getData().globalOffset