Message 1 of 12
Not applicable
11-15-2018
03:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good Evening!
I have a lisp script that exports dimension values to a csv file.
I have modified it to only export selected dimensions which is exactly what I want.
However;
I would also like to export any prefix the dimension has and include it with the exported dimension:
EG: a dimension of 36" that has a prefix of R should be something like R - 36, a dimension with no prefix would just be 36
Attached is my current lisp script:
; Save the Dimension's values to a CSV file ; mfuccaro@hotmail.com ; 2008 May ; Enhancements by CAD Studio, 2012 ; Modified by WhoolieShop to include prefix's and only work on current selection. ; (setq _dimexpdelimiter ",") ; set to ";" for CSY/DEU... (defun C:DimExp ( / s tx fn i d dl m file) (setq s (ssget (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) )
Thanks in advance!
Solved! Go to Solution.