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, Tandem, and Planon, 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) )
Is the POLYGON command not good enough?
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000