- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear forum members,
Having an very simple routine but my system keeps failing to execute it
My issue
I run this script and on the last part of it when it opens an new dwg my system hangs and need to kill process through task manager
Can someone test this routine and let me know what is wrong?
I cant figure this out anymore
This routine simply opens an dwg and closes it.
If this works I will add more into it
Error that I get back on last dwg is NIL
Acad simply hangs
(defun GrabAllFiles (Path FileExt / tempPath FileList revdate dwgname tempsize strrev status_o status_t strtitle)
; [Path] is the path to search it, and all it's sub-directory
; [FileExt] is the extenstion (with the period) of the type of files to look for.
; Example (GrabAllFiles "c:\\" ".dwg")
(setq Path
(if (= (substr Path (strlen Path)) "\\")
Path
(strcat Path "\\")
)
)
(foreach file (vl-directory-files Path)
(setq tempPath (strcat Path file))
(if
(not
(or
(= file ".")
(= file "..")
)
)
(if (vl-file-directory-p tempPath)
(setq FileList (append FileList (GrabAllFiles tempPath FileExt)))
(if (= (strcase FileExt) (strcase (vl-filename-extension tempPath)))
(setq FileList (cons tempPath FileList))
)
)
)
)
FileList
)
(setq a (GrabAllFiles "PATH TO DIR WITH DWG" ".dwg"))
(foreach dwg a
(command "open" dwg)
(command "new" "y")
);end foreach
(setvar "sdi" 0)
(command "new" "y")
The 2 red lines let my system hang for ever
I have about 10 dwg's in the dir that I read out and the routine is doing all of them except the last dwg
Kind Regards
Solved! Go to Solution.