Export my layers as a list to excel or word etc.

Export my layers as a list to excel or word etc.

UNKNOWN.DESIGN.LAB
Advocate Advocate
6,403 Views
9 Replies
Message 1 of 10

Export my layers as a list to excel or word etc.

UNKNOWN.DESIGN.LAB
Advocate
Advocate

Hello forum, I am posting to see if there is a way to export my layers list to microsoft word or excel etc. Namely export my layers as a list to be able to create a layer table chart with distributions and share with other collaborators on the team

 

Does anyone have a method of doing this ? A suggestion to select all layers in AC and then press CMD+C to copy to my imac's clipboard and after CMD+V to paste then sounded excellent but unfortunately did not work. 

0 Likes
Accepted solutions (1)
6,404 Views
9 Replies
Replies (9)
Message 2 of 10

maxim_k
Consultant
Consultant

Hi,

As one of the ways you can try attached AutoLISP file which temporary opens drawing LOG file, writes information about layers in the current drawing to it, then closes LOG file.

APPLOAD attached LSP file and use LAY_LST command. You can find LOG file in the folder specified in AutoCAD preferences window (Application tab -> Log File Location):2019-04-10_19-19-14.png

It will have the name go the drawing from which you executed LISP command with .log extension, you can open it with plain text editor application (TextEdit.app for instance)

You should see something like this in it:

[ AutoCAD - Wed Apr 10 19:11:55 2019  ]----------------------------------------

    Layer name        State          Color         Linetype     Lineweight
------------------ ----------- ------------------ ------------ ------------ 
"$_DOOR_MARK"      on       -P  60                "Continuous"  0.200 mm.  
"$TMP"             on           51                "Continuous"  0.200 mm.  
"0"                on       -P   7 (white)        "Continuous"  0.200 mm.  
"AXIS"             on       -P   7 (white)        "CENTER2"  0.150 mm.  
"Defects_cracks"   on       -P 210                "Continuous"  0.050 mm.  

"Defpoints"        on            7 (white)        "Continuous"  0.050 mm.  
"Door"             on       -P  14                "Continuous"  0.090 mm.  
"DOOR_MARK"        on       -P 202                "Continuous"  0.150 mm.  
"Elevator"         on       -P 210                "Continuous"  0.090 mm.  
"glass"            on       -P 151                "Continuous"  0.200 mm.  

"Hatch-Brick"      on       -P 255,19,19          "Continuous"  0.130 mm.  
"Hatch-door"       on       -P 250,0,0            "Continuous"  0.130 mm.  
"Hatch_1"          on       -P 215,26,1           "Continuous"  0.050 mm.  
"Hatch_2"          on       -P 0,0,244            "Continuous"  0.090 mm.  
"HID"              on       -P   3 (green)        "HIDDEN2"  0.250 mm.  

"IMG"              on       -P 253                "Continuous"  0.200 mm.  
"INFO"             on       -P 194                "Continuous"  0.200 mm.  
"Legend_marks"     on       -P 202                "Continuous"  0.200 mm.  
"OTM"              on       -P  14                "Continuous"  0.250 mm.  
"Petlia"           on       -P   7 (white)        "Continuous"  0.180 mm.  

"Roof_01"          on       -P 154                "Continuous"  0.180 mm.  
"Roof_hatch"       on       -P 151                "Continuous"  0.050 mm.  
"signs"            on       -P 0,39,159           "Continuous"  0.300 mm.  
"SIZE"             on       -P   1 (red)          "Continuous"  0.090 mm.  
"Stair"            on       -P 251                "Continuous"  0.200 mm.  

"Stoliarka"        on       -P  14                "Continuous"  0.350 mm.  
"Tables"           on       -P 192                "Continuous"  0.200 mm.  
"TMP_OBJ"          on            2 (yellow)       "Continuous"  0.200 mm.  
"WALL"             on       -P   5 (blue)         "Continuous"  0.500 mm.  
"WALL_1"           on       -P   4 (cyan)         "Continuous"  0.350 mm.  

"WIN"              on       -P 255                "Continuous"  0.150 mm.  
"WIN_1"            on       -P  14                "Continuous"  0.090 mm.  
"WIN_MARK"         on       -P 202                "Continuous"  0.150 mm.  

Current layer: "TMP_OBJ"

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 3 of 10

UNKNOWN.DESIGN.LAB
Advocate
Advocate

Hello @maxim_k , thank . you for the support. I tried the list but i am not getting the result you previewed. 

I was unable to find a Logs folder following the directory specified for one. I found a [.Plist] file that contained some data present in the model but none of it was layers as far as i examined. mostly setting and [DST] details.  Attached is a screenshot of what i am finding in that directly after running the Lisp for reference. 

 

Regards

 

0 Likes
Message 4 of 10

maxim_k
Consultant
Consultant
Post screenshot of AutoCAD Preferences window with "Log File Location" information.
What path do you have in it?
You should look for LOG file in using that path.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 5 of 10

maxim_k
Consultant
Consultant
If Log File Location path is empty on your side, add it to AutoCAD preferences and try again.
Or at least you can copy information about layers from Command window after you execute AutoLISP I provided.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 6 of 10

UNKNOWN.DESIGN.LAB
Advocate
Advocate

@maxim_k reference attached screen shot. The path is not empty but upon opening the path there is no log folder or file. I just saved my layers as a .lsp file from the "-Layer" command and that exported a file with layer data

 

The file does not export to excel into cells, which i what i am looking to do to create a shareable file, is there anything of the sort possible or will i have to do it manually ? 

 

Copying the layers data from the command line after running the lisp also worked. 

0 Likes
Message 7 of 10

maxim_k
Consultant
Consultant
Accepted solution

>>>>>The path is not empty but upon opening the path there is no log folder or file

Looks like although the path exists in preferences, but the folder itself doesn't exists on disk - that is why AutoCAD cannot write LOG on your side.

 

Meanwhile I have found another AutoLISP routine, which writes Layers information to file (.CSV format), which can be opened directly in Numbers.app or Imported to Excel (yes, in Excel you need to create new spreadsheet and use File->Import to import .CSV file correctly):

12019-04-11_13-28-52.png

2

 

2019-04-11_13-29-30.png

3

2019-04-11_13-29-58.png

42019-04-11_13-30-23.png

52019-04-11_13-30-45.png

62019-04-11_13-31-08.png

APPLOAD attached LSP file and use LYRSAVE command to save layers list to CSV file.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 8 of 10

mmvandewalle
Explorer
Explorer

I really appreciate you building this!  I used it and it worked great however, the one thing that isn't being exported is the lineweight.  I'm not really seeing any mention of the line weight within your .LSP that you provided.  Could you help me with this, please?

0 Likes
Message 9 of 10

maxim_k
Consultant
Consultant

Hi @mmvandewalle ,

 

Please try attached LSP.

You should see lineweight in the forth column.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 10 of 10

mmvandewalle
Explorer
Explorer

Thank you SO MUCH for this!  Excellent work!

0 Likes