Request

Response

    Field Guide

    As described in the API Basics page, there are four primary entities in the Automation API for executing custom programs or running scripts on input files:

    • Activity
    • WorkItem
    • AppBundle
    • Engine

    Entity Relationships

    ../../../_images/acadio_erd.png
    • WorkItems reference exactly one Activity.
    • Activities reference exactly one Engine.
    • Activities reference one or more AppBundles. Note: Inventor Activities may only reference one AppBundle.
    • AppBundles reference zero or more other AppBundles. Note: Inventor AppBundles may not reference any other AppBundles.
    • AppBundles reference exactly one Engine.

    Activity

    An Activity is an action that can be executed within the core engine (AutoCAD, 3dsMax, Inventor or Fusion). For example, this might be plotting a DWG to PDF, updating the CAD standards in a drawing file or modifying the assembly based on iLogic parameters in Inventor.

    Examples

    AutoCAD

    {
        "commandLine": [
            "$(engine.path)\\accoreconsole.exe /i $(args[HostDwg].path) /al \"$(appbundles[Publish2View22].path)\" /s \"$(settings[script].path)\""
        ],
        "parameters": {
            "HostDwg": {
                "verb": "get",
                "description": "Host drawing",
                "localName": "$(EmptyDwg)"
            },
            "Result": {
                "zip": true,
                "verb": "post",
                "description": "Results",
                "localName": "result"
            }
        },
        "engine": "Autodesk.AutoCAD+22",
        "appbundles": [
            "AutoCAD.Publish2View22+prod"
        ],
        "settings": {
            "script": "(command \"_prepareforpropertyextraction\" \"index.json\")\n(command \"_indexextractor\" \"index.json\")\n(command \"_publishtosvf\" \"./output/result.svf\")\n(command \"_createbubblepackage\" \"./output\" \"./result\" \"\" \"\")\n"
        },
        "description": "AutoCAD translation sample generating SVF via core console.",
        "version": 1,
        "id": "AutoCAD.AcSvfPublish+prod"
    }
    
    Show More

    3ds Max

    {
        "id": "ExportToFBX",
        "commandLine": "$(engine.path)/3dsmaxbatch.exe -sceneFile \"$(args[InputFile].path)\" \"$(settings[script].path)\"",
        "description": "Export a single max file to FBX",
        "appbundles": [
            ],
        "engine" : "Autodesk.3dsMax+2021",
        "parameters": {
            "InputFile" : {
                "zip": false,
                "description": "Input 3ds Max file",
                "ondemand": false,
                "required": true,
                "verb": "get",
                "localName": "input.max"
            },
            "OutputFile": {
                "zip": false,
                "ondemand": false,
                "verb": "put",
                "description": "Output FBX file",
                "required": true,
                "localName": "output.fbx"
            }
        },
        "settings": {
           "script": "exportFile (sysInfo.currentdir + \"/output.fbx\") #noPrompt using:FBXEXP"
       }
    }
    
    Show More

    Inventor

    {
        "commandLine": [
            "$(engine.path)\\InventorCoreConsole.exe /i \"$(args[InventorDoc].path)\" /al \"$(appbundles[ChangeParams].path)\" \"$(args[InventorParams].path)\""
        ],
        "parameters": {
            "InventorDoc": {
                "verb": "get",
                "description": "IPT file or ZIP with assembly to process"
            },
            "InventorParams": {
                "verb": "get",
                "description": "JSON with changed Inventor parameters",
                "localName": "params.json"
            },
            "OutputIpt": {
                "zip": false,
                "ondemand": false,
                "optional": true,
                "verb": "put",
                "description": "IPT with the changed parameters",
                "localName": "Result.ipt"
            },
            "OutputIam": {
                "zip": false,
                "ondemand": false,
                "optional": true,
                "verb": "put",
                "description": "ZIP with assembly with the changed parameters",
                "localName": "Result.zip"
            }
        },
        "engine": "Autodesk.Inventor+23",
        "appbundles": [
            "Inventor.ChangeParams+prod"
        ],
        "description": "Change parameters of a part or an assembly (Inventor 2019).",
        "id": "ChangeParams"
    }
    
    Show More

    Revit

    {
       "id": "CountItActivity",
       "commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /al \"$(appbundles[CountItApp].path)\"" ],
       "parameters": {
          "rvtFile": {
             "zip": false,
             "ondemand": false,
             "verb": "get",
             "description": "Input Revit model",
             "required": true,
             "localName": "$(rvtFile)"
          },
          "countItParams": {
             "zip": false,
             "ondemand": false,
             "verb": "get",
             "description": "CountIt parameters",
             "required": false,
             "localName": "CountItParams.json"
          },
          "result": {
             "zip": false,
             "ondemand": false,
             "verb": "put",
             "description": "Results",
             "required": true,
             "localName": "result.txt"
          }
       },
       "engine": "Autodesk.Revit+2018",
       "appbundles": [ "YourNickname.CountItApp+test" ],
       "description": "Count and output elements from Revit file."
    }
    
    Show More

    Fusion

    {
      "id": "{{activityName}}",
      "engine": "{{engine}}",
      "commandline": [],
      "parameters": {
            "TaskParameters": {
              "verb": "read",
              "description": "the parameters for the script",
              "required": false
            },
            "PersonalAccessToken": {
              "verb": "read",
              "description": "the personal access token to use",
              "required": true
            }
      },
      "appbundles": [
      "{{dasAppBundleId}}+my_working_version"
      ],
      "settings": {},
      "description": ""
    }
    
    Show More

    WorkItem

    A WorkItem is a specification of the processing job for an Activity, and it is submitted to and executed by the core engine.

    Note that a WorkItem cannot be modified after it has been created.

    Request Example

    {
        "activityId": "dqRuDWmG904xamaQi6zWLFOm7snzBOaR.InventorActivity_MaxOnDemand_x1+InvActivityNickName_MaxOnDemand_x1",
        "arguments": {
            "InventorDoc": {
                "url": "https://inventor-io-samples.s3.us-west-2.amazonaws.com/V3_Front_End_Limit/MaxOnDemand/Memory_Inventor.zip",
                "zip": true,
                "pathInZip": "1100_10001080329_IAM_001.iam",
                "localName": "Assembly"
            },
            "InventorParams": {
                "url": "https://inventor-io-samples.s3.us-west-2.amazonaws.com/V3_Front_End_Limit/MaxOnDemand/changeParameters.json"
            },
            "OutputIam": {
                "url": "https://inventor-io-samples.s3.us-west-2.amazonaws.com/V3_Front_End_Limit/MaxOnDemand/Result.zip?AWSAccessKeyId=AKIAIMGS3VXBFI36OKEQ&Expires=1577791320&Signature=vnuzDeDtIaLXm4%2FL5YS5j4dPDu0%3D",
                "verb": "put"
            }
        }
    }
    
    Show More

    Response Example

    {
        "status": "pending",
        "reportUrl": "https://dasprod-store.s3.us-east-1.amazonaws.com/workItem/sdfsdfsfWmG904xamaQi6gsdgfdsgsdsgfzWLFOm7snzBOaR/sdgfdsgdfgd5988036d7f8ef36a3/report.txt...",
        "stats": {
            "timeQueued": "2018-08-07T12:23:49.5379221Z"
        },
        "id": "dd1c37bf239b4695988036d7f8ef36a3"
    }
    
    Show More

    AppBundle

    An AppPackage is a module that is used by an Activity in order to perform a particular action.

    Example

    {
        "engine": "Autodesk.AutoCAD+22",
        "description": "App for Model&View (Omega)",
        "version": 1,
        "id": "AutoCAD.Publish2View22+prod"
    }
    

    Engine

    An Engine is what executes a WorkItem job and processes the actions specified by an Activity.

    Example

    {
        "productVersion": "23.0",
        "description": "AutoCAD 2019 (Pi) Core Engine",
        "version": 2,
        "id": "Autodesk.AutoCAD+23"
    }
    

    Variable expansion

    A variable $(workitem.id) can be used in the payload. The following fields support variable expansion:

    • workitems.arguments[n].url
    • workitems.arguments[n].headers
    • workitems.arguments[n].value
    • activities.commandLine[n]

    Examples

    {
      "activityId": "owner.name+alias",
      "arguments": {
        "result": {
          "verb": "put",
          "url": "https://myProvider/$(workitem.id)/File.ext"
        }
      }
    }
    
    Show More
    {
      "activityId": "owner.name+alias",
      "arguments": {
        "result": {
          "verb": "post",
          "url": "https://myProvider/results",
          "headers": {
            "myWorkitemId": "$(workitem.id)"
          }
        }
      }
    }
    
    Show More

    Command lines

    Note: Use of the command line is not support with the Fusion engine.

    The command line contains variables of the form $(collection[index].property) where collection may have the following values:

    1. args or settings refers to the arguments of the workitem or settings of the activity respectively, index must be the name of the argument/setting, property can be the following:

      1.1. path: full path to the file system entry (file or folder) for the argument/setting.

      Note that this may be different than the localName for input arguments when the Content - Disposition header value is provided by the server. It is also different from localName when zip`=`true, in this case path will be determined like this:

      1. if the zip file contains a manifest (etransmit) then path will point to ‘main file’ designated by the manifest.
      2. if the zip file contains no manifest then path will point to what’s designated by pathInZip.

      1.2. value: string value of the argument/setting

    2. appbundles refers to a referenced app, index must be the id of the appbundle, property can be the following:

      2.1. path: full path to the folder where the appbundle is executing from.

    3. engine refers to a referenced engine, ‘index’ should not be used, property can be the following:

      3.1. path: full path to the folder where the engine is executing from.

    Examples:

    $(engine.path)/AcCoreConsole.exe /i “$(args[hostDwg].path)” /s $(setting[script].path)

    “$(appbundles[Autodesk.ShardingApp].path)/AcReadEx.exe” /i “$(args[hostDwg].path)” /retries $(args[retries].value))

    Note: args and appbundles must be provided between quotes.

    Expanded WorkItem Payload

    The working directory of the executable running in the context of the service will also contain a <workitem.id>_Job.das file. Appbundles can use this information to get to the details of the submitted work.

    For example, you can use the following C# code to read this the contents of this file in your appbundle code:

    var json = File.ReadAllText($”{Environment.ExpandEnvironmentVariables(“%DAS_WORKITEM_ID%”)}_job.das”);

    This file contents are encoded as JSON. The following attributes will be present on the root object:

    Id
    string
    Id of the WorkItem
    ActivityId
    string
    Id of referenced Activity
    EngineId
    string
    Id of referenced Engine
    Apps
    array of strings
    Ids of referenced Appbundles
    BoundArguments
    dictionary of objects
    This attribute presents a merged view of the Actvitity.parameters and WorkItem.arguments
    Settings
    dictionary of objects
    Same as Activity.settings
    CommandLine
    array of strings
    Same as Activity.commandLine
    Quotas
    dictionary of integers
    Some of the quotas applied to this workitem. Please note that this is not a complete list.
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.