Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Posts: 5
Registered: ‎11-06-2002
Message 1 of 2 (40 Views)

Plotting all files in a directory

40 Views, 1 Replies
11-01-2002 09:49 AM
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:smileytongue:p ()
(command ".-plot" "Yes" "Model" "HP DeskJet 660C" "Letter" "I" "L" "N" "E" "Fit"
"Center" "Y" "monochrome.CTB" "Y" "N" "Y" "" "N" "Y")

(defun C:NEXT (/ CNT FILELIST NEXTDWG objDWG acadObject)
(setq FILELIST (acad_strlsort (vl-directory-files (getvar "dwgprefix") "*.dwg"))
CNT (length (member (getvar "dwgname") (reverse FILELIST)))
(if (< CNT (length FILELIST))
(setq NEXTDWG (strcat (getvar "dwgprefix") (nth CNT FILELIST)))
(if (IsItOpen NEXTDWG)
(command "vbastmt" (strcat "AcadApplication.Documents.Open \"" NEXTDWG "\""))
(alert "\nError: You are in the last drawing in this directory: ")
(if objDwg
(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)))
; Modified
(setq objDWG DWG)
(setq Flag 'T)
(princ "\nC:NEXT")

Thanks in advanced.
Active Contributor
Posts: 39
Registered: ‎09-15-2003
Message 2 of 2 (40 Views)

Re: Plotting all files in a directory

11-03-2002 06:43 PM in reply to: Kidd
Try the program 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.