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"]
}
]
}
}
Related
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
}
}]
I'm trying to upload a revit file with linked documents.
All the documents are in the same folder, and same bucket. ALL THE TIMES.
1 - You need to upload your files to the bucket. DONE!
2 - You need to Create References for the Composite Source File using this endpoint:
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-references-POST/
Ok, let's see if I can create a reference to a invalid file...
OK Forge recognized that one of my reference files did not exist!
Nice.
Now let's send valid files:
Ok, it should be fine.
Now let's go to the final step... Let's start the job to translate the file to SVF!
Forge says that the linked files are missing, why?
Here are the requests...
References:
{
"urn": "urn:adsk.objects:os.object:federado/PL076-ARQ-EMB.rvt",
"filename":"PL076-ARQ-EMB.rvt",
"references": [
{"urn":"urn:adsk.objects:os.object:federado/PL076-HID-EMB.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-INC-EMB.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-ACO-EMB.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-ARQ-TOR01-FAC.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-ARQ-TOR01-OPC01.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-ELE-EMB.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-ENG-EMB.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-EST-CORDOALHAS.rvt", "metadata": {"Teste":"Gabriel"}},
{"urn":"urn:adsk.objects:os.object:federado/PL076-EST-EMB.rvt","metadata": {"Teste":"Gabriel"}}
]
}
JOB
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZmVkZXJhZG8vUEwwNzYtQVJRLUVNQi5ydnQ",
"checkReferences": true
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}
As you can see, the first request uses URN's without encoding to Base64, and the second one uses the encoding on the URN parameter. That's because their documentation says it should be like this.
So, any guesses why the links are missing?
Unfortunately, the reference API of the Model Derivate doesn't support Revit files currently as I know. Please upload a ZIP that contains the host RVT and its links to Forge OSS and trigger a translation job with this request body:
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZmVkZXJhZG8vUEwwNzYtQVJRLUVNQi56aXA",
"compressedUrn": true,
"rootFilename": "PL076-ARQ-EMB.rvt"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}
If those models are uploaded onto your own managed Forge OSS bucket and they are not deleted yet, then you have to download all files included host and links and pack them to a zip and reupload again for translation.
Commonly, Forge OSS will delete all uploaded files automatically after 24hours with the transient bucket retention policy (the default policy in our codes samples and tutorials, you can change it as you want, see OSS Retention Policy page for details)
However, there is another way to see all your models in the same viewer scene - use Forge Viewer to load individual SVF model translated from your RVTs into the same scene. It’s well-known as the aggregate/multiple model scenario of the viewer. You can choose either way to achieve what you want.
BTW,
In multiple model scenario, you can obtain loaded models via accessing viewer.impl.modelQueue().getModels() and get selection set via viewer.getAggregateSelection().
If your models are translated from a zip, you can determine if it’s from linked files via the external id of the element you selected. The external id for the Revit model is the Element.UniqueId in Revit API. Each element in Revit has a unique GUID called UniqueId and be assigned when the element was placed to the Revit view.
In the Forge Viewer, you can obtain the item's external id via calling viewer.getProperties( dbId ). For item from links, the external will look like
65e0379f-2c38-40b3-b403-2979327abc7a-00080a4e/22858843-3747-4f42-8654-519948201028-000eaf08. There would be a / slash inside.
Hope it helps. Cheers!
We have a requirement from one of our clients to access the project files that are stored in the BIM360 Design (old Collaboration for Revit - C4R). I can not find any information in the developer pages of the Forge APIs that points to this location. I assume such an API is not part of Forge, but we were wondering if there is any other API that can provide those files.
The exact requirements are:
Constantly monitor for changes on the files located there.
When changes occur, retrieve and backup all those files to a local machine.
The question is, how, if possible, can we access the project files located at the BIM360 Design cloud?
UPDATE (10/04/2018)
We have found these commands - specifically PublishModel and GetPublishModelJob. This does something, we can at the very least prompt the publication on demand, without the need for Revit. It is not clear to me when the items:autodesk.bim360:C4RModel pseudo-file is created. On top of that, the API does not appear to be able to receive a prefered output folder, which makes it really cumbersome to work for the intended purpose of backing up the information inside BIM360 Design.
UPDATE (25/04/2018)
We have tried using both commands (PublishJob and GetPublishModelJob). We have impersonated a Project Admin (via the x-user-id) but Forge is returning a 401 error (which is not even documented). The following (with a redacted documentID) is what we have tried:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "commands",
"attributes": {
"extension": {
"type": "commands:autodesk.bim360:C4RModelGetPublishJob",
"version": "1.0.0"
}
},
"relationships": {
"resources": {
"data": [ { "type": "items", "id": "<document_id>" } ]
}
}
}
}
And this is Forge's response:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
Any thoughts?
After discussing with #tfrascaroli in Forge Help channel, we found the root cause of this error is caused by the incorrect value of x-user-id, so he didn't have the right permission to push the latest version of the C4R model to BIM360 docs.
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
The x-user-id is not a GUID and not the id we saw in the response of GET users or GET users/:user_id, it should be the value of the uid. After replacing the x-user-id value by the uid, the error doesn't show up again.
[
{
"id": "a75e8769-621e-40b6-a524-0cffdd2f784e", //!<<< We didn't use it for `x-user-id`
"account_id": "9dbb160e-b904-458b-bc5c-ed184687592d",
"status": "active",
"role": "account_admin",
"company_id": "28e4e819-8ab2-432c-b3fb-3a94b53a91cd",
"company_name": "Autodesk",
"last_sign_in": "2016-04-05T07:27:20.858Z",
"email": "john.smith#mail.com",
"name": "John Smith",
"nickname": "Johnny",
"first_name": "John",
"last_name": "Smith",
"uid": "L9EBJKCGCXBB", //!<<<<< Here is the value for the x-user-id
"image_url": "http://static-dc.autodesk.net/etc/designs/v201412151200/autodesk/adsk-design/images/autodesk_header_logo_140x23.png",
"address_line_1": "The Fifth Avenue",
"address_line_2": "#301",
"city": "New York",
"postal_code": "10011",
"state_or_province": "New York",
"country": "United States",
"phone": "(634)329-2353",
"company": "Autodesk",
"job_title": "Software Developer",
"industry": "IT",
"about_me": "Nothing here",
"created_at": "2015-06-26T14:47:39.458Z",
"updated_at": "2016-04-07T07:15:29.261Z"
}
]
Do you have an access right to the workshared Revit file? Publish command is to publish workshared central model in the cloud to Docs. To use it, you need an access to Revit model in the central in the cloud. Forge Publish command does the same thing as publish command in Revit desktop. You need the same access right. To use cloud workshared feature, first you need to have Design license assigned to you, then you also need to be a member a Revit project. Being invited to Docs is not enough.
(As C4R/Design was merged to Docs recently, this C4R specific license part was intentionally kept the same as previous licensing. We also have Team for earlier versions. It makes it a bit complicated. I hope it will be easier as we move forward in future.)
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.
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