Luis,
From Jim
QueryEntTests.cs
$DateTime: 2005/06/10 17:13:15
public void
Extents()
{
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = m_db.TransactionManager;
while (true) {
PromptEntityResult prEntRes = ed.GetEntity("\nSelect entity to show extents");
if (prEntRes.Status != PromptStatus.OK)
break;
using (Autodesk.AutoCAD.DatabaseServices.Transaction tr = tm.StartTransaction()) {
AcDb.Entity ent = (AcDb.Entity)tr.GetObject(prEntRes.ObjectId, OpenMode.ForRead);
Extents3d ext = ent.GeometricExtents;
Point3d centerPt = Utils.Ge.Midpoint(ext.MinPoint, ext.MaxPoint);
Utils.AcadUi.PrintToCmdLine(string.Format("\nEXTMIN: {0}", Utils.AcadUi.PtToStr(ext.MinPoint)));
Utils.AcadUi.PrintToCmdLine(string.Format("\nEXTMAX: {0}", Utils.AcadUi.PtToStr(ext.MaxPoint)));
Utils.AcadUi.PrintToCmdLine(string.Format("\nCENTER PT: {0}", Utils.AcadUi.PtToStr(centerPt)));
tr.Commit();
MakeExtentsBlock(ext);
}
}
}
Which appears to be essentially similar to mine
Note that his version with $DateTime: 2004/11/24 uses ent.GeomExtents not ent.GeometricExtents.