Element properties for nwd files in Autodesk Forge - 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.

Related

Viewing DWFX in Forge - Properties

I have tried couple of methods loading a DWF model in Forge viewer (v7):
using Autodesk.DWF
translating using Derivative APIs
With both methods, the whole properties are combined together into one single Tab, although the initial model has separate tabs for item properties.
When I open the DWF file in Navisworks I can see those tabs.
I have also noticed when I downloaded the parts (after translating) the properties.db is 0kb but there is a section_properties.db file which has the data. the 'category' field (_objects_Attr table) for item properties is empty (except for internal Forge fields that start and with __)
Is there any way to preserve the tabs (categories) when translating the model?
Thanks,
Afshin
EDIT 1:
This is the image from Forge viewer, there is no category:
This is from original dwf file, same item selected, with properties id different tabs:

How to get the grid (building baseline)information when importing from IFC file to forge?

I converted an IFC file containing grid (building baseline) information(represented as IFCGRID and IFCGRIDAXIS), to SVF2 and imported it into Forge Viewer by referring to the following link.
https://forge.autodesk.com/blog/consume-aec-data-which-are-model-derivative-api
However, the AECModelData was null and I could not find the grids label and coordinates.
It was represented as a white line in the 3DViewer, but there was no property to label the coordinates.
Is there a way to get the coordinates and label of the grid (building baseline) when importing from IFC file to forge?
I believe this is because the "AEC model data" extraction is currently only available for Revit models, not IFC. You could try linking the IFC file into a Revit document, and then convert the Revit file instead, but I'm not sure if that would help.
Let me reach out to the engineering team and find out if this (generating the AEC data for IFC files is on the roadmap).

About floor level and height in SVF conversion of NWD file

Please let us know if you know.
I am having trouble getting the floor level and height when converting the NWD file to SVF.
If the RVT file is converted to SVF, the value can be obtained from the AEC data (the method below). Is there an alternative method?
"getDocumentNode().getAecModelData().levels"
I think you are right the feature of getAecModelData applies with Revit file only. If it is a Navisworks file, the level or room of Revit file has been extracted, and the related information is attached as properties of the objects. So you could use Search method of Forge Viewer to get out all objects in one level, and get their merged bounding box, which can be the value for the range of a level.
If the browser nodes name have contained some keyword with 'level', you could simply get out those objects in one level by their names. Similarly, get their merged bounding box, which can be the value for the range of a level. One sample is produced by our team, which is based on such model.
https://forge-rcdb.autodesk.io/configurator?id=5a7185a92a0a7aeb152725d5
The source code is available at Level Extension of RCDB Sample. It can also be a reference for you on how to get merged boundingbox, and how to view the level by sectioning feature.

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.

What are the parameters for translating a rvt to a ifc and a dwg file

I just used the model-derivative api to create the ifc and a dwg file. I got it working, but now I want to see what parameters I can set in the post job command. But the documentation on https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/ isn't yet updated. Which parameters can I set for this job?
If you look at the request body structure table, there’s a property you can pass in called 'output.formats', where you can specify the format you want. There are examples requests there too. 
I'll try to hunt down a table for DWG and IFC to set exact parameters to pass in.
When exporting to IFC, it does not matter whether or not there is a 3D view in the model. All the elements in the model would be exported to IFC as Revit does.
When exporting to DWG, it only exports the 'selected' 2D views of the model. You can choose which of the 2D views you need to exporting (to DWG) through Revit addon 'Publish Settings':
http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-09FBF9E2-6ECF-447D-8FA8-12AB16495BC3
Figure 1 Publish Settings
If nothing is selected, all the sheet views (if any) will be exported by default.
Exporting IFC/DWG would use the pre-defined options saved in the RVT file, cf. the help links on DWG and IFC settings:
http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-E8443B4B-D55B-4630-BEE3-D2D8628CA17B
http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-14037C31-EBAD-41A8-9099-E6DD65BB626E
For DWG exporting, there is an option called 'Export views on sheets and links as external references':
Figure 2 DWG Export Settings
This can be set to request multiple DWGs or single DWG exporting. By default, the newly exposed API would exporting IFC/DWG using the active settings saved in RVT file. But the you can specify the name of the settings you want to use for exporting through Forge API.