Firstly, save the spreadsheet to CSV. Then find a routine to read csv into a LISP list. Then step through the list inserting the block at the points defined.
Your CSV file would look something like this:
Code:
456.65,234.56
234.56,1221.45
56.45,234.50
Your lisp function to place the blocks. I've included a quick port from CSV to LISP, this may not work in all instances.
Code:
(defun CSVtoLST (fn / file lst lst1 str n)
(setq file (open fn "r") lst nil);Open the file and start empty list
(while (setq str (read-line file)) ;Read the next line in the file
(setq lst1 (read (strcat "(" (vl-string-subst " " "," str) ")")));Convert string to real list
;;Check if only 2 items in list, then change to dotted pair
(if (= 2 (length lst1))
(setq lst1 (read (strcat "(" (vl-string-subst " . " "," str) ")")));Convert string to real list
)
;; Add line as item of list
(setq lst (cons lst1 lst))
)
(close file)
lst
)
;; Command function to insert blocks according to csv values
(defun c:InsBlkXY (/ fn xylst blkname n)
(setq blkname "BLK1") ;Change this to the block you wish to insert
(if (setq fn (getfiled "Select CSV" "" "csv" (+ 4 8)))
(progn
(setq xylst (CSVtoLST fn))
(setq n 0)
(while (< n (length xylst))
(command "-insert" blkname (nth n xylst) "" "" "")
(setq n (1+ n))
)
)
(princ "Canceled by user")
)
(princ)
)
Save this to a LSP file, load into AutoCAD using Tools --> Application Load. Then run by typing InsBlkXY at the command prompt.