Author Topic: BATCHstart LISP or SCRIPT?  (Read 2323 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
BATCHstart LISP or SCRIPT?
« on: February 21, 2014, 08:20:05 AM »
Is there a way to can start a lisp or script from Windows-command-console?
I have found this batchCode which start my Acad but not start the scribt I gaw

Code: [Select]
FOR %%G in (*.DWG) DO start /wait "C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\acad.exe" "%%G" /b
 "(load H:\\2013\\LISP\\04_system\\PDFv2.lsp) (c:PDF)"

Code: [Select]
(defun c:PDF ( / )
 
  ;; Print layouts as pdf-file
  ;; you have to have searchpath c:\pdfplot there pdf-files be saved
  (setq i nil)
  (while
    (= i nil)
    (foreach layoutname (layoutlist)
      (command "._layout" "set" layoutname)
      (command "_plot" "_y" layoutname "PDFcreator.pc3" "A1" "Millimeters" "Landscape" "No"
       "_e" "1000=1" "_c" "_y" "A1.ctb" "_y" "_n" "_n" "_n" "_n" "_n" "_y" )
      )
    (setq i 1)
    )
  )
(defun c:PDFr ()
  ;; Rename pdf-files by layoutnames which is in folder c:\pdfplot
  (foreach x (vl-directory-files "c:/pdfplot" "*.pdf")
    (foreach y (layoutlist)
(vl-file-rename (strcat "c:/pdfplot/" x) (strcat "c:/pdfplot/" y ".pdf"))
)
      )
  (alert (strcat "\n" (itoa (length (vl-directory-files "c:/pdfplot" "*.pdf"))) "\nFiles renamed "))
  (princ)
  )

thanks for helping!

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: BATCHstart LISP or SCRIPT?
« Reply #1 on: February 21, 2014, 08:56:52 AM »
Here is a line I use in a batch file to start acad and run a script "AC-MA"

You will need to adjust to your application.

Code: [Select]

"C:\Program Files (x86)\Autodesk Architectural Desktop 2004\acad.exe" /t "c:\program files\septic assistant\septic assistantac.dwg" /b "c:\program files\septic assistant program\batch files\AC-MA"


trogg

  • Bull Frog
  • Posts: 255
Re: BATCHstart LISP or SCRIPT?
« Reply #2 on: February 21, 2014, 04:06:28 PM »
Here's a link that shows how to also utilize the AutoCAD Core Console. Even though it looks like Autodesk has scrapped ScriptPro I did show in the post how to use a .bat file to launch the core console as well and then process the drawings.
http://www.cadtutor.net/forum/showthread.php?76974-Up-and-Running-with-the-2013-Core-Console&highlight=core+console
~Greg