hello
i'm tryng to run a command only if the filename start with some specific caracters.
but i can't find the right way
any suggestion?
Code:
(defun c:test1()
(if ((wcmatch (getvar "DWGNAME") "CH*.dwg" "C1*.dwg" "C2*.dwg" "LI*.dwg" "MN*.dwg" "ON*.dwg" "NO*.DWG" "RJ*.dwg" "SH*.dwg" "WT*.dwg" )) ;;if file name start with
;; change blcok A / CW
(command "_-insert" "C:\\dati\\block_update\\blocks\\lin_acquatorre.dwg" "-50,0" "" "" "" "" "" "" "" "" "") ;;insert block
(entdel (entlast))
(if (setq ss (ssget "_X" '((2 . "riduzione")))) ;block to be replaced
(repeat (setq n (sslength ss))
(setq edata (entget (ssname ss (setq n (1- n)))))
(entmod (subst '(2 . "lin_acquatorre") '(2 . "lin_cooling-water") edata))
)
)
)