Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use the below lisp to saveas and bind dwg in (Document\Bind\) folder.
I need a little help when the lisp trying to saveas dwg replace it if found.
(defun c:Bind (/ Path UserProfile cObj cName) (setq Path (strcat (if (vl-string-search "Settings" (setq UserProfile (getenv "UserProfile"))) (strcat UserProfile "\\My Documents\\Bind") ; Win XP (strcat UserProfile "\\Documents\\Bind") ; > Win 7 ) ) ) (if (not (vl-file-directory-p Path)) (vl-mkdir Path) ) (command "_.saveas" "" (strcat Path "\\" (getvar 'DwgName))) (setq cObj(tblnext "BLOCK" T)) (while cObj (setq cName(cdr(assoc 2 cObj))) (if (and (=(logand(cdr(assoc 70 cObj))32)32) (=(logand(cdr(assoc 70 cObj))4)4) ) (progn (vl-cmdf "bindtype" "1") (vl-cmdf "_.xref" "_unload" cName) (vl-cmdf "_.xref" "_reload" cName) (vl-cmdf "_.xref" "_bind" cName) ) ) (setq cObj(tblnext "BLOCK")) ) (princ) (command "_.qsave") (command "_.close") )
Solved! Go to Solution.