;;; Equal Divide distance between 2 points by XLINES
;;; Modified by Igal Averbuh 2019
(defun c:XXE ( / p1 p2 x dnum v n num xd k p pl )
(while (setq p1 (if (null p1) (getpoint "\nPick or specify first point : ") p2))
(setq p2 (getpoint p1 "\nPick or specify second point - ENTER TO FINISH : "))
(if (and p1 p2)
(progn
(if (null x)
(setq x (/ (distance p1 p2) 4200))
)
(if (null dnum)
(setq dnum (fix (1+ x)))
(setq dnum (fix (1+ (/ (distance p1 p2) xd))))
)
(setq v (mapcar '- p2 p1))
(setq n (polar '(0.0 0.0) (+ (angle '(0.0 0.0) v) (* 0.5 pi)) 1.0))
(initget 6)
(setq num (getint (strcat "\nSpecify number of division XLINES between two picked points: ")))
(setq num (+ num 1))
(if (null num)
(setq num dnum)
)
(setq xd (/ (distance p1 p2) num))
(setq k 1)
(repeat num
(setq p (polar p1 (angle p1 p2) (* k xd)))
(setq k (1+ k))
(setq pl (cons p pl))
)
(setq pl (reverse pl))
(foreach p pl
(entmake
(list
'(0 . "XLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbXline")
(cons 10 p)
(cons 11 n)
)
)
)
(setq pl nil)
)
)
(command "erase" "L" "")
)
(princ)
(command "undo" "")
)
(c:XXE)