PDA

View Full Version : need lisp routine input a data in CAD


xfirez
2009-03-22, 05:38 PM
need a routine lisp for export a data from excel to autocad..
here is the sample from excel files..

http://img4.imageshack.us/img4/4195/excelino.jpg

here is the result from excel
http://img4.imageshack.us/img4/1325/excel2u.jpg

please help me.

irneb
2009-03-23, 08:11 AM
Check under this link: http://asmitools.com/Files/Programs.html

The tabcoord.lsp creates a table which you can export to Excel. Or you could modify it to rather save to CSV file. If you want it directly into XLS you'll need to look at Excel's ActiveX interface.

Edit ... sorry scratch that ... read too fast ... you want it the other way:Oops:

Terry Cadd
2009-03-24, 12:33 AM
Oliver,
This one covers importing and extracting 3D points between Excel and AutoCAD.
http://autolisp-exchange.com/Forums/Forum3/F3T5P4.htm#31
Here's the link for the latest version of GetExcel.lsp:
http://web2.airmail.net/terrycad/LISP/GetExcel.lsp

xfirez
2009-03-24, 01:56 AM
Oliver,
Here's the link for the latest version of GetExcel.lsp:
http://web2.airmail.net/terrycad/LISP/GetExcel.lsp
how to apply..?

Terry Cadd
2009-03-25, 12:57 AM
Oliver,
Based upon the format of your Excel spread sheet in your first post, the following code will work. Change the Excel filename and path to the filename and path you used. Load GetExcel before you run the example. i.e. (load "GetExcel")


(defun c:TempPts (/ Row@)
(GetExcel "C:\\Temp\\TempPts.xls" nil nil);<-- Change Excel filename and path here
(command "_PLINE")
(foreach Row@ (cdr *ExcelData@)
(command (list (atof (cadr Row@)) (atof (caddr Row@))))
);foreach
(command "_c")
(princ)
);command

xfirez
2009-03-27, 06:47 PM
Oliver,
Based upon the format of your Excel spread sheet in your first post, the following code will work. Change the Excel filename and path to the filename and path you used. Load GetExcel before you run the example. i.e. (load "GetExcel")


(defun c:TempPts (/ Row@)
(GetExcel "C:\\Temp\\TempPts.xls" nil nil);<-- Change Excel filename and path here
(command "_PLINE")
(foreach Row@ (cdr *ExcelData@)
(command (list (atof (cadr Row@)) (atof (caddr Row@))))
);foreach
(command "_c")
(princ)
);command


any other solution?

hofcad
2009-03-31, 05:06 PM
Dear Oliver,

See for DDE method (Dynamic Data Exchange method):
http://forums.augi.com/showthread.php?t=28903&highlight=hofcad
http://www.theswamp.org/index.php?topic=12348.0

Or for scripting
http://www.thecadgeek.com/blog/2007/09/18/creating-script-files-with-excel/
http://www.lazydrafter.com/autocad-tips/writing-autocad-scripts-with-excel/
http://www.cadforum.cz/cadforum_en/qaID.asp?tip=6606
http://www.geocities.com/flores_2793@sbcglobal.net/Points.xls

Regards HofCAD CSI.