alanjt Posted April 14, 2011 Posted April 14, 2011 Not necessary, in case DXF 1 started with either "\\P" or "\n" and the next line of text didn't start until somewhere within the DXF 3 block perhaps. 254+ characters later Quote
Lee Mac Posted April 14, 2011 Posted April 14, 2011 254+ characters later *shrug* just throwing it out there Quote
alanjt Posted April 14, 2011 Posted April 14, 2011 *shrug* just throwing it out there My point was that if we're using the filter within ssget (since it only searches the first matching pair), it's kind of pointless to step through the entire entity data dump when it's only concerning itself with the first. Boy, you will argue with a post. LoL Quote
alanjt Posted April 14, 2011 Posted April 14, 2011 Just for grins and giggles (using my modded example): (defun c:test (/ ss i e s) (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "MTEXT")))) (repeat (setq i (sslength ss)) (if (cond ((vl-string-search "\\P" (setq s (apply 'strcat (mapcar '(lambda (x) (if (vl-position (car x) '(1 3)) (cdr x) "" ) ) (entget (setq e (ssname ss (setq i (1- i))))) ) ) ) ) ) ((vl-string-search "\n" s)) ) (vla-put-Textstring (vlax-ename->vla-object e) (car (vl-remove "" (read (strcat "(\"" (LM:StringSubst "\" \"" "\\P" (LM:StringSubst "\" \"" "\n" s)) "\")") ) ) ) ) ) ) ) (princ) ) (defun LM:StringSubst (new old string / l i) (setq l (strlen new) i 0 ) (while (setq i (vl-string-search old string i)) (setq string (vl-string-subst new old string i) i (+ i l) ) ) string ) Quote
LearningLisP Posted April 15, 2011 Author Posted April 15, 2011 wow.. i thought this was solved.. .. you guys are genius!! thanks! @Thalwart ah ok.. maybe it wont work in an older version. thanks! Quote
LearningLisP Posted April 15, 2011 Author Posted April 15, 2011 hey alan, tested your code and unfortunately, it did not work on me. i guess its my CAD version. thanks for updating it. Quote
rndpis Posted November 22, 2013 Posted November 22, 2013 Can you please suggest us how can we delete last line of the AutoCAD mtext by a single click through lisp file. Thanks in advance! Quote
Ish Posted June 8, 2019 Posted June 8, 2019 IS THERE ANY CHOICE OPTION, any one can provide a lisp MAY BE IN SOME MTEXT I WANT REMOVE ABOVE 2 OR 3 LINE MAY BE IN SOME MTEXT I WANT REMOVE BELOW ONE LINE (2 OR 3) . *** MUST BE ASK CHOICE (FROM ABOVE 1,2,3......OR FROM BELOW 1,2.3.....) LIKE THAT THANKS Quote
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.