关于GetPoint的问题
在C#进行二次开发时,例用GetPoint方法先取图中多个坐标点,现在想当输入回车或鼠标右键时认为是选点结束,这个怎么实现,我写的代码只能按Esc键才能完成,请大神帮忙。public void AddPline()
{
Class2 c2 = new Class2();
Point2dCollection pts = new Point2dCollection() ;
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
PromptPointResult ppr = ed.GetPoint("\n请选择多段线顶点");
while( ppr.Status == PromptStatus.OK )
{
if (ppr.Status == PromptStatus.None)
break ;
Point3d tmp =(Point3d)ppr.Value ;
Point2d pt= new Point2d(tmp.X,tmp.Y );
pts.Add((pt));
ppr = ed.GetPoint("\n请选择多段线顶点");
}
c2.AddPline(pts);
}
public void Test2()
{
PromptPointOptions opts = new PromptPointOptions("\nselect a point:");
opts.AllowNone = true;
PromptPointResult res;
do
{
res = SystemManager.Editor.GetPoint(opts);
}while (res.Status == PromptStatus.OK);
}
页:
[1]