Bill Tillman Posted April 4, 2012 Posted April 4, 2012 I have a a batch of AutoCAD files, about 20 of them which are saved in 2007 format and need to be converted to 2004 format. I thought cool I will just write a small lisp program to handle this. But unfortunately, this does not work, when the close command is executed it closes down everything. (command "OPEN" "C:/APD/f1.dwg") (command "._SAVEAS" "2004" "Y") (command "._CLOSE") (command "OPEN" "C:/APD/f2.dwg") (command "._SAVEAS" "2004" "Y") (command "._CLOSE") (command "OPEN" "C:/APD/f3.dwg") (command "._SAVEAS" "2004" "Y") (command "._CLOSE") (command "OPEN" "C:/APD/f4.dwg") (command "._SAVEAS" "2004" "Y") (command "._CLOSE") (command "OPEN" "C:/APD/f5.dwg") (command "._SAVEAS" "2004" "Y") (command "._CLOSE") I start with a new file that is blank and load and run this from there. The first file in the list get's converted but then the close command shuts down everything, including the new blank file which I started with. I have read many items on this topic and the True View Converter is not an option as I cannot install new software on this computer and waiting on the IT people to get to it will take at least 2 days. Quote
BlackBox Posted April 4, 2012 Posted April 4, 2012 Why not just temporarily set SDI = 1, and remove the CLOSE altogether, instead opening a drawing, doing the SAVEAS, then open the next? Quote
Bill Tillman Posted April 4, 2012 Author Posted April 4, 2012 etransmit looks like a very good option. I will have to test it out soon. I resolved my problem with a script, but I have this question about the syntax. At first I tried this: open c:\my_path\drawing1.dwg saveas 2004 y close . . . I repeated this for every file in the directory, all 178 of them. That did not work and kept getting messed up. It did change the first three files but then would crash on the rest. I checked for typos and since I copied and pasted the lines which did not work from the lines which did work I could not ever find what if anything was wrong. I then gave Lee-Mac's script writer tool a try and it came up with this from the information I entered. _.open "C:\APD\drawing1.dwg" _.saveas 2004 "C:\APD\drawing1.dwg" _Y _.close . . . This did the trick and it only took about 2 minutes for it to iterate through all 178 files. We tested them with an old 2005 machine and the downward conversion was effective. Quote
Lee Mac Posted April 4, 2012 Posted April 4, 2012 Excellent to hear my old Script Writer is still proving useful! One day I'll get around to upgrading that old program... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.