简体   繁体   English

Model 存储在 BIM360 Docs 中的 Revit 模型的衍生翻译

[英]Model Derivative Translation of Revit Models stored in BIM360 Docs

I'm working on an app to translate Revit models which have already been published to the cloud into IFC format using the data-management and model-derivative APIs, and have run into two key issues for the model-derivative API.我正在开发一个应用程序,以使用数据管理和模型衍生 API 将已发布到云的 Revit 模型转换为 IFC 格式,并且遇到了模型衍生 API 的两个关键问题。

1. Model-Derivative Translation Issue: 1. 模型衍生翻译问题:

I have run into a failed translation error which has also popped up in other threads Model Uploader Error The file is not a Revit file or is not a supported version我遇到了翻译失败错误,该错误也在其他线程中弹出

code:"Revit-UnsupportedFileType"
message:"<message>The file is not a Revit file or is not a supported version.</message>"
type:"error"
code:"TranslationWorker-RecoverableInternalFailure"
message:"Possibly recoverable warning exit code from extractor: -536870935"
type:"error

However my case is somewhat unique, and other answers are not applicable.但是我的情况有些独特,其他答案不适用。 Previous cases have failed due to incorrect Revit version (apparently the translation may work on a 2016 version but not a 2019 version), or corruption during the upload of the file.以前的案例因 Revit 版本不正确(显然翻译可能适用于 2016 版本但不适用于 2019 版本)或文件上传过程中的损坏而失败。 This cannot be applicable for me as the.rvt to.svf translation was successful for this model, only my.rvt to.ifc translation has failed, also I am not uploading through the app, rather accessing files that are already on BIM360 docs.这不适用于我,因为此 model 的 .rvt 到 .svf 翻译成功,只有 my.rvt 到.ifc 翻译失败,而且我没有通过应用程序上传,而是访问已经在 BIM360 文档上的文件。

Another strange part of this behavior is that the.rvt->.ifc translation has been successful for earlier versions of the same model.此行为的另一个奇怪部分是 .rvt->.ifc 转换已成功用于相同 model 的早期版本。 This leads me to believe that perhaps there is a file size issue where the latest version of the model is too large for translation, although I haven't found any limits on the file size in the model-derivative documentation.这使我相信可能存在文件大小问题,即最新版本的 model 太大而无法翻译,尽管我在模型衍生文档中没有发现文件大小的任何限制。

2. Model-Derivative Download Issue: 2. 模型衍生下载问题:

Routing the download of a translated file through my server before downloading again from server to client, in order to use the 3-legged OAuth token, means having to download the same file twice (once from data-management api endpoint to server, secondly from server to client).在从服务器再次下载到客户端之前,通过我的服务器路由已翻译文件的下载,以便使用三足 OAuth 令牌,这意味着必须下载相同的文件两次(一次从数据管理 api 端点到服务器,第二次从服务器到客户端)。 This is problematic for large models.这对于大型模型是有问题的。 Currently my solution has been to just pass the 3-legged OAuth token and file URI to the client and have the request go straight from client to autodesk endpoint, although I thought this was bad practice.目前,我的解决方案是将三足 OAuth 令牌和文件 URI 传递给客户端,并将请求 go 直接从客户端传递到 Autodesk 端点,尽管我认为这是不好的做法。

I have not found any samples which incorporate this download endpoint, a NodeJS one would be optimal for me.我还没有找到包含此下载端点的任何示例,NodeJS 对我来说是最佳选择。 Also I wish there was a content-length header attached to this endpoint to give a better idea of download progress.另外我希望有一个内容长度 header 附加到此端点,以便更好地了解下载进度。

The relevant endpoints for my issues are both here: https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/translate-source-file-to-obj/我的问题的相关端点都在这里: https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/translate-source-file-to-obj/

Translate:翻译:

curl -X 'POST' -H 'Authorization: Bearer WmzXZq9MATYyfrnOFpYOE75sL5dh' -H 'Content-Type: application/json' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' -d
'{
  "input": {
    "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LmlhbQ"
  },
  "output": {
    "formats": [
      {
        "type": "obj"
      }
    ]
  }
}'

Note: I have used "type": ifc rather than "type": obj, as my output format on this endpoint;注意:我在此端点上使用了“type”:ifc 而不是“type”:obj,作为我的 output 格式; that is not the issue.这不是问题。

Verify:核实:

curl -X 'GET' -H 'Authorization: Bearer RWLzh098vuF3068r73FI7nF2RORf' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LmlhbQ/manifest'

Download:下载:

curl -X 'GET' -H 'Authorization: Bearer RWLzh098vuF3068r73FI7nF2RORf' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LmlhbQ/manifest/urn%3Aadsk.viewing%3Afs.file%3AdXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LmlhbQ%2Foutput%2Fgeometry%2Fbc3339b2-73cd-4fba-9cb3-15363703a354.obj'

means having to download the same file twice (once from data-management api endpoint to server, secondly from server to client).意味着必须下载相同的文件两次(一次从数据管理 api 端点到服务器,第二次从服务器到客户端)。 This is problematic for large models.这对于大型模型是有问题的。

Try set up a proxy service in your backend to relay user requests and direct them to fetch the derivatives and inject tokens into their headers so the tokens won't get exposed to clients so the files won't have to land physically on your backend as a go-between - see here for an sample.尝试在您的后端设置代理服务来中继用户请求并指导他们获取衍生品并将令牌注入其标头中,这样令牌就不会暴露给客户端,因此文件不必物理地降落在您的后端中间人 - 请参阅此处获取示例。

Will update this answer once we get to the bottom of the first issue.一旦我们到达第一个问题的底部,将更新这个答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM