Looking at the documentation for the Forge Post Job. The examples show that region is a sub object of destination. However the docs seem to show that they are on the same level.
Doc was uploaded as image.
Curl Request Example:
curl -X 'POST' \
[![enter image description here][2]][2]-H 'Content-Type: application/json; charset=utf-8' \
-H 'Authorization: Bearer PtnrvrtSRpWwUi3407QhgvqdUVKL'
-v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' \
-d
'{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA",
"compressedUrn": true,
"rootFilename": "A5.iam"
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}'
Thanks for reporting this.
I've let our Dev Portal team know to take a look and will get back to you once they fix this up. Thanks!
Related
I've trying to process a file that uploads+renders fine on the demo autodesk viewer (i.e. viewer.autodesk.com). The GetManifest result has a progress of "complete" but a status of "failed". If I dump the contents of the GetManifest() call I get the following which has Unrecoverable exit code from extractor: -1073741829 in the message. Wondering why it completes and renders on the online Autodesk viewer. The translation completes w\ "success", but when I try and get the manifest (so that I can download the derivatives), it fails on the GetManifest() call.
? manifest.ToString()
"{
\r\n "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6a2FodWFtb2RlbHMvOWNjNjA2Njg2NGIwNDViNDg5NjhhNDMxNjI1NmEzNTMuSUZD",
\r\n "derivatives": [
\r\n {
\r\n "hasThumbnail": "false",\r\n "name": "LMV Bubble",\r\n "progress": "complete",\r\n "messages": [
\r\n {\r\n "type": "error",
\r\n "message": "Unrecoverable exit code from extractor: -1073741829",
\r\n "code": "TranslationWorker-InternalFailure"\r\n }\r\n ],\r\n
"outputType": "svf",\r\n "status": "failed"\r\n }\r\n ],
\r\n "hasThumbnail": "false",\r\n "progress": "complete",\r\n "type": "manifest",\r\n "region": "US",\r\n "version": "1.0",\r\n "status": "failed"\r\n}"
Since this IFC model is IFC4, please use the modern conversion method instead.
curl --location --request POST 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--header 'x-ads-force: true' \
--data'{
"input": {
"urn": "{URN}"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"3d"
],
"advanced": {
"conversionMethod": "modern"
}
}
]
}
}'
IFC file generated from Revit seems to lose certain objects (particularly Rebars) when translated through Forge Model Derivative API. The same file looks OK on BIM 360.
Please use the switch loader option to use the Revit based IFC loader. This option is true by default on BIM360 e.g.
curl -X 'POST'
-H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization: Bearer PtnrvrtSRpWwUi3407QhgvqdUVKL'
-v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job'
-d
'{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL21vZGVsLmlmYw",
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"3d"
],
"advanced": {
"switchLoader": true
}
}
]
}
}'
ref: https://forge.autodesk.com/blog/model-derivative-ifc-pipeline-call-change
I am using changes API to track my G-Drive changes, but it's not giving the complete resource data. Can I use 'watch' API to poll my resources?
Below is my request for changes API:
curl -X GET \
'https://www.googleapis.com/drive/v3/changes?pageToken=46' \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Bearer <Token>' \
Here's the response:
"changes": [
{
"kind": "drive#change",
"type": "file",
"changeType": "file",
"time": "2019-10-10T09:15:12.313Z",
"removed": false,
"fileId": "<File_ID>",
"file": {
"kind": "drive#file",
"id": "<File_ID>",
"name": "shared",
"mimeType": "application/vnd.google-apps.folder"
}
}
]
But using this, I cannot decide the file is created or updated..
When you get a Changes resource, the response has a specific format.
You can see that the Changes has the property file that is of type Files.
What you want to do is inspect the Files resource returned by the change to monitor the state of the file between changes.
Hope this helps!
curl -X POST -vv -H "Fiware-Service: myHome" -H "Fiware-ServicePath: /environment" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"devices": [
{
"device_id": "0000000000000000",
"entity_name": "BedRoomSensor",
"entity_type": "multiSensor",
"attributes": [
{ "object_id": "t", "name": "Temperature", "type": "celsius" },
{ "object_id": "h", "name": "Humidity", "type": "degrees" }
]
}
]
} 'http://localhost:4041/iot/devices'
I execute the above curl commmand in order to provision my device.However it doesn't show anything and the command never ends.
What i missunderstood?
I have solved the problem following the first two steps of this guide:http://fiwaretourguide.readthedocs.io/en/latest/connection-to-the-internet-of-things/how-to-read-measures-captured-from-iot-devices/
In the step-by-step guide these steps weren't described.
In the second step i change the protocol fielde as "MQTT".
Now whenever i request the measures from my device i take the correct value.
I've been trying to use the Post references (https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-references-POST/) to set up the reference between two files in forge but although I get a message "success" as result when I try it on the forge viewer I still see the files separately even after I translate the models. Has someone been through the same issue?
Without seeing you code it is hard to tell what is happening. Below I copied my bash script code which references/translate an obj with material and texture.
Au.obj
+- Au.mtl
+- Au.jpg
After upload, I got these
idObj="urn:adsk.objects:os.object:cyrillejcrja/Au.obj"
idMtl="urn:adsk.objects:os.object:cyrillejcrja/Au.mtl"
idJpg="urn:adsk.objects:os.object:cyrillejcrja/Au.jpg"
the code to set references, now
urn=$(xbase64encode $idObj)
job='{
"urn": "'${idObj}'",
"filename": "Au.obj",
"references": [{
"urn": "'${idMtl}'",
"relativePath": "./Au.mtl",
"filename": "Au.mtl",
"references": [{
"urn": "'${idJpg}'",
"relativePath": "./Au.jpg"
}]
}]
}'
response=$(curl -H "Content-Type: application/json" \
-H "Authorization: ${bearer}" \
-X POST ${ForgeHost}/modelderivative/v2/designdata/${urn}/references \
-k -s -d "${job}")
Here is got a reply like below which only means that the references are registered.
{
"result": "success"
}
Now, I do this to translate the obj and use the references
urn=$(xbase64encode $idObj)
job='{
"input": {
"urn": "'${urn}'",
"checkReferences": true
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}'
response=$(curl -H "Content-Type: application/json" \
-H "Authorization: ${bearer}" \
-H "x-ads-force: true" \
-X POST ${ForgeHost}/modelderivative/v2/designdata/job \
-k -s -d "${job}")
Note the "checkReferences": true, as documented here.
Now, I can wait the translation to complete and see the result in the Viewer.
For reference the xbase64safeencode function used above
function xbase64safeencode () { local id64=$(echo -ne $1 | base64 $wrap_arg | tr -d '=' | tr '+/' '-_'); echo $id64; }
#Cyrille, this is my request:
curl -X 'POST' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsI' -H 'Content-Type: application/json' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/references' -d
'{
"urn": "urn:adsk.objects:os.object:bucket/non-existent.rvt",
"filename": "",
"references": [
{
"urn": "urn:adsk.objects:os.object:bucket/non-existent.rvt",
"relativePath": "",
"filename": ""
}
]
}'
I got as result:
'{
"result": "success"
}'
The point is I'm getting success as a result even when I do not have the specified file on the server, so I'd suggest few server-side validations, for example, when a model has been translated once we can't set as reference right so it should at least return an error. Thank you and I hope this helps.