本帖最后由 chlh_jd 于 2011-4-28 19:43 编辑
滚轮信息即时截取要协同VLISP做ACAD屏幕的动态显示,这个确实有点麻烦;
不防先看下这个VLISP- ;;;use Alan method
- ;;;to easy to control add method devided by viewsize .
- (defun c:test (/ en ent str ds pto pt)
- (if (and (setq en (car (entsel "Select Integer Number Text :")))
- (setq ent (entget en))
- (setq str (cdr (assoc 1 ent)))
- (numberp (eval (read str)))
- (equal (atoi str) (atof str))
- (setq ds (/ (getvar "viewsize") 100.));_here can be changed cond to your need
- (setq pto (grread t 15 0))
- )
- (while (and (setq pt (grread pto))
- (not (and (= 2 (car pt))
- (or (= 13 (cadr pt)) (= 32 (cadr pt)))
- )
- ) ;_Enter Space
- (not (or (= (car pt) 11) (= (car pt) 25))) ;_Right button
- )
- (if (and (= (car pt) 5)
- (> (abs (- (cadadr pt) (cadadr pto))) ds)
- )
- (cond
- ((> (- (cadadr pt) (cadadr pto)) 0);_Y+ move
- (setq str (rtos (1+ (atoi str)) 2 0))
- (entmod (list (cons 1 str) (cons -1 en)))
- (setq pto pt)
- )
- ((< (- (cadadr pt) (cadadr pto)) 0);_Y- move
- (setq str (rtos (1- (atoi str)) 2 0))
- (entmod (list (cons 1 str) (cons -1 en)))
- (setq pto pt)
- )
- )
- (princ)
- )
- )
- (princ)
- )
- (princ)
- )
|