 - (defun c:tt ()
- (or w (setq w 1000.))
- (or h (setq h 500.))
- (setq w (udist 7 "" "矩形长度<输入或鼠标直接量取>" w nil)
- h (udist 7 "" "矩形宽度<输入或鼠标直接量取>" h nil)
- os (getvar "osmode")
- )
- (setvar "osmode" 0)
- (while (not (setq e1 (entsel "\n选择参照线: "))))
- (setq p1 (osnap (cadr e1) "mid")
- p2 (osnap (cadr e1) "end")
- r (angle p1 p2)
- p1 (polar p1 r (* w -0.5))
- p2 (polar p1 r w)
- p3 (polar p2 (+ r (* 0.5 pi)) h)
- p4 (polar p1 (+ r (* 0.5 pi)) h)
- )
- (command "pline" p1 p2 p3 p4 "c")
- (setvar "osmode" os)
- (princ)
- )
|