Lee Mac Posted January 20, 2010 Posted January 20, 2010 Is the procedure the same for all 50 drawings? If so, look at the program I linked you to: http://www.cadtutor.net/forum/showpo...7&postcount=23 Just enter the script operations at the prompt, using *file* where the drawing filename should be. The program will create a script that can be run to operate on all the drawings in the selected directory (and sub-directories). Lee Quote
ChrisCMU Posted January 20, 2010 Author Posted January 20, 2010 I don't know all the functions of your program, but would I have to enter a file name each time? I certainly don't want to do that (it would be faster to simply run a lisp/script manually in each drawing). In the batch file I simply start with a listing of all the scripts in a folder (generate using "dir/b > list.txt"). Then I fill down with the paths. This only takes about 5 minutes to generate the batch. If using your program takes more time I don't think it's a viable alternative. I really don't know because I don't know what all the program is doing. Quote
Lee Mac Posted January 20, 2010 Posted January 20, 2010 I don't know all the functions of your program, but would I have to enter a file name each time? I certainly don't want to do that (it would be faster to simply run a lisp/script manually in each drawing). In the batch file I simply start with a listing of all the scripts in a folder (generate using "dir/b > list.txt"). Then I fill down with the paths. This only takes about 5 minutes to generate the batch. If using your program takes more time I don't think it's a viable alternative. I really don't know because I don't know what all the program is doing. No. In my program you only enter the one line of operations and use *file* where the drawing filename should be. You then select a directory of drawings to process, and my program creates a script to process those drawings which you can then run. Try it, and you'll see. Quote
ChrisCMU Posted January 20, 2010 Author Posted January 20, 2010 I just tested it. Again, it does the same processes on all drawings. That doesn't help me when every single drawing has a unique script to run. It would have to replace *script* with the name of the script (just like it does with the file name). I suppose I could do some text editing and paste in the name of the individual scripts after your main script is created. I'll test this some more, it may work yet. Quote
Lee Mac Posted January 20, 2010 Posted January 20, 2010 In that case, I would load a LISP in the script: (load "mylisp.lsp") Quote
ChrisCMU Posted January 20, 2010 Author Posted January 20, 2010 How would I load the lisp though? there is no appload that avoids the GUI. I'd need to something like this in your program: open drawing1.dwg X Y qsave close X would be replaced with the loading function and Y replaced with the lisp name. The latter is the easy part (I can copy and paste the drawing name since they match). I don't know how to load the individual lisp though (in this case drawing1, drawing2, etc). Do you know how to do that? Can I just use load, like I would in startup? EDIT - I think that will work: open drawing1.dwg (load "LispName") (LispName) qsave close Quote
Lee Mac Posted January 20, 2010 Posted January 20, 2010 EDIT - I think that will work:open drawing1.dwg (load "LispName") (LispName) qsave close (LispName) if it is a sub-function, (c:LispName) if it is command-invoked. Quote
ChrisCMU Posted January 20, 2010 Author Posted January 20, 2010 Thanks. This does run way faster without opening and closing CAD. Quote
Lee Mac Posted January 20, 2010 Posted January 20, 2010 Thanks. This does run way faster without opening and closing CAD. Happy to help mate, glad we finally got there Quote
ChrisCMU Posted January 26, 2010 Author Posted January 26, 2010 One last thing... I'm having trouble getting the script to open another script. To run the lisp you just put it in brackets. How do I get the script to run? This is what I tried (there are no returns, just a space between arguments): open "S:\Departments\GIS_Production\Projects\5357_MT_MTP_ARRA\Working\Montana\ARRA7\mt200130n0500e0\mt200130n0500e0.dwg" _script "S:\Departments\GIS_Production\Projects\5357_MT_MTP_ARRA\images\ARRA7\scripts\mt200130n0500e0.scr" This is what I get in the command line: Command: _scriptEnter script file name t200130n0500e0\mt200130n0500e0.scr>: "S:\Departments\GIS_Production\Projects\5357_MT_MTP_ARRA\images\ARRA7\scripts\mt 200130n0500e0.scr" Quote
ChrisCMU Posted January 26, 2010 Author Posted January 26, 2010 It seems like reading other threads that the first script will never resume. I'll have to get my programmer to generate the files into Lisps instead of the scripts...I just hoped there was a way to run the scripts until that happens. Quote
Lee Mac Posted January 26, 2010 Posted January 26, 2010 I don't think you can nest scripts - the new one takes over. Quote
ChrisCMU Posted January 26, 2010 Author Posted January 26, 2010 Yeah, I think what we'll end up doing is combining all the scripts into one giant one that will run inside CAD. Hopefully down the road he can simply change them to lisps. Quote
dbroada Posted January 26, 2010 Posted January 26, 2010 I don't think you can nest scripts - the new one takes over. that is correct. You can make them serial to call the next script but you can't nest them. 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.