如何访问其他引用文件(urn)和视图,当上传为zip文件并转换为SVF时?

时间:2022-05-12 16:04:31

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

在数据和视图API的v1中,我必须上传所有的文件并将它们链接在一起

references/v1/setreference

引用/ 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.

然后把每一个都登记起来进行翻译。这有一个优点,我可以在查看器中单独显示每个链接的文件,或者所有链接在一起的文件。我还可以将3D和2D视图与数据库中的每个文件相关联。

In API v2 I need to send a POST JOB using

在API v2中,我需要使用一个POST作业

modelderivative/v2/designdata/job

modelderivative / v2 / designdata /工作

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?

在其中,我传递一个对象的urn urn,该对象以zip格式和给定的rootFilename上传。到目前为止,好吧。我不需要关心参考文献,这很酷,工作更少。但是,我使用model derivative api获得的JSONs中没有一个包含有关链接文件的urn及其视图的信息(除了rootfile之外)。所以他们在哪儿?

Example scenario: (was possible in API v1)

示例场景:(在API v1中是可能的)

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

假设我想上传包含3个revit文件链接在一起的ZIP文件

  1. master - house.rvt
  2. 大师——house.rvt
  3. hvac - hvac.rvt
  4. 暖通空调,hvac.rvt
  5. electro - electro.rvt
  6. 电- electro.rvt

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

主参考hvac和电子,以及hvac和电子交叉引用大师。

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:

然后我将上传一个zip文件,成功地转化为SVF,现在我想在查看器hvac中显示。rvt,不是万能的!暖通空调。rvt有交叉引用,可在3D视图中关闭能见度:

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.

当我尝试这个时,我只能访问master的3D和2D视图。即使在文件中也没有链接文件的视图,而且以前是可以访问的。

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

清单:modelderivative / v2 / designdata /:缸/清单

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

元数据:瓮modelderivative / v2 / designdata /:/元数据

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

更完整的信息:viewingservice / v1 / {瓮} /

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.

它们都不包含任何有关链接文件的信息。唯一的例外是designDescription。json(当下载完整气泡时)提到模型有链接和哪些链接。

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..

https://developer.autodesk.com上的文档几乎没有提到如何处理引用的文件。

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 个解决方案

#1


1  

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.

解决这个问题的方法是,为每个链接文件以不同的名称将相同的zip文件上载到bucket(您可以省略不相关的特定链接文件),然后为每个zip文件调用一个post作业,其中包含另一个文件名rootFilename。rootFilename属性不必是revit模型设计的真正根。这将提供对每个链接文件的urn访问,并允许下载冒泡。

#2


0  

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.

您将在A360 UI中发现与新API所遵循的行为相同:您必须将各种组件一起上载,然后主组件将被翻译。

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.

所以,是的,目前看来,你必须上传你想要翻译的每个文件(用于查看或转换成其他格式),而且要上传一个zip文件以供主要Revit文件翻译。

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.

我已经将您的评论传递给了工程学,关于您丢失了v1 API中可用的功能。不幸的是,我现在不能承诺什么时候/如果这个功能将在v2 API中实现。

Sorry for the inconvenience it causes.

很抱歉给您带来不便。

#1


1  

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.

解决这个问题的方法是,为每个链接文件以不同的名称将相同的zip文件上载到bucket(您可以省略不相关的特定链接文件),然后为每个zip文件调用一个post作业,其中包含另一个文件名rootFilename。rootFilename属性不必是revit模型设计的真正根。这将提供对每个链接文件的urn访问,并允许下载冒泡。

#2


0  

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.

您将在A360 UI中发现与新API所遵循的行为相同:您必须将各种组件一起上载,然后主组件将被翻译。

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.

所以,是的,目前看来,你必须上传你想要翻译的每个文件(用于查看或转换成其他格式),而且要上传一个zip文件以供主要Revit文件翻译。

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.

我已经将您的评论传递给了工程学,关于您丢失了v1 API中可用的功能。不幸的是,我现在不能承诺什么时候/如果这个功能将在v2 API中实现。

Sorry for the inconvenience it causes.

很抱歉给您带来不便。