AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Want to repeat a command indefinitely using AutoLisp?
Try this :

;;;<--Coding starts here

(defun c:test ()

(prompt "\nSpecify first point: ")

(command "_LINE")

(while

(= 1 (logand (getvar "CMDACTIVE") 1))

(command PAUSE)

(prompt "\nSpecify next point: ")

);while

;;;Now you can carry on with rest of your programme
(alert "\nLine command is complete.")

(princ)

);defun

;;;Coding ends here-->

And here's another bit of coding that draws a never ending leader line :

;;;<--Coding starts here

(defun c:test1 ( / pt1 pt2 pt3)

(setq pt1 (getpoint "\nSpecify first point: "))

(setq pt2 (getpoint "\nSpecify next point: "))

(setq pt3 (polar pt1 (angle pt1 pt2) 3.5))

(command "_PLINE" pt1 "W" "0" 5.0 pt3 "W" "0" "0" pt2)

(while

(setq pt2 (getpoint "\nTo point: " pt2))

(command pt2)

);while

(command "")

;;;Now you can carry on with rest of your programme
(alert "\nLeader Line command is complete.")

(princ)

);defun

;;;Coding ends here-->

 
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