;简单修改by edata@mjtd
- (defun c:2l(/ ent1 ent2 ent3 ent4 wwdy str1 pt1 pt2 dis1 ag1 pt1u pt2u)
- (setq ent1 nil ent2 nil ent3 nil ent4 nil)
- (defun sk_mkl(p1 p2)
- (entmakex
- (list
- '(0 . "line")
- (cons 10 p1)
- (cons 11 p2)
- )
- )
- )
- (setq wwdy (getreal "\n请输入宽度:"))
- (if (= wwdy nil)(setq wwdy 6))
- (setq str1 (rtos wwdy 2 2))
- (prompt "\n now dline width is: ")
- (prompt str1)
- (if(setq pt1 (getpoint "\n enter start point:"))
- (while (setq pt2 (getpoint pt1 "\n enter next point:"))
- (redraw)
- (if (and ent1 ent2)
- (setq ent3 ent1
- ent4 ent2))
- (setq dis1 (* 0.5 wwdy))
- (setq ag1 (angle pt1 pt2))
- (setq pt1u (polar pt1 (+ ag1 1.5708) dis1))
- (setq pt2u (polar pt2 (+ ag1 1.5708) dis1))
- (setq pt1d (polar pt1 (- ag1 1.5708) dis1))
- (setq pt2d (polar pt2 (- ag1 1.5708) dis1))
- (setq ent1(sk_mkl pt1u pt2u)
- ent2(sk_mkl pt1d pt2d)
- pt1 pt2
- )
- (setvar "FILLETRAD" 0.0)
- (command "FILLET" ent1 ent3)
- (command "FILLET" ent2 ent4)
- )
- )
- (princ)
- )
|