我正在尝试设置一个Revit模型查看器,当有人更改模型时,它会获取更新。我根本不是Revit pro,所以请耐心等待。我已经成功地在服务器上上传了一个非常整洁的模型,但如果我更新我的模型并再次运行相同文件名(但内容不同)的上传,我会收到一条消息,表明我的上传已立即完成且没有更新发生。
我按照两个指南来设置https://forge.autodesk.com/en/docs/viewer/v2/tutorials/basic-viewer/
以上允许我设置html表单和存储桶以及所有内容
我复制了这段代码https://github.com/jaimerosales/modelderivative-nodejs-tutorial/blob/master/uploader.js作为上传者。我更新了我的revit模型后运行uploader.js
,我看到我的服务器上没有更新。 CLI的唯一区别是我第一次运行uploader.js
时看到:
**** Getting File Manifest Status
The status of your file is pending Please wait while we finish Translating your file
The percentage of your file is 0% complete
我第二次运行uploader.js
(更新模型后),我看到了
**** Getting File Manifest Status
**** success
**** complete
**** Your File is ready for viewing
所以看起来甚至不再发生上传,它只是承载已经上传的文件。我查看了https://www.npmjs.com/package/forge-apis和各种端点,但似乎没有一个我正在寻找。这是预期的功能吗?
作为一种解决方案,您可以重命名您的revit文件并上传,它将生成一个新的对象名称,这将迫使翻译。
此外,您可以在uploader.js文件中看到forge-apis derivativeApi上的translateFile包装器转换端点,如果它应该重新转换相同的模型,那么它是一个布尔参数:
@param {Boolean} opts.xAdsForce `true`: the endpoint replaces previously translated output file types with the newly generated derivatives
`false` (default): previously created derivatives are not replaced (default to false)
* data is of type: {module:model/Job}
因此,您可以研究如何使用特定的选项配置调用uploader.js translateFile函数,或者您可以直接使用forge-apis模块并将xAdsForce:true规范添加到translate api调用的标头中。