New Lisp Routine help

New Lisp Routine help

Anonymous
Not applicable
1,296 Views
5 Replies
Message 1 of 6

New Lisp Routine help

Anonymous
Not applicable

How do I create a lisp routine that draws a circle, then inscribes an equilateral triangle and circumscribes a square while only prompting the user to chose a center point and radius for the circle?  I am having trouble figuring out the lisp routine. 

Accepted solutions (1)
1,297 Views
5 Replies
Replies (5)
Message 2 of 6

Shneuph
Collaborator
Collaborator

Maybe post what you have got so far and we can recommend changes?

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 3 of 6

Anonymous
Not applicable

plus1.JPG

this is all I have 

0 Likes
Message 4 of 6

Ranjit_Singh
Advisor
Advisor
Accepted solution

It's pretty simple using native Autocad commands, if I understand you correct

(defun c:somefunc  (/ cen rad)
 (command "._circle" (setq cen (getpoint "\nSpecify center point: ")) pause)
 (command "._polygon" 3 "_non" cen "_i" "_non" (setq rad (cdr (assoc 40 (entget (entlast))))) "._polygon" 4 "_non" cen "_c" "_non" rad))

tri_cir_square.gif

 

Message 5 of 6

Anonymous
Not applicable

This is great! That's exactly what I was looking for. Thank you, your help is very much appreciated. 

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

If you do this often, I would suggest a little drawing of that with a 1-unit radius in the Circle.  Then you can just Insert it, with the scale factors being the desired radius -- a one-command rather than three-command process.

Kent Cooper, AIA