Skip to content

Instantly share code, notes, and snippets.

@Apihplays
Created May 31, 2025 07:53
Show Gist options
  • Save Apihplays/b40545660364ee9492a9b9b2a3c62407 to your computer and use it in GitHub Desktop.
Save Apihplays/b40545660364ee9492a9b9b2a3c62407 to your computer and use it in GitHub Desktop.
Autocad LISP
(defun c:draw15line ( / pt pt2)
(setq pt (getpoint "\nSpecify start point: ")) ; Prompt to specify the first point
(command "LINE" pt) ; Start the line at the first point
(while t ; Loop to keep drawing lines incrementally
(setq pt2 (polar pt (angle pt (getpoint "\nPick next point: ")) 10)) ; Calculate the next point 10 meters away from the start point
(command pt2) ; Draw the line to the new point
(setq pt pt2) ; Update the start point for the next line to be the endpoint of the current line
(princ) ; Keep the loop running for continuous lines
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment