Author Topic: Write Excel cells to attributes  (Read 3250 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 636
Write Excel cells to attributes
« on: December 30, 2009, 09:28:33 AM »
Is it possible to write the content of Excel cells to attribute values?
Does anyone have a workaround?
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Write Excel cells to attributes
« Reply #1 on: December 30, 2009, 11:28:46 AM »
Yes, I believe this could be ahchieved, but it would be easier to read from either txt or csv.  :-)

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Write Excel cells to attributes
« Reply #2 on: December 30, 2009, 02:44:36 PM »
Hi,

I do agree with Lee Mac AutoLISP provides built in functions to read or write ascii files (txt, csv...).

Reading (or writing) an xls files will always be a slower process, but you can built some LISP functions using ActiveX.

You can get some inspiration (or directly use) Terry Miller's GetExcel.lsp

You can also try the .NET defined LISP functions gc-XlRead and gc-XlWrite
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Write Excel cells to attributes
« Reply #3 on: December 30, 2009, 02:55:33 PM »
Nice one Gile, I was going to recommend your gc-XlRead/Write - great work  ;-)

fixo

  • Guest
Re: Write Excel cells to attributes
« Reply #4 on: December 30, 2009, 03:18:48 PM »
Is it possible to write the content of Excel cells to attribute values?
Does anyone have a workaround?

It's possible but need to see the structure of
your Excel file
Try posting it in an attachment

~'J'~

lamarn

  • Swamp Rat
  • Posts: 636
Re: Write Excel cells to attributes
« Reply #5 on: December 30, 2009, 03:22:35 PM »
Thanks for replying.
The reason why I want this routines is to replace attributes from one block to another (drawing header).
The TAG name's are the same but the properties and the places are not.
This routine is useful but it doesn't do the job with attribute definitions.

http://www.theswamp.org/index.php?topic=31397.0

So, i think the only way to do this is if i place it in an excel file or txt file first..
Will try to put a code together..


Design is something you should do with both hands. My 2d hand , my 3d hand ..

fixo

  • Guest
Re: Write Excel cells to attributes
« Reply #6 on: December 30, 2009, 03:46:36 PM »
Thanks for replying.
The reason why I want this routines is to replace attributes from one block to another (drawing header).
The TAG name's are the same but the properties and the places are not.
This routine is useful but it doesn't do the job with attribute definitions.

http://www.theswamp.org/index.php?topic=31397.0

So, i think the only way to do this is if i place it in an excel file or txt file first..
Will try to put a code together..
Sorry in this case I can't help you without your sample drawing
with blocks and Excel file

~'J'~