Actually, the error doesn't raise if I just run (Command ^C^C) from a lisp script. The case is, my app is a .NET app, and I call some SendStringToExecute to use some lisp code. To be sure to end the lisp routine, I put at the end:
doc.SendStringToExecute("(Command ^C^C)", True, False, True)
The result of Forge Design Automation is: failedinstruction
Though I can easily find another way to get around this, it cost me more than a day to figure out that it was the (Command ^C^C) cause the failedinstruction, while everything else was working fine. Hope this bug will be fixed as well as anything similar won't raise up again somewhere else.
I isolate the case like this:
- Make a .NET bundle, or just reuse any of your existing one in debug mode
- Add the following lisp define function (or it can be a custom command, whatever):
<LispFunction("l+SendStringToExecute")> Public Shared Function lsp_SendStringToExcute(args As ResultBuffer) As Object Dim script$ = Nothing For Each arg As TypedValue In args.AsArray script = arg.Value Exit For Next script = script.Trim() If script <> "" Then Document doc = AcadApplication.DocumentManager.MdiActiveDocument doc.SendStringToExecute(script + vbCr, True, False, True) End If Return New TypedValue(LispDataType.T_atom) End Function
- Upload the bundle to Forge, create a dump activity and just run the custom lisp solely:
(l+SendStringToExecute "(Command ^C^C)")
- The result log is here like this:
... [02/01/2021 17:23:26] Command: (l+SendStringToExecute "(Command ^C^C)") [02/01/2021 17:23:26] T [02/01/2021 17:23:26] Command: (Command ^C^C) [02/01/2021 17:23:26] *Cancel* [02/01/2021 17:23:26] Command: nil [02/01/2021 17:23:27] End AutoCAD Core Engine standard output dump. [02/01/2021 17:23:27] Error: AutoCAD Core Console failed to finish the script - an unexpected input is encountered. [02/01/2021 17:23:27] End script phase. [02/01/2021 17:23:27] Error: An unexpected error happened during phase CoreEngineExecution of job. [02/01/2021 17:23:27] Job finished with result FailedExecution [02/01/2021 17:23:27] Job Status: { "status": "failedInstructions", ...