Failed to trigger translation for DWF files to STEP - autodesk-forge

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

Related

"Failed to trigger translation for this file." error when uploading a .zip file for the translation job

What I'm doing is uploading a .zip file and creating a translation job. The .zip file contains several .CATPART files and one .CATPRODUCT file.
bellow is my payload
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6emlwX2ZpbGVzX3Rlc3RpbmcvQU1GMV8wNC56aXA",
"rootFilename": "17J20-0851---B.1.CATProduct",
"compressedUrn": true
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "stl",
"advanced":
{
"format" : "binary",
"exportColor":true,
"exportFileStructure" : "single"
}
}
]
}
}
but I'm keep getting the error "Failed to trigger translation for this file.".
I even tried uploading and translation using the provided postman collection but the result is same
However i tried uploading the whole folder(not as a zip of course) to the Autodesk viewer and it works. So i dont think there is an issue in the set of files.
What could be the reason ??
You can find the list of supported translations here:
https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/supported-translations/
Unfortunately, you cannot translate a CATPART/CATPRODUCT to STL - you can only get a thumbnail, SVF, or SVF2 from it
Once you translated it to SVF, you'll also be able to get OBJ from it. This option is available for all file formats.
I managed to solve this with the help of #Adam's reply ,
So i changed the type to "svf"
"type": "stl"
and added the views
"views": [
"2d",
"3d"
]
and it worked .
my final payload would be ,
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6emlwX2ZpbGVzX3Rlc3RpbmcvQU1GMV8wNS56aXA",
"rootFilename": "17J20-0851---B.1.CATProduct",
"compressedUrn": true
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf2",
"advanced":
{
"format" : "binary",
"exportColor":true,
"exportFileStructure" : "single"
},
"views": [
"2d",
"3d"
]
}
]
}
}
Hope this helps anyone in future .

Autodesk Forge import IFC failed

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
}
}]

{fault.name} - The client_id specified does not have access to the api product

I'm following this tutorial :
https://developer.autodesk.com/en/docs/model-derivative/v2/tutorials/prepare-file-for-viewer/
In previous steps, I get the token, get a token for bucket, create one and upload a file in it.
But, when I try, on the next step, to convert my file to svg, I get this message :
{fault.name} - The client_id specified does not have access to the api product
In Postman, I've do that :
POST https://developer.api.autodesk.com/modelderivative/v2/designdata/job
-- Header
Content-Type:application/json
Authorization:Bearer eyJhbGciOiJIUzI1...
-- Body
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGV2c3RlZWxidWNrZXQvc2t5c2NwcjEuXXXX"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}
And I do not find any solution in Google.
You need to activate your account.
If you face same issue even after activating your account, another possibility could be-
you might have missed "Model derivative API" while creating forge APP.

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"]
}
]
}
}

Defining Azure Stream Analytics iot-hub input source through Powershell

I'm trying to write a powershell script that creates a new streamAnalytics job in my azure portal account, with input source as iot-hub and output source as blob storage account.
To do so, I'm using AzureRM command new-streamAnalyticsJob, and json files.
my problem is: I have not seen any documentation or example for json file where the inputs source is iot-hub. only event-hub.
what are the parameters I need to give in the json file? can anyone display an example for json file with input source to streamAnalytics job as Iot-hub?
I got the answer eventually: the required field I had to add to the inputs Oliver posted earlier here is:
"endpoint":"messages/events"
I added it under Datasource Properties section, and it works fine!
Thanks Oliver
To come back on the error message you are seeing, to add to Olivier's sample you need a Property named endpoint which corresponds to the endpoint in IoT Hub. If you are looking for Telemetry messages this will be:
"endpoint": "messages/events"
This can be found in the schema for Azure ARM: https://github.com/Azure/azure-rest-api-specs/blob/current/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/2016-03-01/examples/Input_Create_Stream_IoTHub_Avro.json
So to complete Olivier's example, when using API version '':
"Inputs": [
{
"Name": "Hub",
"Properties": {
"DataSource": {
"Properties": {
"consumerGroupName": "[variables('asaConsumerGroup')]",
"iotHubNamespace": "[parameters('iotHubName')]",
"sharedAccessPolicyKey": "[listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey]",
"sharedAccessPolicyName": "[variables('iotHubKeyName')]",
"endpoint": "messages/events"
},
"Type": "Microsoft.Devices/IotHubs"
},
"Serialization": {
"Properties": {
"Encoding": "UTF8"
},
"Type": "Json"
},
"Type": "Stream"
}
}
],
That'd look like the following for the inputs part of the ASA resource:
"Inputs": [
{
"Name": "IoTHubStream",
"Properties": {
"DataSource": {
"Properties": {
"consumerGroupName": "[variables('CGName')]",
"iotHubNamespace": "[variables('iotHubName')]",
"sharedAccessPolicyKey": "[listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey]",
"sharedAccessPolicyName": "[variables('iotHubKeyName')]"
},
"Type": "Microsoft.Devices/IotHubs"
},
"Serialization": {
"Properties": {
"Encoding": "UTF8"
},
"Type": "Json"
},
"Type": "Stream"
}
}
]