How can I get the start and end point of a drawn line or arc?

Morning guys!
I'm programming in C# .Net. After I created an arc with this line of code Arc arc_1 = new Arc(MP1, radius, radians(90), radians(-öv_halfAngle));
This works as expected.
How can I now get the start and endpoint of arc_1 by just using code?
I mean I just need to get the startpoint value from the properties of the drawn arc (see attached picture)

Comments

  • the Startpoint and Endpoint of the Arc are just properties of the drawn arc entity...

                            Arc arcEnt = new Arc();                                       // create a new Arc entity
                            ms.AppendEntity(arcEnt);                                   //add to modelspace
                            tr.AddNewlyCreatedDBObject(arcEnt, true);     //add to drawing database
    

    and after creation

                            arcEntStartP = arcEnt.StartPoint;
                            arcEntEndP = arcEnt.EndPoint;
    
  • Tim_19
    edited April 2020

    Thanks for the quick answer Konstantin!
    If I follow your example I get the following error in the red marked line, trying to get the startpoint of arc_1: The object reference was not set to an object instance.
    Is this because I try to get the startpoint after the action.commit() ?

    never mind! "try to get the startpoint after the action.commit()" that was my fault!

    Thank you very much!

  • @Tim_19
    If you are just learning basics, be sure to visit both theswamp.org and the autodesk .net forums. They have been around much longer so have lots and lots of content on all levels. Also check out the Kean Walmsley blog Through the Interface.