I need to write an AutoLISP program which asks user to select a point and then draws an equilateral
triangle by the length 3 from that point. Any ideas?
![]() |
|
![]() |
|
![]() |
|
![]() |
I need to write an AutoLISP program which asks user to select a point and then draws an equilateral
triangle by the length 3 from that point. Any ideas?
I am probably missing something but you could use the poly command and set the number of sides to 3.
Probably worth asking a mod to move this to the lisp area for better answers.
Regards
I've moved this post to the lisp forum, thanks.
I'd also suggest checking out some of the available LISP tutorials in the Autodesk University Course archives... http://forums.augi.com/forumdisplay....nd-Programming
Melanie Stone
@MistresDorkness
ARCHIBUS, FMS/FMInteract and AutoCAD Expert (I use BricsCAD, Revit, & Tririga, too)
Technical Editornot all those who wander are lost
Simple code ..
Code:(defun c:Test (/ p1 p2 p3) (if (setq p1 (getpoint "\n Specify the base point :")) (progn (setq p2 (polar p1 0. 3.) p3 (polar p2 (* (/ pi 3.) 2.) 3.) ) (command "_.pline" "_non" p1 "_non" p2 "_non" p3 "c") ) ) (princ) )
In addition to the comments from others, I had this old lisp laying around. It does a little more than what you're asking.
C:> ED WORKING.... ▒
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3630, Core i9-9900K 5.0GHz, 128GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000