JSON Files as parameter input using Forge Design Automation

我怕爱的太早我们不能终老 提交于 2020-06-28 05:02:07

问题


Looking at the documentation at the Autodesk Forge site, I noticed I can provide JSON information to a Design Automation Activity. My question is: how would I reference the JSON information in a bundled AutoCAD application. Is there a filename reference in the shown -curl example I'm not seeing or understand? What am I not getting?


回答1:


You reference JSON like any other input: by its filename. The server will download your json the same way it downloads DWG/RVT etc. The file will be located in the working directory of the worker process.




回答2:


Found my answer: Below is the example in the documentation:

curl -X POST \
  https://developer.api.autodesk.com/da/us-east/v3/workitems \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -d '{
          "activityId": "YOUR_NICKNAME.CountItActivity+test",
          "arguments": {
            "rvtFile": {
              "url": "https://s3.amazonaws.com/revitio-dev/test-data/CountIt.rvt"
            },
            "countItParams": {
              "url": "data:application/json,{'walls': false, 'floors': true, 'doors': true, 'windows': true}"
            },
            "result": {
              "verb": "put",
              "url": "SIGNED_URL_TO_RESULT"
            }
          }
      }'

countItParams is the name of the created .json file and is placed in the same folder as the input files. https://github.com/Autodesk-Forge/design.automation-csharp-revit.local.debug.tool

You can later access the file in your bundled application by referencing the current directory.

Sorry about answering my own question. I feel like I'm cheating. lol



来源:https://stackoverflow.com/questions/62286622/json-files-as-parameter-input-using-forge-design-automation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!