2
votes

In v1 of Data and View API I had to upload all files and link them together using

references/v1/setreference

and after that register each of them for translation. This had an advantage that I could display in the viewer every linked file alone or all linked together. Also I could associate 3D and 2D views with each file in my database.

In API v2 I need to send a POST JOB using

modelderivative/v2/designdata/job

Where I pass urn urn of an object which has been uploaded in zip format and given rootFilename. So far, ok. I do not have to care about references, that's cool, less work. But none of JSONs I can get using model derivative api contains information about urns of linked files and their views(of others than rootfile). So where are they?

Example scenario: (was possible in API v1)

Let's say I want to upload ZIP containing 3 revit files linked together

  1. master - house.rvt
  2. hvac - hvac.rvt
  3. electro - electro.rvt

Master references hvac and electro and both hvac and electro cross-references the master.

Then I will upload a zip file, succesfully translate into SVF and now I want to display in the viewer hvac.rvt, not master with all together! Hvac.rvt has cross reference to master with turned off visibility in 3D views:

When I tried this, I can access only 3D and 2D views of the master. There are no views from linked files even they exists in the files and were accessible before.

manifest: modelderivative/v2/designdata/:urn/manifest

metadata: modelderivative/v2/designdata/:urn/metadata

even full info: viewingservice/v1/{urn}/all

none of them contains any information about linked files. Only exception is designDescription.json(when downloading full bubble) there is mentioned that model has links and which ones.

Example (real case):

{
"name" : "Autodesk Design Description",
"version" : "0.1",
"designDescription" : {
    "id" : "f75c0132-b0cf-42dd-9ef9-b0a3d7be0669",
    "name" : "My XRef File Design",
    "currentVersion" : "1",
    "designGraphs" : [{
            "creationDate" : "2016-07-30 13:24:33",
            "creatingService" : "RVT LMV Extractor XRef",
            "rootIds" : [1],
            "designObjectRefs" : [],
            "designObjects" : [{
                    "id" : 1,
                    "version" : 0,
                    "about" : "urn:adsk.objects:os.object:bucket/Model.zip",
                    "relativePath" : "MainModel_A.rvt",
                    "displayName" : "MainModel_A.rvt",
                    "contentType" : ".rvt",
                    "shareInfo" : null,
                    "references" : [{
                            "type" : "x-ref",
                            "ids" : [2]
                        }
                    ],
                    "metadata" : {}

                }, {
                    "id" : 2,
                    "version" : 0,
                    "about" : "",
                    "relativePath" : "MEPModel_B.rvt",
                    "displayName" : "MEPModel_B.rvt",
                    "contentType" : ".rvt",
                    "shareInfo" : null,
                    "references" : [{
                            "type" : "x-ref",
                            "ids" : [3]
                        }
                    ],
                    "metadata" : {}

                }, {
                    "id" : 3,
                    "version" : 0,
                    "about" : "urn:adsk.objects:os.object:bucket/Model.zip",
                    "relativePath" : "MainModel_A.rvt",
                    "displayName" : "MainModel_A.rvt",
                    "contentType" : ".rvt",
                    "shareInfo" : null,
                    "references" : [],
                    "metadata" : {}

                }
            ]
        }
    ]
}

}

but again there is no location for linked file. There is a property "relativePath" but leads to where?

Documentation at https://developer.autodesk.com says almost nothing about working with referenced files..

How do I fulfill this scenario again? (Before changes this was already implemented functionality of bigger application almost ready for distribution) Now I have to upload same files multiple times for each linked file? Or how? Please, any ideas?

2

2 Answers

1
votes

Solution to this is to upload to the bucket same zip file under different name for each linked file (you can omit files which are irrelevant particular linked file), then call a post job for each zip file with another file name inside as rootFilename. rootFilename property does not have to be real root of the revit model design. That will provide urn access to each linked file and allow a bubble to be downloaded.

0
votes

You'll find the same behaviour in the A360 UI that the new API is following as well: you have to upload the various components together and then the main component will get translated.

So, yes, at the moment it seems you would have to upload each file that you want to translate (for viewing or into other formats) in addition to uploading them in a zip for the main Revit file translation.

I've passed on your comments to engineering about your missing the functionality that was available in the v1 API. Unfortunately, I cannot promise anything at the moment about when/if this functionality will be implemented in the v2 API.

Sorry for the inconvenience it causes.