PDA

View Full Version : LISP to convert layers from Excel to AutoCAD



DEEPAKRAJ
15th Apr 2012, 07:28 am
Dear Lee,

i need a lisp which can convert the layers from excel to autocad. please do the needful.

note :- the layers,colour and linetype are only given in text forum.

BlackBox
15th Apr 2012, 09:23 am
Dear Lee,

i need a lisp which can convert the layers from excel to autocad. please do the needful.

note :- the layers,colour and linetype are only given in text forum.


Please stop requesting that someone write code for you.

SLW210
16th Apr 2012, 04:06 pm
New thread created.

BIGAL
17th Apr 2012, 03:38 am
Simple in excel layname colour linetype new column "-la N layname c colour Lt linetype" repeat as required

Either save the column into notepad then save as a script file or copy column and paste direct to Autocad command line.

BlackBox
17th Apr 2012, 06:08 am
Perhaps the similar threads below will yield a potential solution. :thumbsup:

Bill Tillman
17th Apr 2012, 02:53 pm
I have toyed around with reading Excel files from LISP/VLISP and while it works quite well, it's a rather laborious task and seems slow to execute. Reading a text file with LISP/VLISP is really fast and it's much easier to code. The project I'm working on initially started out reading everything from the Excel file, but we ditched this method in favor of having VBA write the data from Excel to a text file. The VBA code then loaded the needed references and then launches AutoCAD and loads and executes the VLISP code. This VLISP code then reads the text file written by VBA and it's off to the races.

I would suggest you follow the advice from BIGAL and either use a script or dump the layers and properties from Excel to a text file. You might need to do a little formatting first, but once the file is in order you could either read it or incorporate it in your LISP code to create the new layers.

BlackBox
17th Apr 2012, 03:17 pm
... .CSV (using either "," of "\t") is your friend. :thumbsup:

BlackBox
17th Apr 2012, 03:19 pm
In the spirit of adding yet another hint... Perhaps this old thread (http://www.cadtutor.net/forum/showthread.php?57570-Layer-Creater-Lisp-Routine-Issue&p=390543&viewfull=1#post390543) may be of use. :whistle: