Hi Alls,
To day I just created a program lisp to save as a drawing until 26 time,that drawing (Title-A.dwg) only contain a string,it's "A" letter,then with that program lisp would save as a Title-B.dwg...Title-C.dwg...Title-D.dwg...etc,and that string should change too from "A" to "B"..."C"..."D"..etc,here this code.
This code is work well,the problem is if user load that program only create one dwg,I want 26 dwg (or A to Z.dwg)
; sdaz is stand for Saveas Drawing A to Z
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 24 November 2006
; Program no.: 0471/11/2006
; Edit by :
(defun c:sdaz (/ cnt ed ext_name fol new_file new_name
new_str new_xcnt num_str ss sse ssn str
str_num title xcnt xdwg)
(vl-load-com)
(setq fol "D:/YBI/Drawing/Data Base/Xref/TITLE/")
(setq xdwg (getvar "dwgname"))
(setq cnt 0)
(repeat
26
(setq title (substr xdwg 7 1))
(if
(= title (chr (+ 65 cnt)))
(progn
(setq ext_name (vl-string->list title))
(setq cnt 1)
(setq str_num (vl-string->list "A"))
(setq xcnt (read (strcat "(" (itoa cnt) ")")))
(setq new_xcnt (append str_num xcnt))
(setq new_str (apply '+ new_xcnt))
(setq num_str (chr new_str))
(setq new_name (strcat "Title-" num_str ".dwg"))
(setq new_file (strcat fol new_name))
(setq ss (ssget "x" '((0 . "TEXT"))))
(setq ssn (ssname ss 0))
(setq sse (entget ssn))
(setq str (cdr (assoc 1 sse)))
(if
(= str title)
(progn
(setq ed (subst (cons 1 num_str)(assoc 1 sse) sse))
(entmod ed)
(command "_saveas" "2000" new_file "")
) ; progn
) ; if
(setq cnt (1+ cnt))
) ; progn
) ; if
) ; repeat
(princ)
) ; defun