Jump to content

Recommended Posts

Posted

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.

Posted

Perhaps search the forum for my 'Script Writer' program - or use ScriptPro :)

Posted (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 by Cat
Posted

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.

Posted
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?

Posted

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

Posted
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 :lol:.......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.

Posted
I'm in bigger trouble than I thought :lol:.......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

Posted

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.

Posted

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"))

Posted

Hi David,

I think maybe I used it back when it was a X-twig. :lol:

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...