AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

I want to in my lisp be prompted to draw a closed polyline which is usually rectangular but sometimes irregular. I get the lisp to do so but when I type "C" to close the polyline the lisp routine ends with an error.

-------------------------
The polyline query is really quite simple. Just stick it in a while loop.

;CODING STARTS HERE
(defun c:pclose ( / pt1 pt2)
(setq pt1 (getpoint "\nFirst point: "))
(setq pt2 (getpoint pt1 "\nSecond point: "))
(command "PLINE" pt1 pt2)
(while (setq pt2 (getpoint "\nTo point: " pt2))
(command pt2)
);end while
(command "c")
(princ)
)
(princ)
;CODING ENDS HERE

Note: You don't enter "C" to end the Pline, you just press "Enter"

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website