See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Exporting layer info to excel or text file

  1. #1
    Member WileECoyote's Avatar
    Join Date
    2005-12
    Location
    West Bloomfield, MI
    Posts
    31
    Login to Give a bone
    0

    Question Exporting layer info to excel or text file

    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.

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    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?

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    Quote Originally Posted by RSPlunske
    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.
    Toolpac's "Symbol Table Extract" will do exactly what you want.
    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 |

  4. #4
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    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

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    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 |

  6. #6
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    Hi
    Quote Originally Posted by rkmcswain
    Not sure how anything here solves the problem, unless this page contains something - and right now, it's a dead link.
    I suggest you try all that is offered in that thread, you might be pleasantly surprised.

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


    Quote Originally Posted by rkmcswain
    The last link just points to the second one
    Does it?

    I believe Glenn's post in that thread says differently.

    Have a good one, Mike

  7. #7
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    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?

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    Quote Originally Posted by Mike.Perry
    Hi
    I suggest you try all that is offered in that thread, you might be pleasantly surprised.
    Mike, the original request was for the ability to export layer information from 1000 drawings.

    1. LayerHTM is a excellent tool, but it only operates on a single drawing.
    2. EX001206 only operates on a single drawing (and only reports thawed layers)
    3. EX001207 only operates on a single drawing (and only reports frozen/off layers)
    4. EX001209 only operates on a single drawing


    None of these solves the problem without additional work.

    Quote Originally Posted by Mike.Perry
    Does it?

    I believe Glenn's post in that thread says differently.
    Glenn's post points to a routine to export Layer States, not layer properties.

    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 |

  9. #9
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    Quote Originally Posted by peter
    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?[/font]
    I didn't realize there was a problem with the CODE tags...

    This is a test

    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))
       )
     )
    Ok, I'm lost. What should I be seeing that is broken? Thanks.
    R.K. McSwain | CAD Panacea |

  10. #10
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Exporting layer info to excel or text file

    Quote Originally Posted by rkmcswain
    Mike, the original request was for the ability to export layer information from 1000 drawings.





    1. LayerHTM is a excellent tool, but it only operates on a single drawing.
    2. EX001206 only operates on a single drawing (and only reports thawed layers)
    3. EX001207 only operates on a single drawing (and only reports frozen/off layers)
    4. EX001209 only operates on a single drawing
    None of these solves the problem without additional work.
    Hi

    From the original post...

    Quote Originally Posted by RSPlunske
    I have been trying to write a lisp and then run script pro on the drawings.
    But if you want to keep flogging a dead horse be my guest...


    Quote Originally Posted by rkmcswain
    Glenn's post points to a routine to export Layer States, not layer properties.
    My bad.

    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.

Page 1 of 3 123 LastLast

Similar Threads

  1. Retain text parameter info when exporting to CAD?
    By ddufon in forum Revit - Platform
    Replies: 2
    Last Post: 2010-09-10, 09:17 PM
  2. Exporting each layer as a seperate dxf file.
    By tom.scott in forum AutoCAD General
    Replies: 4
    Last Post: 2010-01-24, 10:08 PM
  3. Exporting Info
    By putmank in forum ACA General
    Replies: 3
    Last Post: 2008-01-03, 10:35 PM
  4. Replies: 7
    Last Post: 2007-10-10, 01:59 PM
  5. Exporting Detail Component Layer Definitions to Excel
    By mark.kiker in forum ACA General
    Replies: 5
    Last Post: 2006-03-11, 05:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •