reza Posted December 26, 2023 Share Posted December 26, 2023 Why doesn't it work properly on my file? (defun C:mtfr2 (/ ent strent ans newline x k ssmtxt removetxt) (setq ssmtxt (ssget '((0 . "Mtext")))) (setq x (getint "\nLine To Remove: ")) (repeat (setq k (sslength ssmtxt)) (setq strent (vlax-ename->vla-object (ssname ssmtxt (setq k (- k 1))))) (setq str (vla-get-textstring strent)) (setq ans (LM:csv->lst str "\\" 0)) (setq removetxt (nth (- x 1) ans)) (setq newline "") (setq x 0) (repeat (length ans) (if (= (wcmatch (strcase (nth x ans)) (strcase removetxt)) T) ;doesn't need a wild card. (princ) (setq newline (strcat newline "\\" (nth x ans))) ) (setq x (+ x 1)) ) (if (eq (vl-string-search "\\P" newline) 0) (setq newline (substr newline 3)) (setq newline (substr newline 2)) ) (vla-put-textstring strent newline) ) ; repeat (princ) ) Test.dwg 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.