Community
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
"Charles" <
href="mailto:cderrico@hobbsupchurch.com">cderrico@hobbsupchurch.com>
wrote in message
href="news:9C35B144450E71DCF57D6A9242ADD17E@in.WebX.maYIadrTaRb">news:9C35B144450E71DCF57D6A9242A......
O.K.
I am totaly confused!
All I want to do is cycle through all of the dwgs
(over 9000) on a disk check to see if it is read only or not. If it
is not read only open the dwg and purge everything.
I have a text file that contains each dwg name on
a single line.
i.e.
size=2>J:\dwg1.dwg
J:\Sample\EXAMPLE1.dwg
J:\Sample\EXAMPLE2.dwg
J:\Sample\EXAMPLE3.dwg
etc.
First I thought a script and the acad.lsp
file would do the trick
i.e.
open "J:\dwg1.dwg"
open
"J:\Sample\EXAMPLE1.dwg"
open "J:\Sample\EXAMPLE2.dwg"
open
"J:\Sample\EXAMPLE3.dwg"
Acad.lsp
(command "-purge" "all" "" "n")
(command ".qsave")
But the script doesn't check for read only and
every time the script file hits a read only dwg it stops.
Then I thought I would use the acad.lsp
only
(defun isReadOnly (filnam / fil);check for read
only
(if (setq fil (open filnam "a"))
(close
fil)
t
)
)
(setvar "sdi" 1);set to single document
mode
(setq DwgFile (open "H:/1100-Users/CVD/drawing.txt"
"r"))
(while (setq lin (read-line
DwgFile))
(if (= (isReadOnly lin)
t)
(setq lin (read-line
DwgFile)
)
)
(command ".open" lin)
(command
"-purge" "all" "" "n")
(command
"-purge" "all" "" "n")
(command
"-purge" "all" "" "n")
(command
".qsave")
)
(close DwgFile)
)
But the variables keep reseting so it fails at (=
(isReadOnly lin) t).
If someone could please give me some tips I sure
would appreciate it.
Thanks,
Charles