I need to export all layer information on 1,000 drawings to a txt or a excel file. I have been trying to write a lisp and then run script pro on the drawings. Has anyone else done anything like this before? Any help would be awsome.
|
I need to export all layer information on 1,000 drawings to a txt or a excel file. I have been trying to write a lisp and then run script pro on the drawings. Has anyone else done anything like this before? Any help would be awsome.
How do you want to name the text file? Doing it to a text file, or csv file would be easy, then you can import it into excel. What information about the layers are you wanted to get? Do you want to include xref layers?
Toolpac's "Symbol Table Extract" will do exactly what you want.Originally Posted by RSPlunske
http://www.dotsoft.com/toolpac.htm
Consider the time it may take you to write such a routine, and the purchase will most likely prove to be a cost saver.
R.K. McSwain | CAD Panacea |
Hi
Have a look at the offerings found in the following threads...
Open Dwg, Export layers to Excel
Printout of Layers
Export Layers To xls or txt file
+
A forum search should turn up a lot more useful information on this subject.
Have a good one, Mike
Not sure how anything here solves the problem, unless this page contains something - and right now, it's a dead link.
The last link just points to the second one
The lisp gathered from the first link sort of works, but it leaves all the drawings opened. I sure wouldn't try to process 1000 drawings this way. ObjectDBX would have been much cleaner. Not bad for a freebie though. RSPlunske - you will have to modify the code a little to get it to work on your machine.
Ya'll have a good weekend!
R.K. McSwain | CAD Panacea |
Hi
I suggest you try all that is offered in that thread, you might be pleasantly surprised.Originally Posted by rkmcswain
Here is the new link to the AUGI Exchange ( due to AUGI.com re-design )...
AUGI Exchange ( Note, not very hard to find if you go to the AUGI.com Home Page ).
Does it?Originally Posted by rkmcswain
I believe Glenn's post in that thread says differently.
Have a good one, Mike
Forgive the jumbled code but here is a simple routine for exporting the layers to a csv file.
Peter
(defun C:ExportLayers (/ filLayers lstLayers objItem strCSVFile)
(setq strCSVFile (strcat (getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))
".csv"))
(vlax-for objItem (vla-get-layers
(vla-get-activedocument (vlax-get-acad-object)))
(if (wcmatch (strcase (vla-get-name objItem)) "*")
(setq lstLayers (cons (strcat (vla-get-name objItem) ","
(itoa (vla-get-color objItem)) ","
(vla-get-linetype objItem)
)
lstLayers))))
(if lstLayers
(progn
(setq filLayers (open strCSVFile "w"))
(write-line "layer,color,linetype" filLayers)
(foreach strLayer (acad_strlsort lstLayers)
(write-line strLayer filLayers)
)
(close filLayers)
)
)
(command "delay" 4000)
(startapp
"C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE"
strCSVFile
) ; (command "notepad" (findfile strCSVFile))
)
I really hate the fact that the augi forums still haven't been able to fix the fomatting problem with the code option after several YEARS of complaints. No matter what I do the code always get scrambled by the code option, or in this case I removed the code brackets and the indenting is gone. Hey forums team, can you please fix this issue?
Mike, the original request was for the ability to export layer information from 1000 drawings.Originally Posted by Mike.Perry
- LayerHTM is a excellent tool, but it only operates on a single drawing.
- EX001206 only operates on a single drawing (and only reports thawed layers)
- EX001207 only operates on a single drawing (and only reports frozen/off layers)
- EX001209 only operates on a single drawing
None of these solves the problem without additional work.
Glenn's post points to a routine to export Layer States, not layer properties.Originally Posted by Mike.Perry
I tried to offer the best solution for the given problem., but if people want to waste billable time chasing down links and piecing together chunks of code to end up with something that may or may not work - then I guess that's their (and their employer's) business. Our time tracker doesn't include a job number for such activity.
R.K. McSwain | CAD Panacea |
I didn't realize there was a problem with the CODE tags...Originally Posted by peter
This is a test
Ok, I'm lost. What should I be seeing that is broken? Thanks.Code:(setq *acad-object* (vlax-get-acad-object)) (setq *active-doc* (vlax-get *acad-object* "ActiveDocument")) (setq *layouts* (vlax-get *active-doc* "Layouts")) (setq ps (cdr (assoc 350 (dictsearch (namedobjdict) "ACAD_PLOTSETTINGS")))) (vlax-for each *layouts* (if (eq (vlax-get-property each "ModelType") :vlax-false) (vlax-invoke each "CopyFrom" (vlax-ename->vla-object ps)) ) )
R.K. McSwain | CAD Panacea |
HiOriginally Posted by rkmcswain
From the original post...
But if you want to keep flogging a dead horse be my guest...Originally Posted by RSPlunske
My bad.Originally Posted by rkmcswain
Have a good one, Mike
ps Just out of interest, do you not have anything to say regarding Peter's code in this thread... something like the following perhaps...
ExportLayers only operates on a single drawing (and only reports Layer Name, Color, Linetype)
Peter, please note the above is not a criticism of the code you have kindly supplied to "RSPlunske" ( Sorry, I do not know your real name ). I am only trying to understand and see consistence in what R.K. McSwain has to say regarding the offerings in this thread.
Last edited by Mike.Perry; 2006-01-07 at 08:04 PM. Reason: Correct a bad link.