Is there a method to find all text elements near a certain distance from a specified point? Thanks.
Solved! Go to Solution.
Solved! by autogis. See the answer in context.
you can use selection filter base on entity and co-ordinate. you can go through below links:
// Start Transaction
using (Transaction tr = db.TransactionManager.StartTransaction())
BlockTableRecord modelSpace = (BlockTableRecord)tr.GetObject(
foreach (ObjectId id in modelSpace)
// Pick only Leaders
if (id.ObjectClass.DxfName == "LEADER")
// Pick only HOMES
Leader leader = (Leader)tr.GetObject(id, OpenMode.ForRead);
if (leader.Layer == "HOMES")
// Leader Points (Just use the last point)
Point3dCollection pts = new Point3dCollection();
leader.GetStretchPoints(pts); // NOTE: pts will have all the points of the leader
// HERE I would call a method
// that would get all text elements within a certain distance of: pts[pts.Count-1] <<The last point of the leader
You might write some code that test object locations within a area.
I just wrote one my self using the region test based on a idea of Tony T.
However i changed the code to do simple inside polygon tests because i needed more speed and my area's are simple 2D rectangles.
Access a broad range of knowledge to help get the most out of your products and services.