TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cadplayer 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
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)"
(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!
-
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.
"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"
-
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 (http://www.cadtutor.net/forum/showthread.php?76974-Up-and-Running-with-the-2013-Core-Console&highlight=core+console)
~Greg