简体   繁体   English

Revit的设计自动化api中如何在workitem方法中动态更改输入输出文件的名称

[英]How to change the name of the input and output file dynamically in workitem method in design automation api for Revit

I am working on a project where I need to generate output Revit file based on the input json file in the Design automation API for Revit.我正在处理一个项目,我需要根据设计自动化 API for Revit 中的输入 json 文件生成输出 Revit 文件。
Since my input json string was large, I create a json file example "InputFile.json" and upload it to the cloud and pass the signed url to it to the work item and activity as input parameter, the generated output is a zip file example "OutputFile.zip" which is again uploaded to the cloud using the signed url.由于我输入的 json 字符串很大,我创建了一个 json 文件示例“InputFile.json”并将其上传到云端并将签名的 url 作为输入参数传递给工作项和活动,生成的输出是一个 zip 文件示例“OutputFile.zip”再次使用签名的 url 上传到云端。 My project works properly using this process.我的项目使用此过程正常工作。

But since the name used for the input and output files are fixed, I am facing issue when I send continuous request, I get mismatched output.但是由于用于输入和输出文件的名称是固定的,当我发送连续请求时我遇到了问题,我得到了不匹配的输出。

Activity request
..
"parameters": {
      "Inputs": {
        "zip": false,
        "ondemand": false,
        "verb": "get",
        "description": "Element parameters",
        "required": true,
        "localName": "InputFile.json"
      },
      "Result": {
        "zip": true,
        "ondemand": false,
        "verb": "put",
        "description": "new created element",
        "required": true,
        "localName": "OutputFile"
      }
    },
...

and the WorkItem request和 WorkItem 请求

...
"arguments":{
        "Inputs":{
            "url":"https://storage.googleapis.com/XXXXXXX/InputFile.json?XXXXXXXXXXXXXXXsigned-url"
            },

        "Result":{
            "verb":"put",
            "url":"https://storage.googleapis.com/XXXXXXX/OutputFile.zip?XXXXXXXXXXXXXXXsigned-url",
...

How can I pass dynamically generated names like "InputFile_[DATE].json" and "OutputFile_[DATE].zip"?如何传递动态生成的名称,如“InputFile_[DATE].json”和“OutputFile_[DATE].zip”?

Thanks in advance提前致谢

Regards问候

You should be able to replace the localName value when submitting the workitem by adding the "localName" attribute to your argument.通过将“localName”属性添加到您的参数中,您应该能够在提交工作项时替换 localName 值。 Example:例子:

"arguments":{
        "Inputs":{
            "url":"https://storage.googleapis.com/XXXXXXX/InputFile.json?XXXXXXXXXXXXXXXsigned-url"
            },

        "Result":{
            "verb":"put",
            "url":"https://storage.googleapis.com/XXXXXXX/OutputFile.zip?XXXXXXXXXXXXXXXsigned-url",
            "localName": "myOutputFileName"
        }
}

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

相关问题 Forge设计自动化Revit Workitem参数 - Forge Design Automation Revit Workitem Arguments Revit output 压缩文件的设计自动化为空 - Design Automation for Revit output zipped file is empty Autodesk 设计自动化 Revit,文本文件作为输入 - Autodesk design automation Revit , text file as input 无法反序列化 Revit 设计自动化工作项的当前 JSON 数组 - Cannot deserialize the current JSON array for Revit design automation workitem 具有动态文件名的 Revit Design 自动化控制打开过程 - Revit Design Automation Control Open Process with Dynamic File Name 如何在revit的forge api设计自动化中将巨大的json文件传递给Command.cs? - How to pass a huge json file to the Command.cs in forge api design automation for revit? 如何使用 Forge Design Automation API 将 BIM 360 中的 Revit 文件保存为云 model? - How to save Revit file in BIM 360 as cloud model using Forge Design Automation API? 设计自动化,工作项输出在处理后发生更改 - Design automation, workitem output changed after processing 如何在Design Automation API中创建多个文件以进行Revit并将结果下载为一个zip文件 - How to create multiple files in design automation api for revit and download result as one zip file revit 设计自动化 api 在创建 revit 文件时是否支持纹理 uv - Does revit design automation api support texture uv when creating revit file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM