HI EVERYONE..
I HAVE A SIMPLE PROBLEM
I JUST WANT TO MAKE A XLINE THAT ALTERNATE HORIZONTAL AND VERTICAL IF YOU PICKPOINTS----
IF I PICK THE FIRSTPOINT IT WILL BE HORIZONTAL AND SECOND POINT WILL BE VERTICAL AND THIRD POINT WILL BE HORIZONTAL AGAIN AND THE FORTH POINT WILL BE VERTICAL AGAIN..
PLEASE HELP ME TO SOLVE THIS PROBLEM
(defun c:xlauto (pt1 pt2 pt3 pt4)
(SETVAR "CMDECHO" 0)
(COMMAND "LAYER" "MAKE" "Defpoints" "")
(command "-layer" "s" "Defpoints" "")
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Here's a pretty simple one that seems to work, if I understand correctly what you want to do:
(defun C:XLAHV (/ hv n); = XLines Alternating Horizontal/Vertical
(setq
hv '("_Hor" "_Ver")
n 1
); setq
(while T
(command "_.xline" (nth (setq n (- 1 n)) hv) pause "")
); while
); defun
It keeps going for as many as you want to draw [not just 4], and requires Escape to end it. It could be made more sophisticated in various ways, for example allowing Enter/space to end it as they do the regular Xline command.