//开启动态查询
[CommandMethod("PointMonitor")]
public void PointMonitor()
{
Editor ed = Tools.Editor;
ed.PointMonitor += new PointMonitorEventHandler(ed_PointMonitor);
}
[CommandMethod("PointMonitorQiut")]
//关闭动态查询
public void PointMonitorQiut()
{
Editor ed = Tools.Editor;
ed.PointMonitor -= new PointMonitorEventHandler(ed_PointMonitor);
}
void ed_PointMonitor(object sender, PointMonitorEventArgs e)
{
FullSubentityPath[] epaths = e.Context.GetPickedEntities();
if (epaths.Length > 0)
{
FullSubentityPath epath = epaths[0];
Entity ent = Tools.GetEntity(epath.GetObjectIds()[0]);
ResultBuffer rb = Tools.GetXData(ent);
if (rb != null)
{
TypedValue[] tv = rb.AsArray();
string str;
string pl_num1 = tv[1].Value.ToString().Split(',')[0];
str = pl_num1;
e.AppendToolTipText(str);
}
}
}
为什么epaths的length是0呢?