簡體   English   中英

Revit 工作項參數未解析的設計自動化

[英]Design Automation for Revit Work Item Argument Not Parsing

我有一個應用程序可以將工作項提交給 Design Automation for Revit (Design Automation v3 beta)。 大多數提交的工作項工作正常,但模型的某些版本似乎無法解析“rvtFile”參數。 這會導致雲 Revit 進程無法運行,因為文件名參數錯誤。

活動正文 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 文件中:

[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 文件:

    [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 文件名未被解析並且仍然是字符串 $(rvtFile) 而不是 DA 處理工作項時的實際文件名。

對問題有任何見解嗎? 提交的正文中是否有錯誤? 我該如何糾正?

我正在根據我在 Zhong Wu 和 Autodesk 的幫助下學到的知識回答我自己的問題:

目前,這是 Design Automation for Revit API Beta 的一個問題。 如果 Revit 模型包含指向其他模型的鏈接,則下載到 Design Automation 的文件將被壓縮並包含主模型和鏈接文件。 Design Automation 隨后失敗,因為它需要一個 Revit 文件。 這在 API 端自動發生。

解決方法是使用數據管理 API 將 Revit 文件下載到另一個位置。 如果數據管理 API 提供的文件是壓縮文件而不是 Revit 模型,請將其解壓縮。 然后,將未壓縮的 Revit 文件放置在 Design Automation 可訪問的位置,並發布引用未壓縮文件位置的工作項。

據我了解,Autodesk 內部已發出更改請求以改進壓縮文件的處理。 我沒有這方面的時間表。

如果我了解更多,我會更新這個答案。

** 更新**

此問題已由 Autodesk Forge 團隊修復,現在針對帶有鏈接的 Revit 文件運行。 謝謝!

除了使用 "localName": "$(rvtFile),你可以使用像 "localName": "input.rvt" 這樣的靜態文件名嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM