Revit工作项参数的设计自动化未解析 [英] Design Automation for Revit Work Item Argument Not Parsing

查看:61
本文介绍了Revit工作项参数的设计自动化未解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,该应用程序将工作项提交给Design Automation for Revit(Design Automation v3 beta).提交的大多数工作项都可以正常工作,但是模型的某些版本似乎无法解析"rvtFile"参数.然后,这会导致Revit云端进程无法运行,因为文件名参数错误.

I have an application that submits work items to Design Automation for Revit (Design Automation v3 beta). Most of the work items submitted work fine, but some versions of the models appear to fail to parse the "rvtFile" argument. This then leads to the cloud Revit process failing to run because the file name argument is wrong.

活动POST的正文:

{
"id": "ExtractModelCategoriesActivity",
"commandLine": ["$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[ExtractModelCategories].path)"],
"parameters": {
    "rvtFile": {
        "zip": false,
        "ondemand": false,
        "verb": "get",
        "description": "Input Revit model",
        "required": true,
        "localName": "$(rvtFile)"
    },
    "result": {
        "zip": false,
        "ondemand": false,
        "verb": "put",
        "description": "Model object categories by view",
        "required": false,
        "localName": "ModelCategories.json"
    }
},
"engine": "Autodesk.Revit+2019",
"appbundles": ["alias_was_here.ExtractModelCategories+prod"],
"description": "Extract Model Categories to JSON Activity."
}

工作项目POST:

    {
    "activityId": "alias_was_here.ExtractModelCategoriesActivity+prod",
    "arguments": {
        "rvtFile": {
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/83b5eb1e-c9b7-4938-ad4e-8efc4789d0e2.rvt?scopes=b360project.22109894-5897-4aa9-96ab-2e3310bc4ae9,global,O2tenant.5952590",
            "Headers": {
                "Authorization": "Bearer token_was_here"
            }
        },
        "result": {
            "verb": "put",
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/9dde6073-d490-4fd0-991e-4ff92af1957e.json",
            "Headers": {
                "Authorization": "Bearer token_was_here"
            }
        },
        "onComplete": {
            "verb": "post",
            "url": "callback_url_was_here"
        }
    }
}

从report.txt文件中提交成功:

From the report.txt file for a successful submission:

[04/16/2019 12:03:50] Job information:
"CommandLine":[
  "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[ExtractModelCategories].path)"
]
"Settings":{
  "dasreportfailedlimits": {
    "value": "true",
    "isEnvironmentVariable": true
  }
}
"Id":"e23918d475a74145aade32ba8968e5c3"
"ActivityId":"alias_was_here.ExtractModelCategoriesActivity+prod"
"Engine.Id":"Autodesk.Revit!21"
"Apps": [
"App.Id":"alias_was_here.ExtractModelCategories!1"
]
"BoundArguments":{
  "rvtFile": {
    "localName": "$(rvtFile)",
    "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/839a11d8-51e9-42de-8936-28687feda65f.rvt?scopes=b360project.1949ed9d-e7fd-42b9-98f4-544fff3df42f,global,O2tenant.2971682",
    "headers": {
      "Authorization": "Bearer token_was_here"
    }
  },
  "result": {
    "localName": "ModelCategories.json",
    "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/dd19b8f6-ac51-45b9-8f42-51c7c6a9d257.json",
    "headers": {
      "Authorization": "Bearer token_was_here"
    },
    "verb": "put"
  },
  "onComplete": {
    "ondemand": true,
    "optional": true,
    "url": "callback_was_here",
    "verb": "post"
  },
  "onProgress": {
    "ondemand": true,
    "url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Prod/v3/workitems/progress",
    "headers": {
      "Content-Type": "application/json",
      "x-das-authorize": "awssigv4(us-east-1)",
      "x-ads-token-data": "{\"access_token\":{\"client_id\":\"alias_was_here\"},\"scope\":\"bucket:create bucket:read data:read data:create data:write code:all\",\"expires_in\":3595,\"client_id\":\"alias_was_here\"}",
      "x-ads-developer-email": "email_was_here"
    },
    "verb": "put"
  }
}

 - snip -


[04/16/2019 12:03:57] ### Command line arguments: /isolate HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_e23918d475a74145aade32ba8968e5c3 "T:\Aces\Jobs\e23918d475a74145aade32ba8968e5c3\userdata" /exe "T:\Aces\AcesRoot\19.0\coreEngine\Exe\revitcoreconsole.exe"  /i T:\Aces\Jobs\e23918d475a74145aade32ba8968e5c3\839a11d8-51e9-42de-8936-28687feda65f.rvt /al T:\Aces\Applications\779cf68955e15ce6704c72a62c734afe.alias_was_here.ExtractModelCategories[1].package.

 - snip -

[04/16/2019 12:03:57] Echoing command line args:
[04/16/2019 12:03:57]   0:/i
[04/16/2019 12:03:57]   1:T:\Aces\Jobs\e23918d475a74145aade32ba8968e5c3\839a11d8-51e9-42de-8936-28687feda65f.rvt

 - snip -

[04/16/2019 12:03:57] Running user application....

 - snip -

[04/16/2019 12:04:22] Job finished with result Succeeded
[04/16/2019 12:04:22] Job Status:
{
  "status": "success",

  ...

从report.txt文件中提交失败:

From the report.txt file for a failed submission:

    [04/16/2019 12:04:44] Job information:
"CommandLine":[
  "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[ExtractModelCategories].path)"
]
"Settings":{
  "dasreportfailedlimits": {
    "value": "true",
    "isEnvironmentVariable": true
  }
}
"Id":"4db3208a1c4e429c846c4da385f2219d"
"ActivityId":"alias_was_here.ExtractModelCategoriesActivity+prod"
"Engine.Id":"Autodesk.Revit!21"
"Apps": [
"App.Id":"alias_was_here.ExtractModelCategories!1"
]
"BoundArguments":{
  "rvtFile": {
    "localName": "$(rvtFile)",
    "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/e597df42-07c7-41e1-aa0c-fa1abd179a4c.rvt?scopes=b360project.1949ed9d-e7fd-42b9-98f4-544fff3df42f,global,O2tenant.2971682",
    "headers": {
      "Authorization": "Bearer token was here"
    }
  },
  "result": {
    "localName": "ModelCategories.json",
    "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/6b59f894-bbf0-421a-bf0b-e80d7584ee33.json",
    "headers": {
      "Authorization": "Bearer token_was_here"
    },
    "verb": "put"
  },
  "onComplete": {
    "ondemand": true,
    "optional": true,
    "url": "callback_was_here",
    "verb": "post"
  },
  "onProgress": {
    "ondemand": true,
    "url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Prod/v3/workitems/progress",
    "headers": {
      "Content-Type": "application/json",
      "x-das-authorize": "awssigv4(us-east-1)",
      "x-ads-token-data": "{\"access_token\":{\"client_id\":\"alias_was_here\"},\"scope\":\"bucket:create bucket:read data:read data:create data:write code:all\",\"expires_in\":3596,\"client_id\":\"alias_was_here\"}",
      "x-ads-developer-email": "email_was here"
    },
    "verb": "put"
  }
}

 - snip -

[04/16/2019 12:04:56] ### Command line arguments: /isolate HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_4db3208a1c4e429c846c4da385f2219d "T:\Aces\Jobs\4db3208a1c4e429c846c4da385f2219d\userdata" /exe "T:\Aces\AcesRoot\19.0\coreEngine\Exe\revitcoreconsole.exe"  /i T:\Aces\Jobs\4db3208a1c4e429c846c4da385f2219d\$(rvtFile) /al T:\Aces\Applications\779cf68955e15ce6704c72a62c734afe.alias_was_here.ExtractModelCategories[1].package.

 - snip -

[04/16/2019 12:04:56] Echoing command line args:
[04/16/2019 12:04:56]   0:/i
[04/16/2019 12:04:56]   1:T:\Aces\Jobs\4db3208a1c4e429c846c4da385f2219d\$(rvtFile)

[04/16/2019 12:04:56] Running user application....
[04/16/2019 12:05:02] Exception: Revit input file not found: T:\Aces\Jobs\4db3208a1c4e429c846c4da385f2219d\$(rvtFile)

 - snip -

[04/16/2019 12:05:03] Job finished with result FailedExecution
[04/16/2019 12:05:03] Job Status:
{
  "status": "failedInstructions",

  ...

据我所知,两个提交主体的格式和结构都是相同的(这是同一模型的版本10和版本11).但是,对于失败的工作项,Revit文件名未解析,并且在DA处理工作项时仍为字符串$(rvtFile)而不是实际文件名.

As best I can tell, the format and structure of the body of both of the submissions is the same (these are version 10 and version 11 of the same model). However, for the failing work item, the Revit file name is not parsing and is still the string $(rvtFile) rather than the actual file name when DA processes the work item.

对问题有任何见解吗?提交的正文中是否有错误?我该如何纠正?

Any insight into the problem? Does the body of the submission have errors in it? How do I correct?

推荐答案

我正在根据自己在Zhong Wu和Autodesk的帮助下学到的知识来回答自己的问题:

I am answering my own question based on what I have learned with the assistance of Zhong Wu with Autodesk:

当前,这是Design Automation for Revit API Beta的问题.如果Revit模型包括到其他模型的链接,则将下载到Design Automation的文件压缩并包括主模型和链接的文件.然后,Design Automation失败,因为它需要Revit文件.这是在API方面自动发生的.

This is currently an issue with the Design Automation for Revit API Beta. If the Revit model includes links to other models then the file downloaded to Design Automation is zipped and includes the main model and the linked file(s). Design Automation then fails because it expects a Revit file. This happens automatically on the API's side.

一种解决方法是使用数据管理API将Revit文件下载到另一个位置.如果Data Management API提供的文件是压缩文件而不是Revit模型,则将其解压缩.然后,将未压缩的Revit文件放置在Design Automation可以访问的位置,并发布引用未压缩文件位置的工作项.

A work-around is to download the Revit file to another location utilizing the Data Management API. If the file provided by the Data Management API is a compressed file and not a Revit model, un-zip it. Then, place the uncompressed Revit file in a location accessible to Design Automation and post the work item referencing the location of the uncompressed file.

据我了解,Autodesk内部已发出更改请求,以改善对压缩文件的处理.我没有时间表.

It is my understanding that a change request has been issued internally at Autodesk to improve the handling of compressed files. I have no timeline for this.

如果我了解更多信息,我将更新此答案.

If I learn more, I will update this answer.

**更新**

此问题已由Autodesk Forge团队修复,现已在具有链接的Revit文件中运行.谢谢!

This was fixed by the Autodesk Forge team, and now runs for Revit files with links. Thank you!

这篇关于Revit工作项参数的设计自动化未解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆