OK....
Mick, yes I tried that and it still only outputs what it wants. In this case it should be 15.00 but I only get 15 at the prompt.
Kerry, I've got lots of reading now, thanks.
Tim, thanks for the link. Based on the discussion there I was able to get "N2" to work. "D2" throws the exception, but the Help says that d,D,n,N are all valid Format identifiers.......
Here's a quickie test that shows these in action:
using System;
using System.Collections.Generic;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
namespace SelectFeature
{
public class Class1
{
public Class1()
{
}
[CommandMethod("TestMe1")]
static public void testmenow()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptDistanceOptions distPrmt = new PromptDistanceOptions("");
distPrmt.Message = "\nOffset distance, negative for left side: ";
distPrmt.DefaultValue = 5.0;
PromptDoubleResult offDist = ed.GetDistance(distPrmt);
ed.WriteMessage("Test1 Offset selected is: " + offDist.Value);
}
[CommandMethod("TestMe2")]
static public void testmenow()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptDistanceOptions distPrmt = new PromptDistanceOptions("");
distPrmt.Message = "\nOffset distance, negative for left side: ";
distPrmt.DefaultValue = 5.0;
PromptDoubleResult offDist = ed.GetDistance(distPrmt);
ed.WriteMessage("Test2 Offset selected is: " + offDist.Value.ToString("N2"));
}
[CommandMethod("TestMe3")]
static public void testmenow()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptDistanceOptions distPrmt = new PromptDistanceOptions("");
distPrmt.Message = "\nOffset distance, negative for left side: ";
distPrmt.DefaultValue = 5.0;
PromptDoubleResult offDist = ed.GetDistance(distPrmt);
ed.WriteMessage("Test3 Offset selected is: " + offDist.Value.ToString("D2"));
}
}
}
This will create 3 commands, TestMe1, TestMe2 & TestMe3. 1 & 2 will work, but 3 should throw that exception.
I'm off to take some aspirin. This little problem has kicked my behind for 2 hours now......
BTW, Kerry, how'd you know we were going to be rained on all weekend?