leonucadomi Posted May 29 Posted May 29 This routine extracts text from a dimension, but extracts it as mtext I would like it to be just text and not mtext can someone help me thanks (defun c:EXC (/ e el p1 p2) (if (and (setq e (car (nentsel "\nPick dimension text: "))) (setq p1 (cdr (assoc 10 (setq el (entget e))))) (setq p2 (getpoint p1 "\nSpecify second point: ")) ) (entmakex (append (vl-remove-if '(lambda (x) (= 330 (car x))) el) (list (cons 10 p2)))) ) (setq LastEnt (entlast)) ;;; (setq tx (list "text1" "text2" )) (setq i -1 el (entget LastEnt) next T) (while next (setq i (rem (1+ i) (length tx)) el (subst (cons 1 (nth i tx)) (assoc 1 el) el) el (entmod el) st (getstring) next (= "" st)) ) (setq el (if (> (strlen st) 0) (subst (cons 1 st) (assoc 1 el) el) el) el (entmod el)) ;;; (princ) ): Quote
GLAVCVS Posted May 30 Posted May 30 (edited) Hi The easiest way is to explode up the text. You can add at the end (vla-explode (vlax-ename->vla-object (setq eu (entlast)))) (entdel eu) Edited May 30 by GLAVCVS 2 1 Quote
GLAVCVS Posted May 30 Posted May 30 (edited) Another option, more respectful of the original format, could be to replace your Entmakex with this one. (entmakex (foreach as el (setq l (if (setq v (cond ((= (setq c (car as)) 0) '(0 . "TEXT")) ((member c '(8 1 40 50 7 72)) as) ((= c 71) (cons c (cadr (assoc (cdr as) '((1 2) (2 1) (3 0) (4 0) (5 0)))))) ((= c 73) '(73 . 2)) ((member c '(10 11)) (cons c p2)) ) ) (append l (list v)) l ) ) ) ) Edited May 30 by GLAVCVS Code revised to make it a little simpler 2 1 Quote
GLAVCVS Posted May 30 Posted May 30 If you decide on the second option, do not forget to include in the list of local variables, after (defun c:EXC (/ the new entmakex variables: as l c v 1 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.