tukuitk发表于2007-1-6 11:18:00DisplayProperties;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved(vl-load-com); Get Model Space Background Color(defun getMoBgColor() (ole_color [code]
;;; Change all text styles on all objects to specified text style
;;; (ax:ChangeTextStyleName "ISOCPEUR")
(defun ax:ChangeTextStyleName (style / sset ename i)
(vl-load-com)
(setq i 0)
(setq sset (ssget "X" '((-4 . "<OR") (0 . "MTEXT") (0 . "TEXT") (-4 . "OR>"))))
(if sset
(repeat (sslength sset)
(setq ename (ssname sset i))
(setq i (1+ i))
(vla-put-stylename (vlax-ename->vla-object ename) style)
)
)
)
[/code]Zoom extents in all viewports- (defun c:zoome (/ oldcmdecho vplist curcvport nr vpss ms en x)
- (setq oldcmdecho (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq vplist (mapcar 'car (vports)))
- (setq curcvport (getvar "cvport"))
- (if (= (getvar "tilemode") 0)
- (progn
- (if (= (setq ms (getvar "cvport")) 1)
- (command "._mspace")
- )
- (setq vpss (ssget "_x"
- (list '(-4 . "<AND")
- '(0 . "VIEWPORT")
- (cons 410 (getvar "ctab"))
- '(-4 . "<NOT")
- '(69 . 1)
- '(-4 . "NOT>")
- '(-4 . "AND>")
- )
- )
- )
- (setq nr 0)
- (if vpss ; in case there are no viewports
- (repeat (sslength vpss)
- (setq en (entget (ssname vpss nr)))
- (if (and (= 0 (logand 1 (cdr (assoc 90 en))))
- ; not perspective
- (< 0 (cdr (assoc 68 en))) ; on and active
- (/= 16384 (logand 16384 (cdr (assoc 90 en))))
- ; not locked
- )
- (progn
- (setvar "cvport" (cdr (assoc 69 en)))
- (command "._zoom" "_e")
- )
- )
- (setq nr (+ 1 nr))
- )
- )
- (if (= ms 1) (command "._pspace"))
- )
- (foreach x vplist
- (setvar "cvport" x)
- (command "._zoom" "_e")
- )
- )
- (setvar "cvport" curcvport)
- (setvar "cmdecho" oldcmdecho)
- (princ)
- )
楼主,您好!可否注明一下每个程序的功能。谢谢啦!
|