本帖最后由 zhynt 于 2011-6-23 02:07 编辑
- (defun c:bbl (/ ss alts pt gr s1 lt newscale)
- (prompt "\n 请选择物体: ")
- (setq ss (ssget)
- 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)
- )
|