Lisp easy - Basic 1


With this tutorial, I start chanel for to learn programming and share codes, as well is possible donate to improve more information.
-
Step 1: Lisp ejes
First open autocad, in new drawing You need to type in tool command: vlisp
If you don´t have, first install the new prompt like visual code
Copy and paste this
;;;By Maycol V. Meza Astuquipan
;;;Date: 12-10-2023, Peru
;;;versión: v1
(defun c:ejes (/ pt0 pt1 ptx1 ptx2 pty1 pty2)
(setq pt0 (getpoint "\nIngrese punto central: "))
(setq pt1 (getpoint "\nIngrese punto de radio final"))
(setq ra (distance pt0 pt1))
(setq ptx1 (polar pt0 pi ra ))
(setq ptx2 (polar pt0 0 ra))
(setq pty1 (polar pt0 (/ pi 2) ra))
(setq pty2 (polar pt0 (* pi 1.5) ra))
(command "line" ptx1 ptx2 "")
(command "line" pty1 pty2 "")
)