Hi again...
This lisp, thanks to part of your code and another code, draws a double line and a center line.
(defun c:porta(/ eao)
(setvar "blipmode" 0)
(if (not cwidth)
(setq cwidth 0.0)
)
(prompt (strcat "\n Width beetwin line <"(rtos cwidth) ">: "))
(setq tcwidth (getreal))
(if tcwidth
(setq cwidth tcwidth)
)
(setq pt1 (getpoint "\nStart point... "))
(if pt1
(setq pt2 (getpoint pt1 "\nTo point... "))
)
(setq threshold 1
segment 0
oang nil
ofrad (getvar "filletrad")
)
(if (>= cwidth threshold)
(setq inrad (* 1.0 cwidth) outrad (* 2.0 cwidth))
)
(setq a (angle pt1 pt2)
1o1 (polar pt1 (+ a (/ pi 2.0)) (/ cwidth 2.0))
1o2 (polar pt2 (+ a (/ pi 2.0)) (/ cwidth 2.0))
ro1 (polar pt1 (- a (/ pi 2.0)) (/ cwidth 2.0))
ro2 (polar pt2 (- a (/ pi 2.0)) (/ cwidth 2.0))
)
(if (> segment 0)
(setq eao ea ebo eb)
(setq dimpt (polar pt1 (+ a (/ pi 2.0))(+ (/ cwidth 2.0) 1.0)))
)
(command "line" 1o1 1o2 "")
(setq ea (entlast))
(command "line" ro1 ro2 "")
(setq eb (entlast))
(if (and (> segment 0)(/= a oang)(/= pi (abs (- a oang))))
(progn
(setq xa (- oang a))
(if (or (<= xa (* -1.0 pi))(and (> xa 0)(< xa pi)))
(setq ra outrad
rb inrad
dimpt (polar pt1 (+ a (/ pi 2.0)) (+ (/ cwidth 2.0) 1.0)))
(setq ra inrad
rb outrad
dimpt (polar pt1 (- a (/ pi 2.0)) (+ (/ cwidth 2.0) 1.0)))
)
(setq ss (ssadd ea))
(setq ss (ssadd eao ss))
(setvar "filletrad" ra)
(command "fillet" (ssname ss 0)(ssname ss 1))
(setq pp1 (cdr (assoc 10 (entget ea))))
(if (> segment 0)
(setq po1 (cdr (assoc 11 (entget eao))))
)
(setq ss (ssadd eb))
(setq ss (ssadd ebo ss))
(setvar "filletrad" rb)
(command "fillet" (ssname ss 0)(ssname ss 1))
)
)
(setq ang (angle pt1 pt2)
mid (polar pt1 ang (/ (distance pt1 pt2) 2.0))
)
(command "_.line" "_non" (polar mid (+ ang (/ pi 2.0)) 0.3)) "_non" (polar mid (- ang (/ pi 2.0)) 0.3)) "")
)
I would like to change this code so as to give users two choices:
1. Enter the distance between the two lines directly in the command bar (as it is now);
2. Enter the distance between the two lines with the mouse by clicking two points.
Can you help me?
Regards
Carmi