Code Red > AutoLISP (Vanilla / Visual)

Using a text format to run autolisp routines over multiple drawings

(1/6) > >>

lispman21:
I am trying to figure out how to take over 2,000 dxf's and run the same lisp routines on all of these dxf's.  I want to  be able to identify the directory these dxf's are in open each one run the lisp routines save routines as dxf's in the same directory they were opened from, and close. Then repeat automatically for every dxf in the directory.  I will let you know i only have little knowledge in Autolisp and no knowledge in VBA.  So i am going to need some guidance.


Also I think doing this kind of batch run will save me weeks worth of work and that is my basis for looking into doing this.

T.Willey:
You may want to look at running a script over all the files which will call a lisp.  If you know what you want to do, and can do it with only calling ActiveX type codes, then you can look into ObjectDBX, which is faster than a script, because it doesn't have to open all the drawings in the editor.

Do you have the lisp file already coded?  How much help are you looking for?

MP:
Indeed! And in my experience dbxin/out via ODBX really rips. Sorry, I wish could contribute to this thread but alas, no time! Perhaps tonight as my wife is working a late shift.

MP:

--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---I am trying to figure out how to take over 2,000 dxf's and run the same lisp routines on all of these dxf's.  I want to  be able to identify the directory these dxf's are in open each one run the lisp routines save routines as dxf's in the same directory they were opened from, and close. Then repeat automatically for every dxf in the directory.  I will let you know i only have little knowledge in Autolisp and no knowledge in VBA.  So i am going to need some guidance.

Also I think doing this kind of batch run will save me weeks worth of work and that is my basis for looking into doing this.
--- End quote ---

Ok. IMO the first thing we need to do before we run off and start pounding code is identify exactly what we want to do -- what's the recipe so to speak. So let's clarify what you've provided so far (words in braces { word } are mine) --


--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---1. I am trying to figure out how to take over {iterate} 2,000 dxf's and run the same lisp routines on all of these dxf's ...
--- End quote ---

I'm not sure what you mean by "take over" so I have to make an assumptive reach: You have a directory tree that hosts approximately 2000 dxf files. You want to recursively scan said directory tree and locate all dxf files, possibly using wildcarding to limit what the search discovers.

Sounds like you could use DOLIB (dos_find) to fullfill the initial scan (I'll detail it later, let's keep the recipe lite for the moment).

Please identify anything that is missing or in err.


--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---2) I want to be able to identify the directory these dxf's are in ...
--- End quote ---

For each dxf file you need to be able to identify the full path to the dxf file. If we go the DOSLIB route it will be a no brain-er.

Please identify anything that is missing or in err.


--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---3) ... open each one {dxf file} run the lisp routines ...
--- End quote ---

Seems straightforward but several avenues can be persued here. Do you want to open / import the dxf file in the AutoCAD editor, open the dxf file directly via ObjectDBX (a good bet, execution wise, speed), or open the dxf as a sequential file, operating directly upon it?

Please identify anything that is missing or in err.


--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---4) ... save routines as dxf's in the same directory they were opened from ...
--- End quote ---

Depending on what transpires in item 3, save the modified dxf file over top of itself. At this point I'd suggest that if that is the case you ensure a backup of all these files is made prior to this exercise, or that a backup mechanism be part of the "program" (I'd recommend the former, at least intially).

Hmmm, nother question -- do mean save dxf files to dxf files, or dxf files to dwg files?

Please identify anything that is missing or in err.


--- Quote from: lispman21 on July 25, 2006, 03:41:55 PM ---5) ... repeat automatically for every dxf in the directory.
--- End quote ---

Gotcha.

Dang, the sleeping pill is kicking (and Im nodding), and I must decline to work on this any more tonight (as if you couldn't tell). You wouldn't imagine how hard I gotta stare at the screen to see it in one place and legibly; woo. Forgive me, I should have just tossed it in the bin.

Anyway, I hope my swamp friends pick this up torrow where I've left and pass the battan back an forth 'til a proper solution design emerges, though the O/P has a few things to clarify before coding thing happens. Night all.

MP.

lispman21:
Ok, starting with question 1 and going in order.


1.  As what i meant about "take over" this probably should have read like "I am trying to run a couple lisp routines on dxf's that are located in their own directory."  So you assumed correctly to wha twas meant here.

2.  Again these statements are correct and i will have to check the hyperlinks you gave for background info on DOSLIB.

3.  I am going to want to open these dxf's via ObjectDBX, just because of the execution speed and it doesn't have to open the drawing editor.

4.  Backups of these file are placed in two different locations and yes I am wanting to save the dxf file back into the directory as a dxf file.  Which means the converted file will overwrite the existing file.

5.  And as in question 5 it is pretty straight forward.  Repeat on all dxf files.

Thanks for your detailed look at my question.  Hopefully my answers will give you more insight to waht i am trying to achieve.

Navigation

[0] Message Index

[#] Next page

Go to full version