here is how you would do it in acad
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
[assembly: CommandClass(typeof(ExecMethod.Commands))]
namespace ExecMethod
{
public static class Commands
{
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
extern static int acedInvoke(IntPtr rbIn, out IntPtr rbOut);
public static ResultBuffer Invoke(ResultBuffer rbIn)
{
IntPtr pRb = IntPtr.Zero;
acedInvoke(rbIn.UnmanagedObject, out pRb);
return DisposableWrapper.Create(typeof(ResultBuffer), pRb, true) as ResultBuffer;
}
[CommandMethod("doit")]
public static void MyCommand()
{
ResultBuffer rbOut = new ResultBuffer();
rbOut.Add(new TypedValue((int)LispDataType.Text, "thisisatest"));
rbOut.Add(new TypedValue((int)LispDataType.ListBegin));
rbOut.Add(new TypedValue((int)LispDataType.Int32, 1));
rbOut.Add(new TypedValue((int)LispDataType.Int32, 2));
rbOut.Add(new TypedValue((int)LispDataType.Int32, 3));
rbOut.Add(new TypedValue((int)LispDataType.Int32, 4));
rbOut.Add(new TypedValue((int)LispDataType.ListEnd));
ResultBuffer rbIn = Invoke(rbOut);
List<TypedValue> list = new List<TypedValue>(rbIn.AsArray());
list.ForEach(X =>
AcAp.Application.DocumentManager.
MdiActiveDocument.Editor.WriteMessage(X.Value.ToString()));
}
}
}