We use the Autodesk Forge model derivative API to translate models from different formats to SVF2 and display them in the Forge viewer.
The implementation follows the model derivative API step-by-step tutorial.
It works fine when translating 'rvt' and 'ifc' files. But no SFV2 viewables are available when translating 'dwg' files - although the translation seems to be successful.
We tried several 'dwg' files. We successfully translate and display our sample 'dwg' models using the Autodesk Construction Cloud. The translation of other formats like 'rvt' and 'ifc' work.
For the translation we use the following input
{
"input": {
"urn": $URN
},
"output": {
"formats": [
{
"type": "svf2",
"views": [ "2d", 3d"]
}
]
}
}
This is the manifest output for the 'architectural_example-imperial.dwg' from the Autodesk AutoCAD sample files
{
"type": "manifest",
"hasThumbnail": "false",
"status": "success",
"progress": "complete",
"region": "EMEA",
"urn": $URN,
"version": "1.0",
"derivatives": [
{
"name": "architectural_example-imperial[2024-03-19T10_55_00.577Z].dwg",
"hasThumbnail": "false",
"status": "success",
"progress": "complete",
"properties": {
"Document Information": {
"DWGVersion": "2010",
"Date Created": "12/3/2008 28:12:39 PM",
"FileSize": "148638",
"Last Author": "Brian",
"Last Write": "12/5/2008 8:42:32 PM",
"Name": "architectural_example-imperial[20024-03-19T10_55_00.577Z].dwg"
}
},
"outputType": "svf2",
"children": [
{
"guid": $GUID,
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:$URN/output/properties.db",
"role": "Autodesk.CloudPlatform.PropertyDatabase",
"mimei": "application/autodesk-db",
"status": "success"
}
]
}
]
}
It has completed successfully but no 2D/3D viewables are available. Also no viewables are available when loading the document in the Forge Viewer and running document.getRoot().getDefaultGeometry()
.
Is there something miss when translating DWG files?
We use timestamps for versioning the derivatives, eg architectural_example-imperial[2024-03-25T07:44:39.890Z].dwg
.
It turns out, if we replace the bracket characters (with eg "-") it works as expected.