public void Pickpt()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
Point3d pt = Pick("\n点取");
ed.WriteMessage("\n{0:f1}", pt);
}
public static Point3d Pick(string word)
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptPointResult pt = ed.GetPoint(word);
if (pt.Status == PromptStatus.OK)
{
return (Point3d)pt.Value;
}
else
{
return new Point3d();
}
恳求斑竹帮帮我 谢谢
这贴图是执行我的代码后的效果 又把你的问题贴了一遍,汗
3楼不是有例子么 本帖最后由 飞诗(fsxm) 于 2011-1-13 12:33 编辑
while(true)
{var opt = new PromptPointOptions("\n指定下一点:");
opt.AllowNone = true;
var rst = ed.GetPoint(opt);
if (rst.Status != PromptStatus.OK) break;
...................
}
多谢了 问题已解决
public void Pickpt()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
while (true)
{
Point3d pt = Pick("\n 拾取点");
if (pt==null)
return;
ed.WriteMessage("\n{0:f1}", pt);
}
}
public static Point3d Pick(string word)
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptPointResult pt = ed.GetPoint(word);
if (pt.Status == PromptStatus.OK)
{
return (Point3d)pt.Value;
}
else
{
return null;
}
}
页:
1
[2]