PromptPointOptions的问题求助
我想通过下列语句Editor ed = Autodesk..ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
PromptPointOptions ppo = new PromptPointOptions("指定插入点\n:");
double x = ed.GetPoint(ppo).Value.X;
double y = ed.GetPoint(ppo).Value.Y;
获取指定点的X值和Y值。
但是出现个问题,就是要点2次才能获得X,Y的值,我试过单独获取X值把double y = ed.GetPoint(ppo).Value.Y; 去掉,就只需点一下了。
有什么办法可以让我只点一下 就获取2个值?
我自己想到办法了, PromptPointOptions pPtOpts = new PromptPointOptions("\n指定点: ");
PromptPointResult pPtRes = ed.GetPoint(pPtOpts);
Point3d pt = pPtRes.Value;
double x = pt.X;
double y = pt.Y;
ed.WriteMessage("X值:" + "{0}" + " Y值:" + "{1}", x, y);
页:
[1]