How to differentiate Revit Models in BIM360 that are live versus copies - autodesk-forge

We do a lot of scanning of BIM360 projects using Forge Data Management - our goal, in many cases, is to identify files that can be opened "live" in Revit via BIM Collaborate Pro (or now with Design Automation).
We have historically looked for the presence of ModelGuid and ProjectGuid within the version/attribute data - but we've started to run into more and more scenarios where "Copies" of this published model (such as Shared, Consumed, or for Model Coordination) ALSO have the ModelGuid and ProjectGuid - but you can't open those files "live" (or if you do, you're opening "something else").
So my question boils down to - with Forge:
Can you identify whether a ForgeDM item corresponds to a live model (and is not a copy).
In the absence of that, could you at least be able to identify Shared, Consumed or Model Coordination folders (so that you could KNOW that those are copies).
"data": {
"modelVersion": 30,
"isCompositeDesign": true,
"mimeType": "application/vnd.autodesk.r360",
"compositeParentFile": "Medical Office Architect.rvt",
"projectGuid": "f1451983-e2f5-47df-970e-05e63dded686",
"originalItemUrn": "urn:adsk.wipprod:dm.lineage:UaVTyWQxRyGezYpTePIYMw",
"modelType": "multiuser",
"latestEpisodeGuid": "cf78ab51-5a9f-45f6-8e8a-412fb9119090",
"modelGuid": "3d348036-c6f8-4686-849b-8aac6f94e545",
"processState": "PROCESSING_COMPLETE",
"extractionState": "SUCCESS",
"splittingState": "NOT_SPLIT",
"reviewState": "NOT_IN_REVIEW",
"revisionDisplayLabel": "13",
"sourceFileName": "Medical Office Architect.rvt",
"conformingStatus": "NONE"
}

Related

Capture Autodesk Forge Url by C#

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.

How to Add File Reference to Quality Issue

Via the BIM360 API, I am able to create Quality Issues and upload files (to be used as attachments). However, even though I am calling Post Attachments (https://forge.autodesk.com/en/docs/bim360/v1/reference/http/field-issues-attachments-POST/) (and all responses are good), nothing appears on the Issue screen.
Issue screen with manually added file. How can I make my attached file appear under the References->Files section?
(Note, I saw a mention elsewhere of the relationships API, but I get a random error just calling the first "asset" API [{"title":"Forbidden","detail":"Forbidden","errorCode":"GENERAL_ERROR","type":"https://developer.api.autodesk.com/bim360/assets/v1/error-codes/GENERAL_ERROR"}])
firstly, the screenshot shows you are working with Issues in Autodesk Construction Cloud (ACC), while the API you are using is for BIM360 Issue. This API is NOT compatible with ACC.
To work with ACC Issue, the API is available at the category of ACC:
https://forge.autodesk.com/en/docs/acc/v1/reference/http/issues-issues-GET/
this blog tells more.
https://forge.autodesk.com/blog/acc-issues-api-available-preview
In the context of ACC, the attachment(references) is managed by the general API (Relationship API). In Additional Tests of Postman collection of ACC Issue API, I demoed how to add Photo with the Issue. The logic is similar.
https://github.com/Autodesk-Forge/forge-acc.issues.api-postman.collection
Firstly, use Data Management API to get the document urn. Then, use ACC Issue API to get id of one issue. finally, use Relationship API to bind them.
PUT https://developer.api.autodesk.com/bim360/relationship/v2/containers/{{project_id_without_b}}/relationships
P.s. -bim360- in the domains is just because of legacy design of the terminologies. It can work for the contexts of both BIM360 and ACC (note it is Relationship API can work within both of the contexts)
Payload:
[
{
"entities": [
{
"domain": "autodesk-bim360-issue",
"type": "issue",
"id": "{{one_issue_id}}"
},
{
"domain": "autodesk-bim360-documentmanagement",
"type": "documentlineage",
"id": "{{one_document_urn}}"
}
]
}
]

ModelDeriviate's manifest is missing URN for SVF2

I know that it is possible to download the derivatives via their respective urns. However, the SVF2 object in the manifest doesn't contain its urn. Therefore, I cannot download the derivative as explained here or here. Is this not supported yet? And can I compute the urn from the data returned in the manifest?
Extract of an manifest example:
{
"urn": "SOME_URN",
"derivatives": [
{
"hasThumbnail": "true",
"children": [
{
"useAsDefault": true,
"role": "3d",
"hasThumbnail": "true",
"children": [
{
...
},
{
...
},
{
"role": "graphics",
"mime": "application/autodesk-svf2",
"guid": "SOME_GUID",
"type": "resource"
}
],
I'd like to make clear that it is possible to download the SVF2 'files' since your WEB browser can do it; therefore, you can access the data as well. The files are actually cached in your Browser, see below.
The Viewer downloads an extra manifest files (otg_model.json) which contains additional information. But downloading the 'files' on your local machine will not help since it requires a lot of setup to get the Viewer work properly with a local SVF2 storage. And with the current state of the technology, it is highly recommended you do not try to do this in production. When it comes to development, and debugging, I go a sample posted here which can help. But please be careful with the Autodesk EULA on doing offline workflows. This sample is a replacement of the old extract.autodesk.io sample as people were abusing of this website, and can work with both SVF and SVF2.
To answer the question in the comment section. SVF2 is still in beta, and access to the underlying data/files will probably be only available at the end on the beta. The main reason is that SVF2 and the Viewer code evolves too rapidly today to make a general availability to everything. So unless you keep updating them on your local machine, things may break, and therefore Autodesk is limiting the access.
Sorry for disappointing you, but ...
Unfortunately, it's expected behavior. SVF2 doesn't have a concept of URN, and you cannot download SVF2 for offline viewing at this moment since it's unsupported.

Phase Views in manifest after RVT model translation, how to detect or suppress?

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

Autodesk Forge retrieve/update custom attributes

We are using BIM360 docs and we have defined several custom attributes to tag those files uploaded into the docs folder. Now we are having trouble to get those custom attribute using forge API, projects/:project_id/items/:item_id endpoint only returns those default attribute like file name/description but for custom attributes it's not included in the response, neither can i update those custom attributes use PATCH to update those custom attributes.
Does Autodesk Forge API support getting/updating custom attributes?
The attribute node I got from the item API looks like this:
"attributes": {
"name": "somefile.rvt",
"displayName": "somefile.rvt",
"createTime": "2018-08-02T18:16:59.0000000Z",
"createUserId": "creatorID",
"createUserName": "usercreate",
"lastModifiedTime": "2018-11-01T10:46:20.0000000Z",
"lastModifiedUserId": "userid",
"lastModifiedUserName": "username",
"versionNumber": 1,
"extension": {
"type": "versions:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"viewableId": "id",
"viewableGuid": "id",
"viewableName": "Existing",
"sourceFileName": "somefile.rvt"
}
}
}
Thanks.
AFAIK, the information of folder/file is provided by Forge Data Management API, this API is used as a common access to many different Autodesk SAAS app like A360 Personal, BIM 360 Team, Fusion Team (formerly known as A360 Team), BIM 360 Docs.
Unfortunately, since the custom attributes are specified only for BIM360 Docs(correct me if I am wrong), so the Folder/Item API of Forge Date Management does not provide that information yet. I am also checking with our engineering team to see if any other information, or this could be a good API request, will update this if I got more information.