谢谢大家的帮助!
按xhf大虾的说法,虽然可以不擦除线,但两条直线交点靠近圆角一边的两条小线段也保留了下来;我想可不可能得到这样一个结果:圆角后剩下一条折线和一条倒过圆角的折线(曲线?),而两条线之间没有交点。不知道这个表述是否清楚?
另外,下面这个程序运行时当选择要倒圆角的第二条线后,总是出现参数类型错误:lentityp 11。希望各位帮忙改改,感激不尽!
(defun *filerror* (cmd)
(princ cmd)
(setq *error* saveerr)
(setvar "cmdecho" echo)
(princ)
)
(defun c:intfil
(/ p1 p2 p3 p4 p5 p6 p7 x l1 l2 temp temp1 ltemp1 ltemp2)
(setq saveerr *error*)
(setq *error* *filerror*)
(setq echo (getvar "cmdecho"))
(setvar "cmdecho" 0)
;这里将选择两条要倒圆角的线
(while (= nil (setq ltemp1 (entsel "\n 选择要倒圆角的第一条线:")))
)
(while (= nil (setq ltemp2 (entsel "\n 选择要倒圆角的第二条线:")))
)
(setq p1 (cadr ltemp1))
(setq p2 (cadr ltemp2))
(setq l1 (entget (car ltemp1)))
(setq l2 (entget (car ltemp2)))
(setq p3 (cdr (assoc 10 l1)))
(setq p4 (cdr (assoc 11 l1)))
(setq p5 (cdr (assoc 10 l2)))
(setq p6 (cdr (assoc 11 l2)))
(setq p7 (inters p3 p4 p5 p6 nil))
(command "break" (cdr (assoc -1 l1)) p7 "@")
(command "break" (cdr (assoc -1 l2)) p7 "@")
(setq del (ssget "c" p7 p7))
(setq l1 (ssname (ssget p1) 0))
(setq l2 (ssname (ssget p2) 0))
(ssdel 11 del)
(ssdel 12 del)
(setq temp (getvar "filletrad"))
(progn (princ "\n 输入倒圆角的半径
(princ temp)
(princ ">:")
)
(initget 4)
(setq temp1 (getreal))
(if (= temp1 nil)
(setq rad temp)
(progn (setq rad temp1)
(setvar "filletrad" temp1)
)
)
(command "fillet" "r" rad)
(command "fillet" l1 l2)
(initget 1 "y n")
(setq x (getkword "\n 要擦除另一条线吗Y/N?"))
(if (= x "y")
(command "erase" del "")
)
(setvar "cmdecho" echo)
(setq *error* saveerr)
(princ)
)