sonny_wu 发表于 2010-4-26 17:08:00

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个值?

sonny_wu 发表于 2010-4-26 17:24:00

我自己想到办法了,

carrot1983 发表于 2010-4-27 11:26:00

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]
查看完整版本: PromptPointOptions的问题求助