athran Posted August 15, 2017 Share Posted August 15, 2017 No need Lee. I just search on how to use some commands and change the program you provided. Thanks! (defun c:asd ( / des dim enx idx sel txt ) (setq code (getint "\n Input Number of glass marking ") ) (repeat code (setq code_txt (strcat "\n Code left to click: " (itoa code) " ")) (princ "\n") (princ code_txt) (setq code (- code 1)) (if (and (setq sel (ssget '((0 . "TEXT,MTEXT,*DIMENSION")))) (setq qty (getint "\n Input Quantity ") ) (setq qty (itoa qty)) (setq des (open (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) ".csv") "a")) ;(strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) ".csv") ;use this to get filename of cad file ) (progn (repeat (setq idx (sslength sel)) (setq enx (entget (ssname sel (setq idx (1- idx))))) (if (wcmatch (cdr (assoc 0 enx)) "*DIMENSION") (setq dim (cons (rtos (cdr (assoc 42 enx)) 2 0) dim)) (setq txt (cons (cdr (assoc 1 enx)) txt)) ) ) (while (or dim txt) (write-line (strcat (cond ((car txt)) ("")) "," (cond ((cadr txt)) ("")) "," (cond ((car dim)) ("")) "," (cond ((cadr dim)) ("")) "," (cond (qty) ("")) ) ;strcat des ) (setq txt (cddr txt) dim (cddr dim) ) ) ) ) );repeat (if (= 'file (type des)) (close des)) (princ) );defun Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 15, 2017 Share Posted August 15, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.