you can p/invoke entget
#region
using System;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
//using AcExtensions; mine
using AcAp = Autodesk.AutoCAD.ApplicationServices;
#endregion
[assembly: CommandClass(typeof(ExecMethod.Commands))]
//++--
namespace ExecMethod
{
public class Commands
{
[CommandMethod("doit")]
static public void doit()
{
Editor ed = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;
try
{
foreach (TypedValue tv in SafeNativeMethods.EntGet(ed.GetEntity("Get It").ObjectId))
{
ed.WriteMessage("\n{0}", tv);
}
}
catch (System.Exception ex)
{
ed.WriteMessage("\n" + ex.Message);
ed.WriteMessage("\n" + ex.StackTrace);
}
}
}
public static class SafeNativeMethods
{
//++-- TonyT
//++-- http://discussion.autodesk.com/forums/thread.jspa?messageID=5656222�
[DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acdbGetAdsName@@YA?AW4ErrorStatus@Acad@@AAY01JVAcDbObjectId@@@Z")]
extern static public ErrorStatus acdbGetAdsName(out Int64 entres, ObjectId id);
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
extern static IntPtr acdbEntGet(out Int64 e);
public static ResultBuffer EntGet(ObjectId id)
{
Int64 e;
if (acdbGetAdsName(out e, id) == ErrorStatus.OK)
{
IntPtr res = acdbEntGet(out e);
if (res != IntPtr.Zero)
return ResultBuffer.Create(res, true);
}
return null;
}
}
}