Need a book? Engineering books recommendations...

Return to index: [Subject] [Thread] [Date] [Author]

RE: CAD - Organizing detail libraries?

[Subject Prev][Subject Next][Thread Prev][Thread Next]
John Cannon Jones wrote:

>> I have never used script files before.  Is there anyway to perform the bat files' do loop in the script instead?  That way you would only have to open acad once. <<

AutoCAD scripts can't loop by themselves. There are ways to chain a script together with an AutoLISP (or VB) program, but it's not a trivial undertaking. The batch file + script method is much easier to develop and modify. The load-AutoCAD-once-per-drawing overhead adds some time to the whole process, but on a reasonably fast computer it's not that much (about 10 for R14 seconds on my Pentium Pro 200 MHz).

>> Also, can you code in a wildcard +  a text label when it asks you for a filename.  That way if your file name is S100 you could have the program name it S100_r13.dwg and you wouldn't have to move the files to a new dir. <<

You can do that with AutoLISP. You can either put the entire code in the script file, or have the script file load an LSP file containing the desired functions. Again, unless you're at least somewhat familiar with AutoLISP, it's not a simple "just do this" explanation. The technique involves using the (strcat) function with (getvar "DWGNAME") to concatenate the current drawing name with additional characters. But there are complications involving the various possible formats of the DWGNAME system variable (which possibilities are different in R13 and R14, by the way). It's far easier to do what you suggested: make a copy of all of the drawings in a directory before running any batch process that modifies them.

- Mark Middlebrook