Chris,
I can’t help you with the specifics to write your program, but I can offer you a utility to help you get started.
Here is a general purpose function for (Excel to AutoCAD) and (AutoCAD to Excel) applications. Special credit to Gilles Chanteau from Marseille, France for his sub-functions ColumnRow, Alpha2Number and Number2Alpha.
Here are two examples of how it works. Notice in the second example; it requires OpenExcel, one or more calls to PutCell, and ends with CloseExcel.
Code:
(defun c:Get-Example ( )
;GetExcel - Stores the values from Excel into *ExcelData@ list
;Syntax: (GetExcel ExcelFile$ SheetName$ MaxRange$)
(GetExcel "C:\\Folder\\Filename.xls" "Sheet1" "L30");<-- Edit Filename.xls
;GetCell - Returns the cell value from the *ExcelData@ list
;Syntax: (GetCell Cell$)
(GetCell "H21");Or you can just use the global *ExcelData@ list
);defun
(defun c:Put-Example ( )
;OpenExcel - Opens an Excel spreadsheet
;Syntax: (OpenExcel ExcelFile$ SheetName$ Visible)
(OpenExcel "C:\\Folder\\Filename.xls" "Sheet1" nil);<-- Edit Filename.xls
;PutCell - Put values into Excel cells
;Syntax: (PutCell StartCell$ Data$) or (PutCell StartCell$ DataList@)
(PutCell "A1" (list "GP093" 58.5 17 "Base" "3'-6 1/4\""));Repeat as required
;CloseExcel - Closes Excel session
;Syntax: (CloseExcel ExcelFile$)
(CloseExcel "C:\\Folder\\Filename.xls");<-- Edit Filename.xls
(princ)
);defun
For your project just use the format in the Put-Example function above.
There are several other options of the arguments explained in the function headings in the program.