The PromptPointOptions class can be used to drag from a basepoint.
See the BasePoint and UseBasePoint properties of that class in
the docs.
Your example code suggests you need to become more familiar
with some more basic things, though. For example, you read the
'.Value' property of the object returned by GetPoint(), assuming
there was a valid response to the GetPoint() call, which may not
be the case.
In VBA, an exception is thrown when the user does not respond
to the input as expected (e..g, they press ESCape). In .NET, there
is no exception thrown, and you're required to check the Status
property of the PromptResult based class returned by most of the
GetXxxxx() methods.
So, you can't use the Value property of the PromptPointResult
returned by GetPoint, without first checking the Status property,
like this:
{code}
public static void Test()
{
PromptPointOptions ppo = new PromptPointOptions("\nFirst point: ");
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
PromptPointResult result = ed.GetPoint( ppo );
if( result.Status == PromptStatus.Ok )
{
// user responded with valid input, so get the second point:
Point3d startPoint = result.Value;
ppo.Message = "\nSecond point: ";
// Set basepoint to the first point entered:
ppo.BasePoint = startPoint;
ppo.UseBasePoint = true;
result = ed.GetPoint( ppo );
if( result.Status == PromptStatus.Ok )
{
ed.WriteMessage("\nFirst point: {0}", startPoint);
ed.WriteMessage("\nSecond point: {0}", result.Value);
// Both points were entered successfully, so use them
}
}
}
{code}
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
wrote in message news:6054304@discussion.autodesk.com...
Have been trying to find some information on getting points to draw temporary lines. So far I have StartPoint = myDWG.Editor.GetPoint("Select Start Point:").Value EndPoint = myDWG.Editor.GetPoint("Select End Point:").Value which works great. What I would like to do is something similar to VBA - ie EndPoint = ThisDrawing.Utilities.GetPoint(StartPoint,"Select End Point: ") Is this possible? Secondly, as they are temporary lines, how do you go about deleting them? I have a VB.NET for AutoCAD book, but can't seem to find anything obvious that would do this. Any help/suggestions appreciated. Brent