Author Topic: importing csv file issues  (Read 3995 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
importing csv file issues
« on: May 17, 2007, 09:29:49 AM »
I have an excel file with all my layers setup like I want them.  Now I want to make a template file in Autocad that has my layers already setup properly.  What is the best/easiest way to get my layers into Autocad?

My thoughts were to write layers to a csv file from excel, then read that in lisp to make a list for each layer.  Then use 'mapcar' on each layer to creat and set properties.  My problems arise in the csv file.  lisp reads it differently than I thought it would and I'm not sure how to handle it or if there is an easier way.

All thoughts and suggestions are welcome.  :-)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8702
  • AKA Daniel
Re: importing csv file issues
« Reply #1 on: May 17, 2007, 09:48:51 AM »
I have an excel file with all my layers setup like I want them.  Now I want to make a template file in Autocad that has my layers already setup properly.  What is the best/easiest way to get my layers into Autocad?

My thoughts were to write layers to a csv file from excel, then read that in lisp to make a list for each layer.  Then use 'mapcar' on each layer to creat and set properties.  My problems arise in the csv file.  lisp reads it differently than I thought it would and I'm not sure how to handle it or if there is an easier way.

All thoughts and suggestions are welcome.  :-)

I use ADOlisp and access for setting up my layers.

whdjr

  • Guest
Re: importing csv file issues
« Reply #2 on: May 17, 2007, 10:08:25 AM »
Well I'm using Excel, cause I don't know Access.  I know ADOLISP says it can connect to excel but I don't know any of the commands cuse it seems like they are all sql statements.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: importing csv file issues
« Reply #3 on: May 17, 2007, 10:17:36 AM »
It depends upon your formatting in the CSV file ...

Put each layer information on a seperate line .. i.e.
Name,color,linetype,lineweight,plot style,plottable

thislayer,green,continuous,0.1,PlotStyle1,yes

Then read each line successively

(setq thisline (read-line file))

break down the line according to commas (or whatever your delimiter is) then pass the vars to the layer creation routine.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

whdjr

  • Guest
Re: importing csv file issues
« Reply #4 on: May 17, 2007, 10:20:44 AM »
It depends upon your formatting in the CSV file ...

Put each layer information on a seperate line .. i.e.
Name,color,linetype,lineweight,plot style,plottable

thislayer,green,continuous,0.1,PlotStyle1,yes

Then read each line successively

(setq thisline (read-line file))

break down the line according to commas (or whatever your delimiter is) then pass the vars to the layer creation routine.

Yeah that was my thoughts and that is what I was working on doing, I just didn't know if another way existed.

Thanks,

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: importing csv file issues
« Reply #5 on: May 17, 2007, 10:40:58 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: importing csv file issues
« Reply #6 on: May 17, 2007, 03:20:20 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

whdjr

  • Guest
Re: importing csv file issues
« Reply #7 on: May 18, 2007, 10:57:36 AM »