Check this sample:
[code]
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
private static extern Int32 acedRedraw(long [] name, Int32 mode);
#if ACADR16
[DllImport("acdb16.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="?acdbGetAdsName@@YA?AW4ErrorStatus@Acad@@AAY01JVAcDbObjectId@@@Z")]
#elif ACADR17
[DllImport("acdb17.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="?acdbGetAdsName@@YA?AW4ErrorStatus@Acad@@AAY01JVAcDbObjectId@@@Z")]
#endif
private static extern int acdbGetAdsName(long [] name, ObjectId objId);
[CommandMethod("MyRedraw")]
static public void MyRedraw()
{
acedRedraw(null, 1);
}
// Highlight entity
[CommandMethod("HlEnt")]
static public void HlEnt()
{
PromptEntityOptions entityOpts = new PromptEntityOptions("\nSelect entity: ");
PromptEntityResult rc = Application.DocumentManager.MdiActiveDocument.Editor.GetEntity(entityOpts);
if (rc.Status == PromptStatus.OK)
{
long [] ent = new long [] { 0, 0};
acdbGetAdsName(ent,rc.ObjectId);
acedRedraw(ent, 3);
}
}
[/code]