We have a design automation application for Revit that handles models from BIM 360 and we would like to open models using our own process so we can modify what worksets are opened, etc. We have found the link at https://www.autodesk.com/autodesk-university/class/Getting-Started-Design-Automation-Revit-Forge-2019#handout. According to that, though, you have to hard code the name of the rvt file as a specific name in order to open it. However, we have some places that the name of the model is used in the exported data so we would like to keep the name as it originally appeared.
Is it possible to reference the command arguments from within the application? Right now we have our parameter for the model on the activity defined as follows:
"rvtFile": {
"zip": false,
"ondemand": false,
"verb": "get",
"description": "Input Revit Model",
"required":true,
"localName": "$(rvtFile)"
},
And the command line looks like this:
"commandLine":["$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /al \"$(appbundles[{{ BundleId }}{{ RevitVersion }}].path)\""]
So the local name is dynamic and is just opened by DA using the command line. However since we want to control the opening process we need to pull the Revit file out of the command line and be able to figure out the path to the file to be opened. I'm not sure how to do this reliably since it's dynamic; any help would be appreciated.