Ok. I looked at this a bit more and there really isn't any way to accomplish
what you want using supported, documented APIs. There's an undocumented API
that you can use if you are so inclined. Please see below:
#region Using directives
using System;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using System.Threading;
using System.Globalization;
using System.Runtime.InteropServices;
#endregion
namespace RSNNAcadApp.Test
{
public class Test
{
//this is an undocumented api exported from acad.exe. Use it at your
own risk.
//
// Setting this flag tells AutoCAD to display the last string output
to the command line
//in the Dynamic Input prompt window (one time only.)
[DllImport("acad.exe",
EntryPoint="?acedSetDynInputDisplayMessage@@YA_N_N@Z")]
private static extern bool acedSetDynInputDisplayMessage(bool
displayMessageOnce);
private double m_dist; //last distance chosen (per-document)
private bool m_firstTime = true; //first invocation of "test"?
(per-document)
//use a non-static command method so the enclosing class (Test) will
be instantiated
//for each document
[CommandMethod("test")]
public void DoIt()
{
Editor ed =
Application.DocumentManager.MdiActiveDocument.Editor;
PromptDistanceOptions opt1 = new PromptDistanceOptions("Abstand
zeigen");
opt1.AllowNegative = false;
opt1.AllowZero = false;
opt1.AllowNone = false;
opt1.UseDashedLine = true;
if (!m_firstTime)
opt1.DefaultValue = m_dist;
PromptDoubleResult res = ed.GetDistance(opt1);
if (res.Status == PromptStatus.OK)
{
m_dist = res.Value;
ed.WriteMessage(String.Format("Abstand = {0}",
m_dist.ToString()));
acedSetDynInputDisplayMessage(true);
}
m_firstTime = false;
}
void MyPointFilter(object sender, PointFilterEventArgs e)
{
e.Result.ToolTipText = String.Format("Abstand = {0}",
m_dist.ToString());
}
}
}
wrote in message news:4861461@discussion.autodesk.com...
Hi Albert,
i will look at it, but isn't it a little bit confusing that Autodesk makes a
new dynamic input and says that you don't need the commandline, and on the
other side it is just possible to write something in the commandline and not
at the cursor with .NET!?!
Roland