well I can't find what the path would matter for your app to function so I can't reproduce your problem. Did some rlx-pimping to test it on my own system. Just want to say that I strongly advise not to use (quit) , its like putting out the light with a brick or hitting your mother-in-law with a truck when a baseball bat is sufficient enough...
- (defun c:lp (/ f a inp numt doc_path txt decimals name) (defun *error* (msg) (if (or (= msg "quit / exit abort") (= msg "bad argument type: lentityp nil") (= msg "bad argument type: numberp: nil")) (princ "") (princ msg)) (if f (close f))) (setvar "cmdecho" 0) (command "dimzin" 0)(setvar "cmdecho" 1) (setq txt "") (initget 0 "N W") (or (setq name (getkword "\nDo you wish to list coords with name or without [ / Without ] "))(setq name "N")) (initget 0 "0 1 2 3 4") (or (setq decimals (getkword "\nEnter number of decimals [ 0/1/2/3/4 ] : "))(setq decimals "3")) (setq decimals (atoi decimals) doc_path (vl-string-translate "/" "\" (getvar 'DWGPREFIX))) (if (setq f (open (getfiled "Text File" doc_path "txt" 5) "a")) (while (setq inp (entsel "\nSelect point number: ")) (cond((and (= name "N") (member (cdr (assoc 0 (setq numt (entget (car inp))))) '("ATTRIB" "MTEXT" "TEXT"))) (setq a (getpoint "\nSelect point: ")) ;(if (= (cdr (assoc 0 numt)) "MTEXT") (progn (GetTextFromMText numt)(princ txt f)(princ "\n"))(princ (cdr (assoc 1 numt)) f)) (if (= (cdr (assoc 0 numt)) "MTEXT") (princ (LM:UnFormat (cdr (assoc 1 numt)) nil) f) (princ (cdr (assoc 1 numt)) f)) (mapcar '(lambda (x) (princ x f)) (list "," (rtos (car a) 2 decimals) "," (rtos (cadr a) 2 decimals) "," (rtos (caddr a) 2 decimals) "\n") ) ;(princ "," f) (princ (rtos (car a) 2 decimals) f) (princ "," f) (princ (rtos (cadr a) 2 decimals) f) ;(princ "," f) (princ (rtos (caddr a) 2 decimals) f) (princ "," f)(princ "\n" f)) ((= name "W") (setq a (getpoint "\nSelect point: ")) (princ (rtos (car a) 2 decimals) f)(princ "," f)(princ (rtos (cadr a) 2 decimals) f)(princ "," f) (princ (rtos (caddr a) 2 decimals) f)(princ "," f)(princ "\n" f)) ) ) ) (if f (close f)))(princ "\nList points...by TOMISLAV VARGEK...Osijek,Croatia...\n...Type LP to initiate...")(defun GetTextFromMText (numt / posto_pos ima) (setq txt (cdr (assoc 1 numt))) ;vadim tekst (setq txt (vl-string-right-trim " } " txt)) ;oduzimam desnu } i razmak (setq txt (substr txt (+ (vl-string-search ";" txt) 2))) ;oduzimam sve do prvog ; (if (= (vl-string-search ";" txt (- (strlen txt) 1)) (- (strlen txt) 1) ) ; ako je ; na kraju (setq txt (vl-string-right-trim "; " txt)) ;oduzimam desno sve do ; ) (if (= (vl-string-search "{" txt) 0) ;ako je ostala na prvom mjestu { vadim sve od (setq txt (substr txt (vl-string-search ";" txt))) ; prvog ; do kraja ) (if (> (vl-string-search "{" txt) 0) ;ako je ostala negdje { vadim sve od nje do ; (setq txt (strcat (substr txt 1 (vl-string-search "{" txt)) ; i spajam s ostalim (substr txt (+ (vl-string-search ";" txt) 2)) ) ) ) (setq txt (vl-string-subst "" "[url="file://\\S"]\\S[/url]" txt)) (setq ima T) (while ima (if (> (setq posto_pos (vl-string-search "%%" txt)) 0) (setq txt (strcat (substr txt 1 posto_pos)(substr txt (+ posto_pos 4)))) (setq ima nil) ) ) );;-------------------=={ UnFormat String }==------------------;;;; ;;;; Returns a string with all MText formatting codes removed. ;;;;------------------------------------------------------------;;;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;;;;------------------------------------------------------------;;;; Arguments: ;;;; str - String to Process ;;;; mtx - MText Flag (T if string is for use in MText) ;;;;------------------------------------------------------------;;;; Returns: String with formatting codes removed ;;;;------------------------------------------------------------;;(defun LM:UnFormat ( str mtx / _replace rx ) (defun _replace ( new old str )(vlax-put-property rx 'pattern old)(vlax-invoke rx 'replace str new)) (if (setq rx (vlax-get-or-create-object "VBScript.RegExp")) (progn (setq str (vl-catch-all-apply (function (lambda ( ) (vlax-put-property rx 'global actrue)(vlax-put-property rx 'multiline actrue) (vlax-put-property rx 'ignorecase acfalse) (foreach pair '( ("\032" . "\\\\\\\") (" " . "\\\\P|\\n|\\t") ("$1" . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]") ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);") ("$1$2" . "\\\\(\\\\S)|[\\\\](})|}") ("$1" . "[\\\\]({)|{")) (setq str (_replace (car pair) (cdr pair) str))) (if mtx (_replace "\\\" "\032" (_replace "[url="file://\\$1$2$3"]\\$1$2$3[/url]" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str)) (_replace "\" "\032" str)))))) (vlax-release-object rx)(if (null (vl-catch-all-error-p str)) str) ) ))
gr. Rlx |