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