Thanks for all the suggestions, tried most of them with no luck,
However defragmenting my hard drive seemed to be the solution. My drive had
almost 30 GB of available space on a 40 GB hard drive, but somehow my lisp
now works perfectly after the defragmenting.
Just thought you would like to know.
The more I know about computers, the more I find out I don't know about
computers. 🙂
"Mark McDonough" wrote in message
news:4D75C89B5ACB76B3F530E01C1D85DE7C@in.WebX.maYIadrTaRb...
> Have you explicitly saved and closed each file as they're being processed?
> I know that you said you set SDI mode. In a couple of batch-script
routines
> I've written, to convert the routines from R14 to R2000 with MDI, I
> reprogrammed them to open each drawing, do something to tyhe drawing, then
> save and close the file, then move onto the next DWG. Before doing that,
It
> would always crash on about the 16-18th file it opened (out of memory).
>
> Also, consider running an audit on the file near or at the point of
> crashing... maybe the file is corrupted and needs repair.
>
> --
> Mark McDonough
> Sasaki Associates
> http://www.sasaki.com
>
> "Joseph Christou" wrote in message
> news:537455C3CE18D761ACA5116D09C01294@in.WebX.maYIadrTaRb...
> > I have a lisp routine which creates a script file that runs thru an
entire
> > directory of drawing files. For some reason the script continuously
> crashes
> > around the 12th drawing opened. I changed to single drawing mode, so
only
> > one drawing is open at a time, so memory shouldn't be an issue.
> >
> > Can anyone figure out why this script crashes?
> >
> > Thanks for your help.
> >
> > Lisp is below:
> >
> > ;********************** Batch sub-routine
> > ***************************************
> > ; Hardcode the tasks required for each individual drawing.
> > (defun c:do_batch ()
> > (command "model")
> > (command "-layer" "s" "0" "")
> > (command "-xref" "attach"
> "K:\\projects\\101-041\\DWG\\REF\\Wetlands.dwg"
> > "0,0" "1" "" "")
> > (command "xclip" pause)
> > (COMMAND "QSAVE")
> > )
> > ;********************** Main-function
> > *******************************************
> > (defun c:batch (/ dirp lst1 llst1 llp fil1 img img1)
> > (save_vars)
> > (setq plot_ans nil layer_ans nil purge_ans nil )
> >
> > ;*** if multiple drawings open ends program
> > (if (= (vla-get-count (vla-get-documents (vlax-get-acad-object))) 1)
> > (progn
> > (command "sdi" "1")
> > (command "qsave")
> >
> > ;*** getting path
> > (setq dirp (getvar "dwgprefix"))
> >
> > ;*** list all files in folder of certain type
> > (setq lst1 (vl-directory-files dirp "*.dwg"))
> >
> > ;*** defining amount of files in list
> > (setq llst1 (- (length lst1) 1))
> >
> > ;*** setting list value to zero
> > (setq llp 0)
> >
> > ;*** opening script file
> > (setq fil1 (open (strcat dirp "trash.scr") "w"))
> >
> > ;*** Open Dialog box at command line
> > (write-line "filedia" fil1)
> > (write-line "0" fil1)
> >
> > ;*** create loop that will write file
> > (while (<= llp llst1)
> >
> > ;*** gets drawing name
> > (setq img (nth llp lst1))
> >
> > ;*** sets drawing name with path
> > (setq img1 (strcat dirp img))
> >
> > ;*** Write open and filename to script file
> > (write-line "open" fil1)
> > (write-line (strcat "\"" img1 "\"") fil1)
> > ;*** don't modify anything above
> >
> > ;*** Add sub-function here, all hardcoding should be done in
> > sub-function
> > (write-line "do_batch" fil1)
> >
> > ;*** don't modify this
> > (write-line "qsave" fil1)
> > (setq llp (+ llp 1))
> > )
> >
> > ;*** Reverts dialog box to screen, resets SDI=0, saves the file
> > (write-line "filedia" fil1)
> > (write-line "1" fil1)
> > (write-line "sdi" fil1)
> > (write-line "0" fil1)
> > (write-line "qsave" fil1)
> > (close fil1) ;;; close file
> >
> > ;*** automatically runs the script routine
> > (command "script" "trash.scr")
> > ) ; end progn
> > (progn
> > (alert "\nOnly one drawing can be open to run this routine")
> > (alert "\nClose other drawings and re-run program")
> > ) ; end progn
> > ) ; end if
> > (restore_vars)
> > )
> >
> >
>
>