Cat Posted October 20, 2010 Posted October 20, 2010 Hi Guys, Does anyone have anything in their bag of tricks that I can use to tag a group of drawings and execute a script on them without adding the files to a Project. I'm working with a "special" group of drawings that give Autocad dysentery and just trying to add the files into a Project is like pulling chicken's teeth. Quote
Lee Mac Posted October 20, 2010 Posted October 20, 2010 Perhaps search the forum for my 'Script Writer' program - or use ScriptPro Quote
alanjt Posted October 20, 2010 Posted October 20, 2010 Don't forget AutoScript for the 64 bit users. Quote
Cat Posted October 20, 2010 Author Posted October 20, 2010 (edited) Perhaps search the forum for my 'Script Writer' program - or use ScriptPro I found your program Lee Mac. I had searched, just didn't use the right wording. I'm not sure how to translate my script into the format in your script line. I'm one of those people that enter commands line by line, so if I can get an example of translating a script into a single line I would very much appreciate it. Unfortunately, I'm Lisp illiterate. Edited October 20, 2010 by Cat Quote
Lee Mac Posted October 20, 2010 Posted October 20, 2010 Replace the filename for *file* in the Script line, and keep everything else as is, some people write scripts with each operation on a new line - if this is the case, just remember that each new line equals a space. Quote
Cat Posted October 20, 2010 Author Posted October 20, 2010 Replace the filename for *file* in the Script line, and keep everything else as is, some people write scripts with each operation on a new line - if this is the case, just remember that each new line equals a space. The filename of the script? Quote
Lee Mac Posted October 20, 2010 Posted October 20, 2010 The place in the script that the Drawing filename would usually be found. Hence _.open C:\\MyDrawing.dwg _.line 0,0,0 3,4,5 etc etc Becomes: _.open *file* _.line 0,0,0 3,4,5 etc etc Quote
Cat Posted October 20, 2010 Author Posted October 20, 2010 The place in the script that the Drawing filename would usually be found. Hence _.open C:\\MyDrawing.dwg _.line 0,0,0 3,4,5 etc etc Becomes: _.open *file* _.line 0,0,0 3,4,5 etc etc I'm in bigger trouble than I thought .......my scripts don't contain dwg file names.....just autocad commands. I would normally execute a "Project Wide Utility" across the Project which can run a script, but all I have to do is browse for the script to use and the select the drawings to run it on and.......BOOM....I'm off to the races. Quote
alanjt Posted October 20, 2010 Posted October 20, 2010 I'm in bigger trouble than I thought .......my scripts don't contain dwg file names.....just autocad commands. I would normally execute a "Project Wide Utility" across the Project which can run a script, but all I have to do is browse for the script to use and the select the drawings to run it on and.......BOOM....I'm off to the races. ScriptPro or AutoScript Quote
Cat Posted October 20, 2010 Author Posted October 20, 2010 Not a big deal guys. A long time ago (aka....dos days) I used a program called X-Tree Gold which was really more of a file management program, but you could also create bats to execute scripts on the tagged drawing files. Just wanted to see if anyone had anything comparable. Quote
David Bethel Posted October 20, 2010 Posted October 20, 2010 I still use XTree ( and ZTree ) McNeels DoSLIB has a good many file functions that make creating scripts and bat files a bit easier via autolisp. I use it a lot to create post script files of multiple .ps file into a single .ps that runs in distiller. It has all kinds of uses. -David A sample that makes a purge script on all files with "ht" prefix: ;;;R12 PURGE (defun c:sc-pur (/ files wf) (setq files (dos_dir (strcat "/acad/ht*.dwg"))) (setq files (acad_strlsort files)) (setq wf (open "sc-pur.scr" "w")) (foreach f files (princ (strcat "\n" f)) (write-line "_.ZOOM" wf) (write-line "_E" wf) (write-line "_.Open" wf) (write-line "_Yes" wf) (write-line (strcat (substr f 1 (- (strlen f) 4))) wf) (write-line "(setvar \"CMDECHO\" 1)" wf) (write-line "(command \"_.PURGE\")" wf) (write-line "(command \"_All\")" wf) (write-line "(while (> (getvar \"CMDACTIVE\") 0) (command \"_Y\"))" wf) (write-line "_.QSAVE" wf)) (close wf) (command "_.SCRIPT" "sc-pur")) Quote
Cat Posted October 20, 2010 Author Posted October 20, 2010 Hi David, I think maybe I used it back when it was a X-twig. Quote
BIGAL Posted October 21, 2010 Posted October 21, 2010 You can get to directories via the "Run" command and do stuff like dir *.dwg >mytxtfile /b then open mytxtfile in notepad etc to make into a script use search replace. Quote
Cat Posted October 21, 2010 Author Posted October 21, 2010 Thanks BigAl, I'm going to take a look at Scriptpro this morning, assuming the "secure" server will allow me to install it. If not, I guess I'll just do it the old fashioned way, it's time consuming and monotonous as hell, but it works. 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.