I'm currently converting an Lisp project to C# .NET.
Not al functionalities wil be merged at once. For this reason i still use some Autolisp commands in my C# implementation.
I have the following code to execute some Autolisp command. This command returns a string printed in the Autocad console.
public void GetCoordinateSystem()
{
var document = Application.DocumentManager.MdiActiveDocument;
var lispCommand = "(some_lisp_command) ";
document.SendStringToExecute(lispCommand, false, false, false);
}
My question is how can i catch te string that the Autolisp command returns in the console.
Solved! Go to Solution.
Solved by nwbos. Go to Solution.
I have found some working
public void GetCoordinateSystem()
{
var document = GetActiveDocument();
string someLispCommandResult = "(some_lisp_command) ";
document.SendStringToExecute(someLispCommandResult, false, false, false);
System.Collections.Generic.List<string> result = Autodesk.AutoCAD.Internal.Utils.GetLastCommandLines(3, false);
Application.ShowAlertDialog(result[2]);
}
this feels a bit hacky can this be implemented in a more proper way?
Can't find what you're looking for? Ask the community or share your knowledge.