Forge - Revit-UnsupportedFileType - autodesk-forge

I’m trying to integrate Forge viewer with my sample application and facing some issues.
Below are the steps I tried to achieve my goal.
Registered an app by creating a new account and generated “client ID” and “secret key” (success).
Generate Oauth token for further API calls (success).
Create a new bucket storage (success).
Upload model to the bucket and create URN for the model (success).
Design data for model translation (this is the step where our uploaded model will be translated to SVF) (success).
Check status of translated file. (success response but with error message as given below).
"messages":
[
{
"type": "error",
"code": "Revit-UnsupportedFileType",
"message": "The file is not a Revit file or is not a supported version."
},
{
"type": "error",
"message": "Possibly recoverable warning exit code from extractor: -536870935",
"code": "TranslationWorker-RecoverableInternalFailure"
}
],
Any help would be highly appreciated.

Are you able to upload & view the file using the public viewer? If so, most likely your upload routine (step 4) is corrupting the file. In this case, are you using resumable upload?
Samples for resumable upload:
C#
Nodejs

Related

Autodesk Forge - refPoint info in SQLLite db

I have 3 revit models on BIM360 and I want to view them in a Forge Viewer.
To do this, I aggregated the 3 models with the information provided at this link Revit shared coordinates to Forge viewer, and everything is OK.
I want to know if is possibile to get refPoint information in the model's SQLLite db (https://forge.autodesk.com/blog/accessing-design-metadata-without-viewer)
Is it possible?
TIA
Alder
Unfortunately, the refPoint data is extracted into AEC Model Data only. It's a JSON file. You can get see it in the model manifest via calling GET :urn/manifest and download it by using GET {urn}/manifest/{derivativeurn}
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sud2lwcH....x/output/Resource/AECModelData.json",
"role": "Autodesk.AEC.ModelData",
"mime": "application/json",
"guid": "a4aac952-a3f4-031c-4113-b2d9ac2d0de6",
"type": "resource",
"status": "success"
},
ref: https://forge.autodesk.com/blog/consume-aec-data-which-are-model-derivative-api

Continue error trying to change Google cloud trigger with REST APIs

I'm trying to change a trigger using REST API, specifically https://cloud.google.com/build/docs/api/reference/rest/v1/projects.triggers/patch. Note that I'm able to use curl and list all the triggers. Also I tried to download the trigger in JSON using https://cloud.google.com/build/docs/api/reference/rest/v1/projects.triggers/get (which works perfectly) but when I tried to upload the same file the error is always:
{
"error": {
"code": 400,
"message": "exactly 1 build config required, got: 0",
"status": "INVALID_ARGUMENT"
}
}
if I try to upload an invalid Json correctly it gives error parsing JSON, so surely it's trying to parse using JSON format.
So I tried the same experiment using "Try it!" button on Google page which opens Google APIs explorer. Same results. The interface gave me a warning that some fields are only output so I tried also to remove these fields but I got the same error.
The file I'm trying to upload is (changed some strings to remove company name)
{
"description": "Push to any branch",
"github": {
"push": {
"branch": ".*"
},
"owner": "company",
"name": "repo-utils"
},
"tags": [
"github-default-push-trigger"
],
"name": "default-push-trigger-127"
}
I think I found the issue. Google API seems to require either build or filename to be passed to specify a way to build. On the other hand the web interface allows to insert an Autodetect option for the build which will try to look for either cloudbuild.yaml or Dockerfile in the root directory. If you specify Autodetect on the web interface the Json configuration won't have either build or filename so when you try to import back that configuration it will fail.
I tried to pass filename as empty string, the web interface shows a cloudbuild.yaml (which is present) but the execution of the trigger fails.
So it seems there's no way to insert a Autodetect mode trigger using the API.

Derivatives API not returning Properties.db file

We have seen few times that the properties.db file is coming with the converted model when using the derivative APIs.
I also tried the extract node module and the zip file does not contain properties.db too.
is there any change in the api for retrieving that file?
regards,
Afshin
Unfortunately there's no specific API dedicated to retrieve the property DB file.
You can get its path by looking up the manifest after the model is completed extracted/translated and download it from there using the GET :urn/manifest/:derivativeurn endpoint:
{
"guid": "...",
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:<urn>/output/properties.db",
"role": "Autodesk.CloudPlatform.PropertyDatabase",
"mime": "application/autodesk-db",
"status": "success"
},
In case it's not generated let us know the URN by dropping a line to forge.help at autodesk.com so we can look into it.

Download a Document with Autodesk API

I'm trying to download documents from BIM 360 Docs. If I want to download a file with the type "type": "items:autodesk.bim360:File" I just need to get the bucketID and objectID (/projects/<projectID>/items/<itemID>) and call buckets/<bucketID>/objects/<ObjectID>. (I used this tutorial)
But how do I download a file with the type "type": "items:autodesk.bim360:Document"?
First, I get the version of the document /projects/<projectID>/items/<itemID>/versions. After that I call projects/<ProjectID>/versions/<versionID>/downloadFormats but it returns an empty JSON. The call projects/<ProjectID>/versions/<versionID>/downloads returns a 400 Bad Input. Whats the right way to get the bucket & objectID from a "document"? The way from the tutorial doesn't work because there is no "storage" tag in the JSON (example).
For BIM 360 Project Folder items, follow the tutorial here to download document.
Basically you will need to obtain the URN of the document from the relationships.storage.data.id field via GET projects/:project_id/folders/:folder_id/contents.
For item type items:autodesk.bim360:Document, call GET projects/:project_id/versions/:version_id/relationships/refs to obtain the storage locations:
"storage": {
"meta": {
"link": {
"href": "/oss/v2/buckets/wipbucket/objects/urn:adsk.objects:os.object:wip.dm.prod%2F9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.pdf"
}
}
See doc here.

Unable to get revit filemeta data or see revit model in 3d viewer for forge modelderivative API

We have been using the model derivative api endpoints to extact data from forge but are currently having issues extracting meta data when uploading specifically Revit files.
Our process goes:
Auth
Upload a model in chunks https://developer.api.autodesk.com/oss/v2/buckets/{bucketKey}/objects/{objectName}/resumable
Create upload job https://developer.api.autodesk.com/modelderivative/v2/designdata/job
Get translation the process https://developer.api.autodesk.com/modelderivative/v2/designdata/{encodedUrn}/manifest
Get the object from the forge https://developer.api.autodesk.com/modelderivative/v2/designdata/{encodedUrn}/metadata
Current we are we receive a 200 response from step 5 with and empty meta information so we cannot extract anything.
When we load the 3D viewer (versions 6.0 and 4.0) the viewer calls the https://developer.api.autodesk.com/derivativeservice/v2/manifest/
When
"messages": [
{
"type": "error",
"code": "Revit-UnsupportedFileType",
"message": "<message>The file is not a Revit file or is not a supported version.</message>"
},
{
"type": "error",
"message": "Possibly recoverable warning exit code from extractor: -536870935",
"code": "TranslationWorker-RecoverableInternalFailure"
}
],
It was converted from an ifc format if that helps in any way.
We have tried this file in 360 and in forge with both revit and ifc before and translation has worked. I can provide a urn also.
As reported by #Glenit, it was missing some pieces on the resumable upload. For reference, this answer points out some samples on it.