Attributes into excel
Attributes into excel
(OP)
I was wondering is there a way to extract the x,y coordinates of two or more block into Excel. It was easy in AutoCAD 2000 but the attribute extraction wizard in 2006 has changed.
I have a spreadsheet that uses length in the calculations, for now I am manually inputting the length.
Is there a lisp routine that I can use or would I have to make one of my own??
I have a spreadsheet that uses length in the calculations, for now I am manually inputting the length.
Is there a lisp routine that I can use or would I have to make one of my own??





RE: Attributes into excel
For me it is easier to write a quick lisp:
princ "\nStart with XYOUT")
(defun c:xyout ()
(setq f1 (open "c:\\blockpoints.csv" "w"))
(prompt "\nSelect blocks to write to file \"c:\\blockpoints.csv\": ")
(setq blockset (ssget '((0 . "INSERT"))))
(setq Item 0)
(repeat (sslength blockset)
(setq ename (ssname blockset Item))
(setq edata (entget ename))
(setq InsPt (cdr (assoc 10 edata)))
(setq xval (car InsPt))
(setq yval (cadr InsPt))
(setq xtxt (rtos xval 2 2))
(setq ytxt (rtos yval 2 2))
(write-line (strcat xtxt "," ytxt) f1)
(setq Item (+ 1 Item))
)
(close f1)
(princ)
)
RE: Attributes into excel
thank you
RE: Attributes into excel
Tks-
C. Fee
RE: Attributes into excel
;;--------------------------------------
(princ "\nStart with XYZOUT")
(defun c:xyzout ()
(setq f1 (open "c:\\blockpoints.csv" "w"))
(prompt "\nSelect blocks to write to file \"c:\\blockpoints.csv\": ")
(setq blockset (ssget '((0 . "INSERT"))))
(setq Item 0)
(repeat (sslength blockset)
(setq ename (ssname blockset Item))
(setq edata (entget ename))
(setq InsPt (cdr (assoc 10 edata)))
(setq xval (car InsPt))
(setq yval (cadr InsPt))
(setq zval (caddr InsPt))
(setq xtxt (rtos xval 2 2))
(setq ytxt (rtos yval 2 2))
(setq ztxt (rtos zval 2 2))
(write-line (strcat xtxt "," ytxt "," ztxt) f1)
(setq Item (+ 1 Item))
)
(close f1)
(princ)
)