马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [FONT=courier new]
- (princ "\n fd=======动态fillet 倒圆角------------lxx.2001.5ok")
- (princ "\n支持line,arc,*polyline,circle--除了*polyline+*polyline ")
- ;;用了grread;*error*
- ;;esc中断处理;undo-mark /back恢复;支持键盘输入
- ;;=============================================================
- (defun c:fd (/ opdmode ep1 ep2 pt1 opt roop cenpt fr gr pt2 n na)
- (princ "\n fd=======动态fillet 倒圆角-----undo/b-------雄啸lxx.2001.5ok")
- (princ "\n支持line,arc,*polyline,circle--除了*polyline+*polyline ")
- (setq opdmode (getvar "pdmode"))
- (command "undo" "m" "cmdecho" "0" "blipmode" "off" "pdmode" "2")
- (while (not(setq ep1 (entsel "\n点取第一条线:"))))
- (while (not(setq ep2 (entsel "\n点取第二条线:"))))
- (setq pt1 (cadr ep2)
- ;pt1 (getpoint "\nfillet 半径第一点:")
- opt pt1
- roop "true"
- fr (getvar "filletrad")
- )
- (princ "\n当前filletrad=")(princ fr)
- (command "point" pt1 "filletrad" "");;; for undo
- (setq cenpt (entlast))
- (princ "\nfillet 半径第二点:")
- (while roop
- (defun *error* (msg)(command "undo" "1" "erase" cenpt "")(princ "\n错误:")(princ msg)(setq *error* nil))
- (setq gr (grread t 7 0))
- (if (/= (car gr) 5)
- (setq roop nil)
- (if (not(equal (cadr gr) opt));;;else
- (progn
- (command "undo" "1")
- (setq pt2 (cadr gr)
- fr (distance pt1 pt2)
- opt pt2)
- (princ "\n当前filletrad=")(princ fr)
- (setvar "filletrad" fr)
- (command "fillet" ep1 ep2 ^c)
- );end progn
- );end if
- );end if
- );end while
- (setq *error* nil)
- (if (= (car gr) 3);;;;;;;左键定filletrad
- (setq pt2 (cadr gr)
- fr (distance pt1 pt2))
- )
- (if (and (= (car gr) 2)
- (and(< 47 (cadr gr))
- (> 58 (cadr gr))
- ) );;;0~9 ascii 码值48~57
- (setq n (chr(cadr gr))
- na (getstring (strcat "\n键盘输入:filletrad=" n))
- fr (atof (strcat n na))
- )
- )
- (princ "\n当前filletrad=")(princ fr)
- (command "undo" "1")
- (setvar "filletrad" fr)
- (command "fillet" ep1 ep2 ^c "erase" cenpt "")
- (setvar "pdmode" opdmode)
- (princ)
- )
- [/FONT]
|