I am very new to Lisp, but I have managed to create a program that will plot a dwg with all the variables that I specified. I also found a program that opens the next file in a directory. How do I combine these programs so I can print all the files in a directory.
(defun c:pp ()
(command ".-plot" "Yes" "Model" "HP DeskJet 660C" "Letter" "I" "L" "N" "E" "Fit"
"Center" "Y" "monochrome.CTB" "Y" "N" "Y" "" "N" "Y")
(princ)
)
(defun C:NEXT (/ CNT FILELIST NEXTDWG objDWG acadObject)
(vl-load-com)
(setq FILELIST (acad_strlsort (vl-directory-files (getvar "dwgprefix") "*.dwg"))
CNT (length (member (getvar "dwgname") (reverse FILELIST)))
)
(if (< CNT (length FILELIST))
(progn
(setq NEXTDWG (strcat (getvar "dwgprefix") (nth CNT FILELIST)))
(if (IsItOpen NEXTDWG)
(princ)
(command "vbastmt" (strcat "AcadApplication.Documents.Open \"" NEXTDWG "\""))
)
)
(alert "\nError: You are in the last drawing in this directory: ")
)
(prin1)
(if objDwg
(progn
(setq acadObject (vlax-get-acad-object))
(vlax-put-property acadObject 'Activedocument objDWG)
)
)
)
;IsItOpen by Bill Kramer
(defun IsItOpen (DwgName); / DWGS DWG Flag)
(setq DWGS (vlax-get-property (vlax-get-acad-object) "Documents"))
; Modified
(setq objDWG nil)
(vlax-for DWG DWGS
(if (or
(= (strcase (vlax-get-property DWG "Name"))
(strcase DwgName))
(= (strcase (vlax-get-property DWG "FullName"))
(strcase DwgName)))
(progn
; Modified
(setq objDWG DWG)
(setq Flag 'T)
)
)
)
Flag
)
(princ "\nC:NEXT")
(prin1)
Thanks in advanced.