问题
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