Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello,
i'm tryng to make a lisp that do a command only if the file name start with specified caracter
but i can't find the right way
any suggestion?
here's my 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))
)
)
)
Solved! Go to Solution.