- (defun C:sxs (/ SS ENT LST)
- (if (setq SS (entsel "\n点取对象:"))
- (progn
- (setq ENT (entget (car SS)))
- (if (assoc 62 ENT)
- (setq LST (list (assoc 62 ENT)))
- (setq LST (list (cons 62 256)))
- )
- (setq LST (cons (assoc 8 ENT) LST)
- LST (cons (assoc 0 ENT) LST)
- )
- (setq SS (ssget LST))
- ) ;选择全部ssget "x" LST
- )
- (setq alts (getvar "LTSCALE")
- pt (getpoint "\n请指定一个点: ")
- )
- (while (= (car (setq gr (grread nil 5 0))) 5)
- (redraw)
- (grdraw (cadr gr) pt 1 1)
- (setq i -1)
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (if (setq lt (cdr (assoc 6 (entget s1))))
- (progn
- (setq zq (cdr (assoc 40 (tblsearch "ltype" lt))))
- (if (/= zq 0)
- (setq newscale (/ (distance (cadr gr) pt) zq alts 1.))
- (setq newscale 1)
- )
- )
- (progn (setq zq
- (cdr
- (assoc
- 40
- (tblsearch
- "ltype"
- (cdr
- (assoc
- 6
- (tblsearch "layer" (cdr (assoc 8 (entget s1))))
- )
- )
- )
- )
- )
- )
- (if (/= zq 0)
- (setq newscale (/ (distance (cadr gr) pt) zq alts 1.))
- (setq newscale 1)
- )
- )
- )
- (vla-put-LinetypeScale (vlax-ename->vla-object s1) newscale)
- )
- )
- (redraw)
- (princ)
- )
|