如何为 ZIP 和 Unzip 输入创建 activity

How to create an activity for both ZIP and Unzip input

我正在尝试 运行 Forge Design Automation 上的 Revit 插件,该插件的输入是来自 BIM 360 的 Revit 文件,可使用 BIM 360 API 进行访问。如果 Revit 文档有链接,它将下载为 zip 文件(包含链接),否则,它是一个 Revit 文件。如何定义我的 activity 以便它可以处理这两种情况?更具体地说,我应该如何设置:

数据['parameters']['rvtFile']['zip']

在我的 activity?

我不知道文件在下载之前是否以 ZIP 文件的形式下载。

I don't know if the file is downloaded as a ZIP file or not before it's downloaded.

要确定从 BIM 360 下载的 Revit 文件是否为 zip 文件,您可以使用此 BIM 360 API. If the response has isCompositeDesign = true, it will download as a zip file with eTransmit package. If not, it will download as a Revit file. To understand why your file may sometimes be downloaded as a zip package see here

要在 Design Automation 中使用 zip 包作为输入文件,您可以按照我们的文档 and/or 中 pathInZip 的说明进行操作,请参阅

编辑 (5/24):

另请参阅有关该主题的新 blog post。参考workitem中arguments.inputFile.ziparguments.inputFile.pathInZip的用法。这样,您可以使用相同的 activity 并在输入文件是复合设计时 posting 工作项时包含这些参数值。