I'm just rushing through here on my way to bed. My first guess is that the file has not been closed from a previous session. Shut down acad and start again. then go to the lisp and make sure the file has been closed.

Registered forum members do not see this ad.
Hi everyone,
I am using ATTEXT to extract attributes into a text file. When I create the file and extract the attributes straight away, it works well. However, I need to erase the contents of the file first. So I am using "w" like this:
(setq y2 (open wpath "w")) ;wpath contains the path of the file
Then, when I tried to extract the attributes again, Autocad (2007 version) gave me an error "Can't open file". I tried to close the file and open it again using append but it still gave me the error. Can anyone help me please?![]()
I'm just rushing through here on my way to bed. My first guess is that the file has not been closed from a previous session. Shut down acad and start again. then go to the lisp and make sure the file has been closed.

Hi,
Finally I managed to solve the problem: my problem was that I was using "read" previously to check whether the file already exists and I wasn't closing the file after the read, only after the write. That's why it couldn't open. Thanks just the same for your help![]()
Bookmarks