How to obtain the starting and ending points of the curve when creating an arc in IJCAD

Asked 2 years ago, Updated 2 years ago, 390 views

After creating an arc, even if you use the StartPoint of ARC (Curve), you may get an end point instead of a start point.
Is there a way to get the starting point when I draw a line?

Enter a description of the image here

Enter a description of the image here
Enter a description of the image here
*The same is true when acquired from the program

using(Transaction acTrans=acDb.TransactionManager.StartTransaction())
{
    PromptSelectionResultres=acEdr.GetSelection();
    if(res.Status==PromptStatus.OK)
    {
        foreach(ObjectIdobjId in res.Value.GetObjectIds())
        {
            using (Entityent=acTrans.GetObject(objId, OpenMode.ForRead) as Entity)
            {
                if(ent is Arc)
                {
                    // For arcs, get start and end points (reversed)
                    Point 3d startPoint = arc.StartPoint;
                    Point 3endPoint = arc.StartPoint;
                }
            }
        }
    }
}

c# .net ijcad

2022-09-30 21:59

1 Answers

Is there a way to get the starting point when I draw a line?

The first point of the arc line cannot be obtained from the Arc (ARC) property.
The API specification for circular arcs does not indicate the order in which the dots are set. Curve.StartPoint and Curve.EndPoint are set with the counterclockwise direction as positive.

If the program supports it,

  • Events to monitor ARC commands, such as Document.BeginCommand
  • Events to monitor mouse coordinates, such as Editor.PointMonitor
  • Properties that hold their own information, such as DBObject.XData
  • Events to monitor database changes, such as Database.ObjectAppended

Right before you add an ARC object to the database by combining APIs such as

Keep the coordinates of the first clicked point in the extended data of the ARC object. Obtain the first click point from the extended data of the ARC object
You can use this method.


2022-09-30 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.