I'm trying to use Forge's Design Automation API to auto-place certain model line geometries in my Revit model. I successfully follow the tutorial on the Autodesk's documentation, but when I submit a workitem, I encounter this error message. Can anyone help me with this?
"CommandLine":[
"$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /al \"$(appbundles[PropGenerate].path)\""
]
"Settings":{
"dasreportfaileduploadoptional": {
"value": "true",
"isEnvironmentVariable": true
}
}
"Id":"8028b869feac4e8b9cc24c54a89e40ef"
"ActivityId":"cottage_bim_da.PropGenerateActivity+test"
"Engine.Id":"Autodesk.Revit!75"
"Apps": [
"App.Id":"cottage_bim_da.PropGenerate!3"
]
"BoundArguments":{
"rvtFile": {
"localName": "$(rvtFile)",
"url": "https://developer.api.autodesk.com/Masked:zn8gkB/+dq7DcaiQvFFcQoZJaqw="
},
"result": {
"localName": "result.rvt",
"url": "https://developer.api.autodesk.com/Masked:Hhq8V5ffHZZ3IXpN0jG8Qt/0qeA=",
"verb": "put"
},
"onComplete": {
"ondemand": true,
"optional": true,
"url": "https://hooks.slack.com/Masked:9J3dSku5M9F2V+1rVNWikLcxp3M=",
"verb": "post"
},
"onProgress": {
"ondemand": true,
"url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Masked:UK/Z3b5X3xUWxXiH6C9r9i9UlRU=",
"headers": {
"Content-Type": "application/json",
"x-das-authorize": "awssigv4(us-east-1)",
"x-ads-token-data": "{\"access_token\":{\"client_id\":\"EMGeKroATulgTmGwP2IiWznEGg4PI1np\"},\"scope\":\"code:all data:write data:read bucket:create bucket:delete\",\"expires_in\":3415,\"client_id\":\"EMGeKroATulgTmGwP2IiWznEGg4PI1np\"}",
"x-ads-gateway-secret": "B8D93ECCBBCCEA74BD9EF64423B1C6FC"
},
"verb": "put"
}
}
"Quotas":{
"limitProcessingTimeSec": 10800,
"limitTotalUncompressedAppsSizeInMB": 5000
}
[01/05/2022 13:30:01] Starting work item 8028b869feac4e8b9cc24c54a89e40ef
[01/05/2022 13:30:01] Start download phase.
[01/05/2022 13:30:01] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/signedresources/e58be8a5-9d67-4176-b1d1-14fe331a5d3d?region=US'
[01/05/2022 13:30:02] '20185088' bytes have been written to T:\Aces\Jobs\8028b869feac4e8b9cc24c54a89e40ef\template_rvt_model.
[01/05/2022 13:30:02] End downloading file from 'https://developer.api.autodesk.com/oss/v2/signedresources/e58be8a5-9d67-4176-b1d1-14fe331a5d3d?region=US'.
[01/05/2022 13:30:02] End download phase successfully.
[01/05/2022 13:30:02] Start preparing script and command line parameters.
[01/05/2022 13:30:02] Command line: [ /i "T:\Aces\Jobs\8028b869feac4e8b9cc24c54a89e40ef\template_rvt_model" /al "T:\Aces\Applications\25fb6f2a218d055543f2acf3656f6a81.cottage_bim_da.PropGenerate[3].package"]
[01/05/2022 13:30:02] End preparing script and command line parameters.
[01/05/2022 13:30:02] Start script phase.
[01/05/2022 13:30:02] Start Revit Core Engine standard output dump.
[01/05/2022 13:30:03] Running in unattended mode.
[01/05/2022 13:30:03] ====== Revit is running: revitcoreconsole ======
[01/05/2022 13:30:03] Current Exe path: T:\Aces\AcesRoot\21.0\coreEngine\Exe\revitcoreconsole.exe
[01/05/2022 13:30:03] Echoing command line args:
[01/05/2022 13:30:03] 0:/i
[01/05/2022 13:30:03] 1:T:\Aces\Jobs\8028b869feac4e8b9cc24c54a89e40ef\template_rvt_model
[01/05/2022 13:30:03] 2:/al
[01/05/2022 13:30:03] 3:T:\Aces\Applications\25fb6f2a218d055543f2acf3656f6a81.cottage_bim_da.PropGenerate[3].package
[01/05/2022 13:30:03] 4:/isolate
[01/05/2022 13:30:03] 5:HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_8028b869feac4e8b9cc24c54a89e40ef
[01/05/2022 13:30:03] 6:T:\Aces\Jobs\8028b869feac4e8b9cc24c54a89e40ef\userdata
[01/05/2022 13:30:03] Running RevitAssemblyResolver....
[01/05/2022 13:30:03] Initializing RevitCoreEngine...
[01/05/2022 13:30:03] Selected Revit\RCE install Path: (from app.config) C:\Revit2021
[01/05/2022 13:30:03] Resolving location of Revit/RevitCoreEngine installation...
[01/05/2022 13:30:03] Running user application....
[01/05/2022 13:30:07] Found an addIn for registration: PropGenerate.addin
[01/05/2022 13:30:07] Initializing RCE....
[01/05/2022 13:30:07] Initializing RevitCoreEngine (and possibly running stub installer)...
[01/05/2022 13:30:07] Language not specified, using English-United States(ENU) as default.
[01/05/2022 13:30:10] Initialize and get RCE: (VersionBuild) 21.1.30.74 (VersionNumber) 2021 (SubVersionNumber) 2021.2
[01/05/2022 13:30:10] Autodesk.Revit.Exceptions.InvalidOperationException: The document can not be opened.
[01/05/2022 13:30:10] at Autodesk.Revit.ApplicationServices.Application.OpenDocumentFile(ModelPath modelPath, OpenOptions openOptions)
[01/05/2022 13:30:10] at DesignAutomationFramework.DesignAutomationData..ctor(Application revitApp, String mainModelPath)
[01/05/2022 13:30:10] at DesignAutomationFramework.DesignAutomationReadyEventArgs..ctor(Application revitApp, String mainModelPath)
[01/05/2022 13:30:10] at DesignAutomationFramework.DesignAutomationBridge.SetDesignAutomationReady(Application revitApp, String mainModelPath)
[01/05/2022 13:30:10] at RevitCoreEngineTest.RceConsoleApplication.Program.UserMain(CommandLineArgs cl)
[01/05/2022 13:30:16] RESULT: Failure - Result of running user app is failure
[01/05/2022 13:30:16] Finished running. Process will return: TestError
[01/05/2022 13:30:16] ====== Revit finished running: revitcoreconsole ======
[01/05/2022 13:30:17] End Revit Core Engine standard output dump.
[01/05/2022 13:30:17] Error: Application revitcoreconsole.exe exits with code 4 which indicates an error.
[01/05/2022 13:30:17] End script phase.
[01/05/2022 13:30:18] Error: An unexpected error happened during phase CoreEngineExecution of job.
[01/05/2022 13:30:18] Job finished with result FailedExecution
[01/05/2022 13:30:18] Job Status:
{
"status": "failedInstructions",
"reportUrl": "https://dasprod-store.s3.amazonaws.com/workItem/cottage_bim_da/8028b869feac4e8b9cc24c54a89e40ef/report.txt?AWSAccessKeyId=ASIATGVJZKM3P2XYAJCU&Expires=1641438001&x-amz-security-token=IQoJb3JpZ2luX2VjEIb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIBFxAk5bBR55hEe7%2F00ieRjl65xyRpZCe6SKLmPvwYNSAiEAsPt%2BScc6SpRCDg3r2VPzEW6dGp8McDOeDtwPKBLkL0cqpAIIj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARADGgwyMjA0NzMxNTIzMTAiDHCOBQgxf7eDdRYPtyr4AWMXNwXNfkeP8BPBpeNnGvWCmAyLsR0gGGa23e3W5B8sqUyl64XRqjHrYsCUsr3N7TsEt64jMh%2FaBd%2BN3vF31gS2Eu68hH81XfkBJ5PKCCQEnBwwk8ILl2uyCI73URxBbRfffdgPivSpYN8VAYSfpFZh199pynYxYi2JVeBqpec3904b4u76iIF%2BONOvf95NZYQHkfGMfLMoUAaemNEO8H%2BZnz4ZkctEstQIGa7uOskL9JKJcOPwJ1xchNxpsC3DGyKxK53WE4rdxyx6y0VY3PnnPwdT2kttQZjJZO7SL%2BgyRe9qD1GWq0%2Fu3Eb3ceEh3LccEat9UrTNMNu51o4GOpoBQECjtzWlgIAjlgtGhLUmXDsfda7u9mP2MrHIYTZdlgQA8WJnzCR29%2FJtK5DhyvwXymr3dtCOuBpbhcN%2BGPSe9CftPBnbWihvyyIfdhmduRC0VodqNXh1NZYYw2kzobvfGywz8PudOPE3cn%2FxDQ9Z0dJGCwj%2BwtwuCZB1zN3LlGW47Xjn9wbw3hHyFRA6CoYXawxZspr0cEteuw%3D%3D&Signature=ARSd%2BZtXJsOmxOYOUq2uH4eo0mM%3D",
"stats": {
"timeQueued": "2022-01-05T13:30:01.1704611Z",
"timeDownloadStarted": "2022-01-05T13:30:01.3010679Z",
"timeInstructionsStarted": "2022-01-05T13:30:02.1720008Z",
"timeInstructionsEnded": "2022-01-05T13:30:18.0684293Z",
"bytesDownloaded": 20185088
},
"id": "8028b869feac4e8b9cc24c54a89e40ef"
}
FYI, I'm also attaching my C# code below which I suspect is where the error message is coming from.
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class DaApp : IExternalDBApplication
{
public ExternalDBApplicationResult OnStartup(Autodesk.Revit.ApplicationServices.ControlledApplication app)
{
DesignAutomationBridge.DesignAutomationReadyEvent += HandleDesignAutomationReadyEvent;
return ExternalDBApplicationResult.Succeeded;
}
public ExternalDBApplicationResult OnShutdown(Autodesk.Revit.ApplicationServices.ControlledApplication app)
{
return ExternalDBApplicationResult.Succeeded;
}
public void HandleDesignAutomationReadyEvent(object sender, DesignAutomationReadyEventArgs e)
{
e.Succeeded = true;
GenerateModelLines(e.DesignAutomationData);
}
public static void GenerateModelLines(DesignAutomationData data)
{
if (data == null) throw new ArgumentNullException(nameof(data));
Application rvtApp = data.RevitApp;
if (rvtApp == null) throw new InvalidDataException(nameof(rvtApp));
string modelPath = data.FilePath;
if (String.IsNullOrWhiteSpace(modelPath)) throw new InvalidDataException(nameof(modelPath));
Document doc = data.RevitDoc;
if (doc == null) throw new InvalidOperationException("Could not open document.");