Hi, I have my own "dist" command.
I pick 2 points and I show it in command line(by prompt).
However, I would like to show the line (graphicsInterface.Transient) during the process. When I pick the first point and finally pick the second point exactly as "dist" command of AutoCAD.
Thanks in advance.
Regards.
Solved! Go to Solution.
Solved by _gile. Go to Solution.
Hi,
Look at the PromptPointOptions.BasePoint and PromptPointOptions.UseBasePoint properties.
Here's a little sample:
[CommandMethod("Dist")] public void GetdDstance() { Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor; PromptPointOptions opts = new PromptPointOptions("\nSpecify the first point: "); PromptPointResult reslt = ed.GetPoint(opts); if (reslt.Status == PromptStatus.OK) { Point3d p1 = reslt.Value; opts.Message = "\nSpecify the second point: "; opts.BasePoint = p1; opts.UseBasePoint = true; reslt = ed.GetPoint(opts); if (reslt.Status != PromptStatus.OK) { Point3d p2 = reslt.Value; ed.WriteMessage("\nDistance: " + Converter.DistanceToString(p1.DistanceTo(p2))); } } }
Is this:
But I don´t want to use a specific class;
I want to jig the temporary line until click the second point.
Yes.
It is ".UseBasePoint".
Thanks.
Can't find what you're looking for? Ask the community or share your knowledge.