Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
Recently, I how to learn get Coordinate value from click by mouse. However, the value that i receive has many number behind "." . So I want to get a number that precision is ".00". For example Point 1 (5.23, 6.45, 5,77)
NOT ((5.23434645, 6.45463463456, 5.77xxx-xxxxxxxx). You can see the snapshot below:
Someone can help me edit again this code
Thank you !
[CommandMethod("11GetPoint")]
public void 11GetPoint()
{
Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
PromptPointOptions pr = new PromptPointOptions("Click mouse to get point");
pr.AllowNone = true;
pr.AllowArbitraryInput = true;
PromptPointResult kq = ed.GetPoint(pr);
if (kq.Status != PromptStatus.OK) return;
pr.BasePoint = kq.Value;
pr.UseBasePoint = true;
PromptResult kq1 = ed.GetPoint(pr);
if (kq1.Status != PromptStatus.OK) return;
ed.WriteMessage("\np1 = " + kq.Value.ToString() + "p2 = " + kq1.ToString());
}
Solved! Go to Solution.