Oleg,
Would you want to make a small adjustment to this code for me? The output file only has 1 decimal place in the cells. can that be changed to 4 decimal places. I tried to do it myself but couldn't figure it out. Any help would be appreciated. Below is the one I am using.
(vl-load-com)
;;==============================================;;
(defun C:BCSV (/ *error* datafile data_line en filename obj sset)
(defun *error* (msg)
(if datafile (close datafile))
(if msg (princ (strcat "\nError! " msg)))
(princ)
)
(setq filename (strcat (getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))".csv")
)
(command "._zoom" "_e")
(if
(setq sset (ssget "X" (list (cons 0 "INSERT")(cons 410 (getvar "CTAB")))))
(progn
(setq part (getstring T "\nProduct Code: "))
(setq fact (getstring T "\nManufacturer : "))
(setq datafile (open filename "A"))
(while (setq en (ssname sset 0))
(setq obj (vlax-ename->vla-object en))
(setq data_line (strcat part ","
fact ","
(vlax-get-property obj 'EffectiveName) ","
(rtos (car (vlax-get obj 'InsertionPoint)) 2 3) ","
(rtos (cadr (vlax-get obj 'InsertionPoint)) 2 3) ","
(rtos (caddr (vlax-get obj 'InsertionPoint)) 2 3) ","
(rtos (vlax-get-property obj 'XScaleFactor) 2 1) ","
(rtos (vlax-get-property obj 'YScaleFactor) 2 1) ","
(rtos (vlax-get-property obj 'ZScaleFactor) 2 1) ","
(vla-get-layer obj)))
(write-line data_line datafile)
(ssdel en sset)
)
(close datafile)
)
)
(command "._zoom" "_p")
(princ)
)
(prompt "\nStart command with BCSV")
(prin1)