- (defun c:CF (/ e1 e2 lst lst2 ss)
- (setvar 'filletrad
- (cond ((getdist (strcat "\nSpecify fillet radius <" (rtos (getvar 'filletrad)) ">: ")))
- ((getvar 'filletrad))
- ) ;_ cond
- ) ;_ setvar
- (while
- (and (or lst
- (and (setq e1 (entsel "\nSelect curve: "))
- (or (vl-position (cdr (assoc 0 (entget (car e1)))) '("ARC" "LINE" "LWPOLYLINE"))
- (alert "Invalid object!")
- ) ;_ or
- (setq lst (cons e1 lst))
- ) ;_ and
- ) ;_ or
- (setq e2 (entsel "\nSelect next curve: "))
- (or (vl-position (cdr (assoc 0 (entget (car e2)))) '("ARC" "LINE" "LWPOLYLINE"))
- (alert "Invalid object!")
- ) ;_ or
- (setq lst (cons e2 lst))
- (vl-cmdf "_.fillet" (cadr lst) (car lst))
- (or (zerop (getvar 'filletrad)) (setq lst2 (cons (list (entlast)) lst2)))
- ) ;_ and
- ) ;_ while
- (initget 0 "Yes No")
- (and (eq "Yes" (getkword "\nConvert to LWPolyline? [Yes/No] <No>: "))
- (setq ss (ssadd))
- (foreach x (append lst lst2) (setq ss (ssadd (car x) ss)))
- (if (zerop (getvar 'peditaccept))
- (vl-cmdf "_.pedit" "_m" ss "" "_y" "_j" "" "")
- (vl-cmdf "_.pedit" "_m" ss "" "_j" "" "")
- ) ;_ if
- ) ;_ and
- (princ)
- ) ;_ defun
|