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:
Related
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.
I am trying to convert a SVF using linked Revit files. I uploaded a zip to model derivative API which contains all the Revit files.
After conversion, the revit files are combined into one single SVF, but I discovered that at least some of the objects might be duplicated in a weird way.
For example, I have an object which have an unique attribute defined. When I select that object, I can see its position inside the model browser, as well as its properties. (Screenshot 1)
When I try to search in the whole model using that unique attribute, I discovered that another object has the same attribute and properties. When I try to select it using its dbId, I found that the object is invisible in the model, and it does not show where does it belong inside the model browser. (Screenshot 2)
Any idea why is there a duplicated object inside the SVF? Thanks.
I've been asked to insert an .IFC viewer into a web page already built, to:
explode building visualization into floors
rotate the building
colour spaces based on their temperature
add labels to objects
load .ifc files stored on private servers
Does autodesk viewer meet those requirements? All of them?
Additionaly, is it feasible to change the viewer language through a config file or specific functions?
explode building visualization into floors
The built-in explosion is by model components and not floors and there's option right out of box to specify a granularity level.
Nonetheless you can use viewer.cutplanes (see doc here) to isolate the levels and go from there - see sample here.
rotate the building
This can be done by either THREE.js transformation or Viewer's model load options:
THREE.js: Perform transformation recursively by traversing all children components under the model's root dbid. See this great article here for enlightenment.
Load option - see live sample here:
var options = {
placementTransform:THREE.matrix4,
globalOffset:{x:0,y:0,z:0}
};
viewer.start(svfURL, options)
colour spaces based on their temperature
Use viewer.setThemingColor (see doc here) to apply temperature colors - find the parent dbid of the room or and use the recursive flag to apply color to all its children components. See code sample here.
add labels to objects
See here for details and a few helpful links at the start of the article.
load .ifc files stored on private servers
You can download the translated derivatives (SVF and its resources - obtain a manifest of them from GET :urn/manifest) to your own storage locations and load them by their URL directly. See my live code sample above for details and find the source code for our online extractor tool (http://extract.autodesk.io) here for ideas to download the derivatives.
is it feasible to change the viewer language through a config file or specific functions?
Viewer implements the i18n standards so you can do:
Autodesk.Viewing.i18n.setLng('fr');
Autodesk.Viewing.i18n.localize()
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.
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.