帮我看一下坐标保留到一位小数 如何设置? 求高手帮帮忙!
[CommandMethod("LZ")]
public void testfunction2()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = HostApplicationServices.WorkingDatabase;
SelectionFilter sf = new SelectionFilter(new TypedValue[]{ new TypedValue(0, "Line") });
PromptSelectionResult psr = ed.GetSelection(sf);
if (psr.Status != PromptStatus.OK)
return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord curSpace = tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
foreach (ObjectId id in psr.Value.GetObjectIds())
{
Entity ent = tr.GetObject(id, OpenMode.ForRead) as Entity;
if (ent.GetType() == typeof(Line))
{
Line l = ent as Line;
Point3d pt1 = l.StartPoint;
Point3d pt2 = l.EndPoint;
ed.WriteMessage("\n" + pt1 + pt2);
}
else
{