Autodesk Forge import IFC failed - autodesk-forge

our customer try to show IFC model through method https://developer.api.autodesk.com/oss/v2/buckets/bucket_name/objects/model_name. IFC model is huge, about 100km, it is road design. He can't show it in Forge, he got error that model is empty, although it has 120MB. Model is in IFC4. Has You any documentation to supported IFC classes, or model size to show in FOrge ? He try to divide model to smaller parts, but nothing happen.
Milan Nemec, Graitec

A few things to check:
Did you call the conversion job to translate the IFCs to SVF first? Using this endpoint here?
Is the conversion completed? Try here to query the progress.
And if everything works out the manifest response should contain SVF derivatives similar to:
{
"type": "manifest",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"region": "US",
EDIT
For IFC models exported from Revit try switch to the IFC loader by specifying in your job payload:
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c2JzYjIzMzMvc2JiLmlmYw"
},
"output": {
"formats": [
{
"type": "svf",
"views": ["3d", "2d"], "advanced": {
"switchLoader": true
}
}]

Related

Autodesk - Model Properties API - Out of Memory

Autodesk Construction Cloud - Model Properties API.
I'm trying to index and query uploaded Navisworks model. The model size is 241Mb.
When trying to index the properties the indexing fails as follows:
"indexes": [
{
...
"type": "INDEX",
"state": "FAILED",
...
"errors": [
{
"type": "RuntimeError",
"title": "OutOfMemoryException",
"detail": "Exception of type 'System.OutOfMemoryException' was thrown."
}
]
}
]
Does the indexing has a limit on Autodesk Backend?
What could be done in such case?

Is there an option for translate to SVF viewer using Design Automation API

Im just looking if is possible to create an SVF Viewer using Design Automation API and avoiding Model Derivative API.
Months ago I had a talk with the Forge support team and they told me that due to the amount of translates, for an economic issue it was convenient for me to use Design Automation.
Thanks in advance
Unfortunately, SVF translation on Design Automation API is not supported currently as I was told, except for AutoCAD. You may use this activity to generate SVF with the Design Automation API for AutoCAD:
{
"commandLine": [
"$(engine.path)\\accoreconsole.exe /i $(args[HostDwg].path) /al $(appbundles[Publish2View22].path) /s $(settings[script].path) /suppressGraphics"
],
"parameters": {
"HostDwg": {
"verb": "get",
"description": "Host drawing",
"required": true,
"localName": "$(HostDwg)"
},
"Result": {
"zip": true,
"verb": "post",
"description": "Results",
"required": true,
"localName": "result"
}
},
"id": "AutoCAD.AcSvfPublish+prod",
"engine": "Autodesk.AutoCAD+22",
"appbundles": [
"AutoCAD.Publish2View22+prod"
],
"settings": {
"script": {
"value": "(command \"_prepareforpropertyextraction\" \"index.json\")\n(command \"_indexextractor\" \"index.json\")\n(command \"_publishtosvf\" \"./output/result.svf\")\n(command \"_createbubblepackage\" \"./output\" \"./result\" \"\" \"\")\n"
}
},
"description": "AutoCAD translation sample generating SVF via core console.",
"version": 4
}
The 3ds Max engine also support generating svf file(s). You should be able to easily write a script to export to svf and execute it in Design Automation.
See this documentation on how to export in maxscript:
https://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=GUID-624D3D05-B15D-4A97-9F15-DA35CDB0DDD2#GUID-624D3D05-B15D-4A97-9F15-DA35CDB0DDD2__SECTION_EB566E2CC6444FCEAD2EE67BB366F727
See this tutorial on how to execute a script in Design Automation for 3ds Max:
https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/3dsmax/

Autodesk Model Derivative API - Can't translate my revit file

I'm doing this tutorial from here:
I have a sample revit file from revit itself, I saved it as: test1.rvt
I get my access token [it works]
I create my bucket [it works]
I check if my bucket exists [it works]
I upload test1.rvt [it works]
I translate the file with the urn, encoded in 64bit [result: success]
I verify the translation [it fails]
I don't understand my problem here. The eror says:
The file is not a Revit file or is not a supported version
But I have tried with the revit file from the homePage (revit 2017 and 2018) so what can be my problem here?
Just verified your revit file, it's working good with the translation service, here is my body of translation job API:
{
"input" : {
"urn": "dXJuOmFkc2sub2JqZWN0c*******m9uc29mdHdhcmV3b3Jrc2hvcDIvdGVzdHJ2dC5ydnQ"
},
"output" : {
"force": "true",
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": ["2d", "3d"]
}
]
}
}

Autodesk Forge Viewer get bucket files to display multiple views

Does anyone know if it is possible to get all the bucket files data in some kind of array or similiar? I'm thinking of building a viewer where you can load a different view, containing a different model, when the user clicks on the desired model (thumbnail)
Yes if I do not misunderstand your requirement. You can get all your buckets by GET buckets API, you will get an bucket array like this:
{
"items": [
{
"bucketKey": "mybucket1",
"createdDate": 1508056179005,
"policyKey": "persistent"
},
{
"bucketKey": "mybucket2",
"createdDate": 1502411682779,
"policyKey": "transient"
},
{
"bucketKey": "mybucket3",
"createdDate": 1502420840319,
"policyKey": "transient"
}
]
}
Then, you can iterate all these buckets to get all the files under each bucket by GET buckets/:bucketKey/objects API, it will provide you an array of items like this:
{
"items": [
{
"bucketKey": "mybucket1",
"objectKey": "mytestbim1.rvt",
"objectId": "urn:adsk.objects:os.object:mybucket1/mytestbim1.rvt",
"sha1": "248205b7609ca95c04e4d60fee2ad7b6bd9a2uy2",
"size": 17113088,
"location": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket1/objects/mytestbim1.rvt"
},
{
"bucketKey": "mybucket1",
"objectKey": "mytestbim2.rvt",
"objectId": "urn:adsk.objects:os.object:mybucket1/mytestbim2.rvt",
"sha1": "248205b7609ca95c04e4d60fee2ad7b6bd8a2322",
"size": 17113088,
"location": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket1/objects/mytestbim2.rvt"
}
]
}
The most important value is the "objectId", it will be the urn after base64 encoded, you can get all the derivative with this urn, and also you can load the urn in Forge Viewer after it's translated to SVF.
We have an code example of Forge Node.js Boilers, and you can check the project 5 to see if that is something you are interested.
Hope it helps.

Failed to trigger translation for DWF files to STEP

I’m trying to translate my .DWF file to STEP using the Model Derivative API:
{
"input": {
"urn":"<<DWF URN HERE>>"
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "step"
}]
}
}
But the request fails with this reply:
{
"diagnostic": "Failed to trigger translation for this file."
}
Am I missing anything here?
STEP export format is currently not available for DWF files :(
Here you can find a list of all the design file formats and the export file format supported for them:
https://developer.autodesk.com/en/docs/model-derivative/v2/overview/supported-translations/
You can also access this information programmatically from here:
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/formats-GET/
Cheers,
Adam