home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dicogo.zip / CMDMAK.LSP next >
Lisp/Scheme  |  1991-09-30  |  1KB  |  43 lines

  1. ;  CMDMAK.LSP
  2. ;  This function will create a DICOGO command file, prompting
  3. ;  for the necessary data.
  4. ;
  5. ;
  6. ;   Copyright (c) 1991, D I Management Corporation
  7. ;
  8. ;
  9. ;
  10. ;
  11. ;
  12. (prompt "\nLoading . . . .\n")
  13. (defun c:cmdmak (/ tset fil cfil cmd arg)
  14.     (setq pfx (getvar "dwgprefix"))
  15.     (prompt "\nEnter command file name -- no extension.")
  16.     (setq fil (getstring "\n(Data will be appended to exist. file:) "))
  17.     (setq cfl (strcat pfx fil ".cmd"))
  18.     (setq datafile (open cfl "a"))
  19.     (setq tset nil)
  20.     (setq cmd (getstring T "\nEnter a command: "))
  21.     (while (/= 0 (strlen cmd))
  22.         (prompt "\nEnter parameters: ")
  23.         (setq tset (ssget))
  24.         (if (/= tset nil)
  25.             (progn
  26.             (setq len (sslength tset))
  27.             (setq c 0)
  28.             (while (< c len)
  29.                 (progn
  30.                     (setq arg (cdr (assoc 1 (setq e (entget (ssname tset c))))))
  31.                     (setq cmd (strcat cmd " " arg))
  32.                     (setq c (+ 1 c))
  33.                 )
  34.             )
  35.             (setq tset nil)
  36.             )
  37.         )
  38.         (write-line cmd datafile)
  39.         (setq cmd (getstring T "\Enter a command: "))
  40.     )
  41.     (close datafile)
  42. (princ))
  43.