I am trying to load Inventor projects into my Bucket and display them in the Forge Viewer.
For this I downloaded the Inventor example project (Jet Engine Model).
I want to view it in the Forge Viewer just like here (https://forge-digital-twin.autodesk.io/).
I can upload single parts (.ipt) of the project onto my bucket without any problems. But I want to upload and view the whole project (like i do with Revit projects).
When I save the Inventor project as "Pack and Go" and upload the .zip file I get an error message:
{
status code: 400,
statusMessage: 'Bad Request',
statusBody:
{ diagnostic: 'Failed to trigger translation for this file. }
}
Uploading .zip files of Revit (.rvt) or 3D Max (.f3d) Projects works fine.
Unfortunately I have not found anything suitable for this, so I am writing here now.
Is there an example project where I can see how to view whole Inventor projects in the Forge Viewer without linking every .ipt part manually?
I'm not sure how the Inventor "Pack and Go" feature builds the zip file, but please note that when sending zip files to Model Derivative service for translation, the main design file must not be in any subfolder. The contents of the archive could look like this:
- inventor-project.zip
- root-design-file.iam
- some-part-1.ipt
- subfolder
- some-part-2.ipt
- some-part-3.ipt
In this case, the payload to the POST job endpoint should look like this:
{
"input": {
"urn": "<urn of your zip file>",
"compressedUrn": true,
"rootFilename": "root-design-file.iam"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}
Related
I have my own Forge APP now, but after I upload those rvt files I hope to get all of the URLs of those files. Can it be possible?Hope to get Url data automatically. Appreciate for all comments. enter image description here
What kind of URL link do you want? The UI in your snapshot looks like the Fusion Team/BIM360 Team. So, I supposed that you want to view the model with Forge Viewer or download the Revit source file.
To access data of the Fusion Team/BIM360 Team, you can refer to View Hub Model tutorial.
To get data of your Revit files uploaded to the Fusion team, you will need to use those endpoints of Forge Data Management API
GET hubs -> HubsApi#GetHubs
GET projects -> ProjectsApi#GetHubProjects
GET topFolders -> ProjectsApi#GetProjectTopFolders
GET folder contents -> FoldersApi#GetFolderContents
Afterward,
To view the Revit model with Forge View, you need to find the derivative urn under either version tip of the file by this path relationships.derivatives.data.id. e.g.
"derivatives": {
"data": {
"type": "derivatives",
"id": "dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnlDV0dSdUhnUW5PeENIdk1oalQxZEE_dmVyc2lvbj0x"
},
"meta": {
"link": {
"href": "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnlDV0dSdUhnUW5PeENIdk1oalQxZEE_dmVyc2lvbj0x/manifest?scopes=global"
}
}
},
To download the Revit source file, you need to find the storage id under either version tip of the file by this path relationships.storage.data.id. e.g.
"storage": {
"data": {
"type": "objects",
"id": "urn:adsk.objects:os.object:wip.dm.prod/0213357d-03b1-4ab1-95f6-bff154b775ae.ifc"
},
"meta": {
"link": {
"href": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/0213357d-03b1-4ab1-95f6-bff154b775ae.ifc?scopes=global"
}
}
}
Lastly, please be noted models stored on the Fusion Team/BIM360 Team is on demand translation. Before viewing the model with Forge Viewer, you must open the overview page of the model on your Fusion Team/BIM360 Team project's Web UI like the below, and ensure that here no veiw is loading, then you’re fine to open the model with Forge Viewer, Otherwise, it means your model translation job is still processing.
I hope you all are well. I have been trying to use the Forge reference application template to be able to make a heat map for a building (I have the .RVT file for it).
However, whenever I try to run this github.com/weshinchman/forge-dataviz-testrepo it just displays the following page on my local host.
Please let me know if you have had similar problems or if you know how to fix this. Thanx
Please see the snapshot I shared here: https://stackoverflow.com/a/72951088/7745569
The CSV settings in .env file work without any problem on my side.
ADAPTER_TYPE=csv
#CSV_MODEL_JSON=server/gateways/synthetic-data/device-models.json
#CSV_DEVICE_JSON=server/gateways/synthetic-data/devices.json
#CSV_FOLDER=server/gateways/csv/
CSV_DATA_START=2011-02-01T08:00:00.000Z
CSV_DATA_END=2011-02-20T13:51:10.511Z
#CSV_DELIMITER="\t"
#CSV_LINE_BREAK="\n"
#CSV_TIMESTAMP_COLUMN="time"
#CSV_FILE_EXTENSION=".csv"
To make the app work with more sensors, you must add individual CVS files named with the device ids of devices.json to server/gateways/csv. For example, the Hyperion-1.csv is for the below device.
{
"id": "Hyperion-1",
"name": "Conference 103",
"position": {
"x": "26",
"y": " -63",
"z": " -9.6"
},
"lastActivityTime": "2020-10-15T02:43:06.4432973Z"
},
For Hyperion-24, you must have a CSV file named as Hyperion-24.csv under server/gateways/csv.
We have a Revit model where we have configured a single 3D View in Publish Settings. We published that model to BIM 360 and are using Forge to extract the list of 3D Views.
We notice that after the model is translated, the only views available in BIM360 are the views included as set in the Publish Settings in Revit, irregardless of phase, but are under the Phases icon, when we extract the Views from the manifest we also get additional views that were created because some objects belong to different Phases. We don’t seem to be able to distinguish between the different views or see a relationship between different phases of the same view.
Is there a way to do that? or not to translate the additional phase views at all?
The extract below shows us the {3D} view and the Phase Views created “Existing” and “New Construction” using GET
https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/manifest
Manifest:
Those phased 3D views are from the mater view for each phase, you can suppress them by submitting translation jobs like below:
// POST https://developer.api.autodesk.com/modelderivative/v2/designdata/job
// with `x-ads-force: true` Reuest header
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRuZGVtby9ob3VzZS5ydnQ"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
],
"advanced": {
"generateMasterViews": false
}
}
]
}
}
Note. The generateMasterViews option in BIM360 Docs is turned on by default and the translation job will be submitted automatically while the model was uploaded to Docs managed bucket successfully, currently.
Note 2. Triggering any translation jobs yourself on the models of the BIM360 Docs will consume extra Forge Cloud Credits. So, you have to use it carefully at your own risk.
Ref: https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/#body-structure
I've extracted the the folder content from bim 360:
Result
{
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:huksL2JVQ2Gy4n4EEOY9Mg",
"attributes": {
"displayName": "4storeyy.ifc",
...
"data": {
"sourceFileName": "4storeyy.ifc"
}
}
},
}
The id (URN) is the same as the one in the URL when I view it in BIM 360.
If I use the URN in my custom viewer, it does not work.
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sud2lwcHJvZDpkbS5saW5lYWdlOlgyOU1ydUhZUWJXV21feE1MNndLZmc=/manifest gives not found
Is this how you should do it if you want to read the model from BIM 360? If so, what can am I doing wrong?
Or do I need to run download it, translate it before reading it?
Yes you will need to translate the model before being able to load it on Viewer.
Simply follow the usual steps here except that you shouldn't need to download and upload the model again and can use the ID on wipprod for translation straight away.
I want to monitor the progress of an extraction job of a file stored in a bucket.
I've gone through the Webhooks API documentation, and if I understood everything correctly, the events only work for files stored in a folder, so it can't be used with a bucket. Please correct me if I'm wrong.
So, besides polling the GET :urn/manifest endpoint in the Model Derivate API, and assuming the Webhooks API can't be used with a bucket, is there any other way to monitor the progress of an extraction job?
Thanks.
Webhook now supports the Model Derivative event extraction.finished. This type is exactly used in the scenario of translating model of the bucket.
This is a blog on the API. I copied it as a reference on SO:
https://forge.autodesk.com/blog/introducing-webhook-model-derivative-api
Webhook now supports the Model Derivative event extraction.finished, so your app can be notified when translation job finishes.
To use it, (1) create a hook specifying a scope.workflow:
{
"callbackUrl": "http://bf067e05.ngrok.io/callback",
"scope": {
"workflow": "my-workflow-id"
}
}
And (2) when posting a translation job, specify the misc.workflow:
{
"input": {
"urn":
"dXJuOmFkc2sub2JqZWN0czpv...."
},
"output": {
"formats": [{
"type": "obj"
}]
},
"misc": {
"workflow": "my-workflow-id"
}
}
With my test, the workflow can be guid of your WebHook.The post body from Forge will tell you which file is translated and its urn, location etc.
Hope it helps.