本帖最后由 004 于 2014-5-11 19:54 编辑
- ;;跟随鼠标旋转
- ;;wkq004 20140331
- (defun c:xx ()
- ;;临时取消捕捉
- ;;;(defun ybl-osmode (/ os)
- ;;; (if (>= (setq os (getvar "osmode")) 16384)
- ;;; (setvar "osmode" (- os 16384))
- ;;; (setvar "osmode" (+ os 16384))
- ;;; )
- ;;; (princ)
- ;;;)
- (setq os (getvar "osmode"))
- (setvar "osmode" 0)
- (princ "\n选择要旋转的对象:")
- (setq ss (ssget))
- (repeat (setq i (sslength ss))
- (redraw (ssname ss (1- i)) 3)
- )
- (setq pt (getpoint "\n指定基点:"))
- ;;; (ybl-osmode)
- ;;; (command "_.delay" 100)
- (entmake (list '(0 . "LINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbLine")
- (cons 10 pt)
- (cons 11 (polar pt 0 0.001))
- '(62 . 7)
- '(210 0. 0. 1.)
- )
- )
- (setq e (entlast)
- )
- (setq el (entget e))
- (setq cs 40)
- (while (> cs 0)
- (if (and (setq TMP (grread t 7 1)) (= (car TMP) 5))
- (progn
- (setq cs (1- cs))
- (setq el (subst (cons 11 (cadr tmp)) (assoc 11 el) el))
- (entmod el)
- )
- )
- )
- (entdel e)
- ;;; (grread t 7 1)
- (command ".rotate"
- ss
- ""
- pt
- "r"
- pt
- (cond ((and (setq TMP (grread t 7 1)) (= (car TMP) 5)) ;_移动
- (setq PT2 (cadr TMP))
- )
- )
- pause
- )
- (setvar "osmode" os)
- ;;; (ybl-osmode)
- )
|