TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: lamarn 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?
-
Yes, I believe this could be ahchieved, but it would be easier to read from either txt or csv. :-)
-
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 (http://web2.airmail.net/terrycad/LISP/GetExcel.lsp)
You can also try the .NET defined LISP functions gc-XlRead and gc-XlWrite (http://www.theswamp.org/index.php?topic=31441.0)
-
Nice one Gile, I was going to recommend your gc-XlRead/Write - great work ;-)
-
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'~
-
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..
-
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'~