My MdbDbg craps out when selecting a Mleader so just glancing at properties how do you go about getting the length of the line in picture.
This seems to work with little testing but was wondering of a better way.
[CommandMethod("mleaderlength")]
public void mleaderlength()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
using (Transaction trx = db.TransactionManager.StartTransaction())
{
MLeader ml = trx.GetObject(ed.GetEntity("\nSelect ML").ObjectId, OpenMode.ForRead) as MLeader;
Point3dCollection pnts = ml.MText.GetBoundingPoints();
Point3d endP = pnts[2];
double length = endP.DistanceTo(pnts[3]) + ml.DoglegLength + ml.LandingGap;
ed.WriteMessage(length.ToString());
trx.Commit();
}
}