您可以通过使用逗号分隔模式来匹配多个通配符模式,例如:
- (defun jhsetcol1 ( col )
- (if (null col) (setq col 7))
- (command "_.-layer" "_c" col "*inv*,*dim*,*alias*" "")
- (princ)
- )
或者,使用Vanilla AutoLISP而不使用-LAYER命令:
- (defun jhsetcol2 ( col / def dxf enx lay )
- (if (null col) (setq col 7))
- (while (setq lay (tblnext "layer" (null lay)))
- (if (wcmatch (setq lay (cdr (assoc 2 lay))) "*inv*,*dim*,*alias*")
- (progn
- (setq enx (entget (tblobjname "layer" lay))
- dxf (assoc 62 enx)
- )
- (entmod (subst (cons 62 (if (minusp (cdr dxf)) (- col) col)) dxf enx))
- )
- )
- )
- (princ)
- )
或者,使用Visual LISP:
请注意,在上述示例中使用wcmatch区分大小写。 |