thanks Mike, I found that there are entities when I created this peace of code.
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Collections;
using AcadAPP=Autodesk.AutoCAD.ApplicationServices.Application;
namespace ClassLibrary4
{
///
/// Summary description for Class1.
///
public class Class1:Autodesk.AutoCAD.Runtime.IExtensionApplication
{
public void Initialize()
{
Autodesk.AutoCAD.Interop.AcadApplication AcadApp=(Autodesk.AutoCAD.Interop.AcadApplication)Marshal.GetActiveObject("AutoCAD.Application.16.2");
Autodesk.AutoCAD.Interop.AcadDocument AcadDoc=AcadApp.ActiveDocument;
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
try
{
BlockTable bt = (BlockTable)trans.GetObject(HostApplicationServices.WorkingDatabase.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
//MessageBox.Show();
foreach (ObjectId id in btr)
{
MessageBox.Show("HI");
Entity ent = (Entity)trans.GetObject(id, OpenMode.ForWrite, false);
////////////////////////////////The following code i copied it from RonaldF Message in
////////////// http://discussion.autodesk.com/thread.jspa?messageID=5205357
ObjectId[] ids = new ObjectId[1];
ids[0] = ent.Id;
SubentityId index = new SubentityId(SubentityType.Edge, 0);
FullSubentityPath path = new FullSubentityPath(ids, index);
ent.Highlight(path, true);
///////////////////////////////////////////////////////////////////////////////
}
}
finally
{
trans.Dispose();
}
}
public void Terminate()
{
}
}
I found that when each message box appear the whole shelves where highlighted.
if I create the code which i asked to I will post it here in this discussion.
Nawara17