Learn AUTOCAD-AUTOLISP with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Hello World Command
(defun c:HELLO ()
(princ "Hello, World from AutoLISP!\n")
(princ)
)
Defines a custom AutoCAD command that prints 'Hello, World!' in the command line.
2
Draw a Line via AutoLISP
(defun c:DRAWLINE ()
(command "_LINE" '(0 0) '(100 100) "")
(princ "Line drawn from (0,0) to (100,100).\n")
(princ)
)
AutoLISP function that draws a line between two hardcoded points in AutoCAD.