Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plotting all files in a directory

1 REPLY 1
Reply
Message 1 of 2
Kidd
196 Views, 1 Reply

Plotting all files in a directory

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.
1 REPLY 1
Message 2 of 2
Joris
in reply to: Kidd

Try the program Scripteeze (http://www.xanadu-limited.com/scripteeze.
With this you can select files in a directory and then assign lisps or scripts you want to run on each drawing.
Regards, Joris

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost