I have a script file that is opening a long list of drawings and performing a couple of lisp routines on them. The problem I am having is that some of the files have spaces in the filename which causes the script to hang (e.g. "open c:\mydocuments\my file name.dwg"). How can I solve this? Thanks
The 'filename' to open (or save for that matter), has to have double-quotes around the path/filename. e.g. script: OPEN "C:\\mydocuments\\my file name" ....... note the \\ (or can be just) / also, ditch the .dwg Bob
Thanks Bob but it still hangs. It is having problems with the space between "my" and "file". So it returns "C:\\mydocuments\\my" is not found.
If you're building your script via a LISP routine, then use something similar to the following for generating your file: (setq FNAME (strcat (chr 34) dwg (chr 34))) Otherwise, what Bob said is correct, you need to open the script file and make sure there are " " marks around the file path entirely. I had the same problem you had, I generate my SCR file with a LISP routine and the above method solved the issue for me. HTH Jason performing a couple of lisp routines on them. The problem I am having is that some of the files have spaces in the filename which causes the script to hang (e.g. "open c:\mydocuments\my file name.dwg").
If you are creating the script, do: (command "_open" "C:\\mydocuments\\my file name") You cannot do: "open c:\mydocuments\my file name.dwg" without the (command............). Bob
Bobs suggestion is correct. You might also be able to go to tools>options>files tab and set the directory for the drawings in the search path then just use quotes around the "filename" in the script. You wouldn't have to worry about "c:\mydocuments\my file". I have a specific folder that I use just for running scripts. I place the script file, any related lisp routines and the drawings into that folder which is set in the ACAD search path. That way I only have one folder to look for when things don't go right. On a secondary note, if you're creating this script files manually. Meaning your typing and copy pasting a whole bunch of drawing names,quotations, commands and user input for a whole bunch of drawings. You may want to think about getting a script generator (if you don't have one already). I've used script pro and Hurricane both of which fit the bill nicely. J. Logan performing a couple of lisp routines on them. The problem I am having is that some of the files have spaces in the filename which causes the script to hang (e.g. "open c:\mydocuments\my file name.dwg").
Thanks Bob and Jason, it now works. What is strange, is that I manually put the quotes in my script to test it and it still would not work. I then used (chr 34) and recreated the script from lisp and then it did work. The files looked identical so I have no idea why one worked and the other did not. Again, thanks for the help!
Pretty curious. all (chr 34) is doing is placing a " in the text..same as " on the keyboard. Hmm. Bob
good point, forget about paths and use the CADFX batch scripter or any scripter that does not shut down acad between files like Script Pro does. Should be named Script Slow because it wastes so much time! "J. Logan" <> |>Bobs suggestion is correct. |> |>You might also be able to go to tools>options>files tab and set the |>directory for the drawings in the search path then just use quotes around |>the "filename" in the script. You wouldn't have to worry about |>"c:\mydocuments\my file". I have a specific folder that I use just for |>running scripts. I place the script file, any related lisp routines and the |>drawings into that folder which is set in the ACAD search path. That way I |>only have one folder to look for when things don't go right. |> |>On a secondary note, if you're creating this script files manually. Meaning |>your typing and copy pasting a whole bunch of drawing names,quotations, |>commands and user input for a whole bunch of drawings. You may want to think |>about getting a script generator (if you don't have one already). I've used |>script pro and Hurricane both of which fit the bill nicely. |> |>J. Logan |> |>|>> I have a script file that is opening a long list of drawings and |>performing a couple of lisp routines on them. The problem I am having is |>that some of the files have spaces in the filename which causes the script |>to hang (e.g. "open c:\mydocuments\my file name.dwg"). |>> How can I solve this? |>> Thanks |> James Maeding Civil Engineer/Programmer