Export dimension from Cad to Excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I need some guidance on updating a lisp file I found online (shared below). I am very new to lisp files. I want to export cad dimensions to excel. Following lisp file does that but it does not export all the dimensions. When there are multiple same dimension, it just export one of that dimension. For example: I need to export (5) dimensions but it export only (4) dimensions as it is exporting only one 11'-11.25" even though there are two of them. I would appreciate the help to solve this. Thank you.
;
(setq _dimexpdelimiter ",") ; set to ";" for CSY/DEU...
(defun C:DimExp ( / s tx fn i d dl m file)
(setq s (ssget "_X" (list '(0 . "DIMENSION")))
tx nil
fn (strcat (getvar "dwgprefix") "DimExp.csv"))
(repeat (setq i (sslength s))
(setq d (ssname s (setq i (1- i)))
dl (entget d)
m (cdr (assoc 42 dl)))
(if (not (member m tx)) (setq tx (cons m tx)))
)
(setq s nil)
(if tx (progn
(setq file (open fn "a")) ; append
(write-line "" file)
(princ (strcat (getvar "dwgname") _dimexpdelimiter) file)
(foreach x tx
(princ x file)
(princ _dimexpdelimiter file)
)
(if file (close file))
(princ (strcat "\n" (itoa (length tx)) " dimensions written to " fn))
))
(princ)
)