Missing elements in autodesk forge - autodesk-forge

I'm playing around with coordinates in autodesk forge and by some chance i noticed that some of the element(door in my case) doesn't have an fragment id. I've tried to use selection and fittoview to try and display which is the problematic element and to my surprise the element doesnt even exist in the viewer (I still managed to use getProperties to show all the properties though).
Is this because of some bug occurred during the conversion from revit to forge or is it because of an error in my programming?

It seems to be expected that small objects get lost in Revit export processes, cf.:
Model objects missing in custom exporter context
Small objects missing in DWG export
How large is your missing door? How large is the model?

Related

Autodesk forge viewer load multiple gltf problems

I'm thinking of adding one gltf to the model object, how important are we to use this object, like how to add one of my clons to the scene, I've tried it, it's impossible to work normally, because the id is double Of course, there are other errors, and we will solve this problem.

Make and save change into Forge Autodesk Viewer

I need to view files with the autodesk viewer and make and save the changes. I wonder if it is possible to do it directly through the Forge API I thought to apply, once the waterfall viewer is loaded, all the preloaded changes in an internal database
The changes I would like to make are of the type:
adding a room,
addition of mesh
addition of successively recoverable properties
addition of other 3D models preloaded in forge
Since all property data and the SVF itself (or any derivatives for that matter) is immutable once extracted so I am afraid you'd need to programmatically append the mesh (try SceneBuilder to make things easier) every time the model is loaded ... As for the properties it's possible to use your own data source for persistence though - see a case in point here and here
To persist any change to the original design file would require translating the model again for Viewer to consume the changes - however this process can be automated using our Design Automation service and Webhooks ... see here to get started.
One possible workaround to persist your custom geometry would be to convert your geometry to OBJ and then SVF with the Model Derivative service (for course that'd incur costs ...) and then load it to Viewer and aggregate with the original model...

Load three js model into forge viewer

I try to load a three.js file (Json from rvt) into the offline version of the forge viewer. How I can do this?
Thank you!
Forge viewer is based on three.js. It is similar to adding mesh to the scene in native three.js context. The below are one demo extension.
https://github.com/Autodesk-Forge/library-javascript-viewer-extensions/tree/0c0db2d6426f4ff4aea1042813ed10da17c63554/src/Autodesk.ADN.Viewing.Extension.MeshImporter
In this demo, the json file (Arbor Press.json) is from Inventor. It contains the definition of the geometry and material. The code of the extension will parse the json, and create mesh in the scene of Forge Viewer.
You might also need to take a look at the other extension for examples of changing material colors:
https://github.com/Autodesk-Forge/library-javascript-viewer-extensions/blob/0c0db2d6426f4ff4aea1042813ed10da17c63554/src/Autodesk.ADN.Viewing.Extension.Material/Autodesk.ADN.Viewing.Extension.Material.js
However please be aware your meshes will not be detected by the viewer selection logic, some extra work would be needed if you want that.

3D Geometry missing in Revit File after model derivative SVF translation

I'm trying to translate Revit file that contains both 3D and 2D geometries. I've verified that the file contains proper 3D geometry, by opening it in revit 2019 and visualizing it through 3D viewing mode.
However, when I pass this file into model derivative process, it only creates 2D derivative.
Before translation process, I've tried to set default view of the revit file as '3D' instead of 2D drawing file, which didn't work.
I've also tried making a translation POST request with formats as 'svf', and views as both ('3D', '2D'), and ('3D' only), which both failed.
However, all these attempts didn't work, and when I inspected the manifest from the file translation, it seems like that 3D geometry is completely missing. I think that there is a unhandled exception in Model Derivative process that fails to extract 3D geometry in our particular forge model file.
If you need URN of the file / actual file, please let me know.
Thanks in advance.
- EDIT
UPDATE:
I've confirmed that the default 3D view is named as {3D}, default name set by Revit.
What is the name of your default 3D view?
The default name is "{3D}", I believe.
Maybe the translation process does not pick it up if it is named differently.
Afaik, the one and only way to specify the views for the translator to process is by using the Collaboration for Revit or C4R BIM 360 Team tool to select the views to publish to the cloud.

Element properties for nwd files in Autodesk Forge

When I query element properties in Autodesk forge for a model that is based on NWD file, I only get small set of the element properties than what I see in NavisWorks Manage. On the other hand, when I query the properties for models based on Revit rvt files, I can see all the properties. Is there anyway to get the full properties for nwd files?
Just to clarify, I am asking about properties that are already in the NWD file and I can see it in Navisworks.
Thanks in advance
You can set viewer selection mode by
viewer.setSelectionMode(Autodesk.Viewing.SelectionMode.FIRST_OBJECT)
and then you can get the properties you want.
There are 3 different type: FIRST_OBJECT, LAST_OBJECT, LEAF_OBJECT. the default is LEAF_OBJECT .
The Model Derivative API will only extract information available on the original file, there are no settings on this process (e.g. which properties to extract), except selecting 2D or 3D views.
If you need information as presented in Revit, then consider using the .RVT file.