alanjt Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
Lee Mac Posted April 14, 2011 Share Posted April 14, 2011 254+ characters later *shrug* just throwing it out there Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
alanjt Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
LearningLisP Posted April 15, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
LearningLisP Posted April 15, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
rndpis Posted November 22, 2013 Share 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 Link to comment Share on other sites More sharing options...
Ish Posted June 8, 2019 Share 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 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.