Center Point of an Arc I just made

Center Point of an Arc I just made

emoran6CG9J
Participant Participant
795 Views
4 Replies
Message 1 of 5

Center Point of an Arc I just made

emoran6CG9J
Participant
Participant

Im a little new to LISP in general and I am trying to make a arc leader LISP as a small project for myself.  Currently I have made an arc using the 3 points the user need to input.  I could like to make the arrow out of a shape and point the arrow in the direction tangent to the end point of the arc.  

 

Based on how I want to use the geometry I need to get the center point of the arc I just made.  

 

my question is:  how can I select the center point of the arc I just made?  Ideally I would like get the centerpoint of the arc and throw it into a variable that I can use for the geomerty calculations.

 

This is what I have so far.. I know its kinda basic: 

 

(defun C:artic ( / PT1 PT2 PT3)

    ; GET INITIAL POINTS AND MAKE ARC  
;----------------------------------------------
    (setq PT1 (GETPOINT "/nPICK START POINT: ")
      PT2 (GETPOINT "/nPICK MIDDLE POINT")
      PT3 (GETPOINT "/nPICK FINAL POINT")
)
(COMMAND "ARC" PT1 PT2 PT3)
  ;-----------------------------------------------
 
)
 

 

0 Likes
Accepted solutions (2)
796 Views
4 Replies
Replies (4)
Message 2 of 5

pendean
Community Legend
Community Legend

First 10-ish top links in their search I suspect is enough to get you started https://www.google.com/search?q=autocad+arc+leader+lisp

 

Assuming you already looked into using a Dynamic Block possibly with a parametric action and it did not meet your needs.

0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

(setq YourArcCenterVariableName (cdr (assoc 10 (entget (entlast)))))

Kent Cooper, AIA
0 Likes
Message 4 of 5

emoran6CG9J
Participant
Participant
Accepted solution

Wow okay, so I see what you did to get the last entity that was made. 

 

Where can I find the documentation of the formatting of this entity data?  I see all of the properties that you filtered out with the "10" which I assume is the 10 for the center point information.  

 

Im looking through the developer directory but I am having trouble looking up information on entities and parameters for standard ACAD commands.

 

Thank you for helping me out with this

 

0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

You can find the DXF codes [such as that 10 for the center of an Arc, Circle or Ellipse] >here<.  The AutoLisp functions reference is >here<.

Kent Cooper, AIA
0 Likes