Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XLINE PICK POINT PROBLEM

1 REPLY 1
SOLVED
Reply
Message 1 of 2
agent47x
773 Views, 1 Reply

XLINE PICK POINT PROBLEM

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" "")

 

 

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: agent47x

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.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost