Skip to content

Design Automation Inputs and Outputs

Petr Broz edited this page Jun 3, 2019 · 1 revision

Inputs and outputs in Forge Design Automation activities or work items can have many properties. Here's an example REST payload that would be used to create an activity with three inputs and one output:

{
    "id": "MyActivity",
    "commandLine": ["$(engine.path)\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[MyAppBundle].path)"],
    "parameters": {
        "rvtFile": { "verb": "get", "description": "Input RVT file." },
        "inputGeometry": { "verb": "get", "description": "Input SAT file.", "localName": "InputGeometry.sat" },
        "familyTemplate": { "verb": "get", "description": "Input RFT File.", "localName": "FamilyTemplate.rft" },
        "result": { "verb": "post", "zip": false, "localName": "ResultModel.rvt" }
    },
    "engine": "Autodesk.Revit+2019",
    "appbundles": ["MyAppBundle+prod"],
    "description": "My activity description"
}

And here's an example REST payload that would create a work item based on the activity:

{
    "rvtFile": { "url": "<revit file url>" },
    "inputGeometry": { "url": "<input geometry url" },
    "familyTemplate": { "url": "<family template url>" },
    "result": { "url": "<output url>", "verb": "put" }
}

When using the command line interface, these input/output properties must be flattened in some way. In our implementation we chose the following convention: for every input or output there must always be a --input <input id> or --output <output id> flag. These flags can then be followed by flags such as --input-url <url>, --output-url <url>, --input-local-name <local name>, etc., and these properties will always be assigned to the last available input or output ID. The work item example above could therefore be written in command line as the following sequence of flags:

forge-da create-workitem MyActivity prod --input rvtFile --input-url <revit file url> --input inputGeometry --input-url <input geometry url> --input familyTemplate --input-url \<family template url> --output result --output-url <output url>
Clone this wiki locally