Originally Posted by
jpglisson
Because I might have close to a hundred different addresses
- - - Updated - - -
The number is always first.
The street name might be a number like 2001 E 5th Drive
Each address is a seperate mtext
All are on the same layer
Thanks
If the number is always first then this should work. It will loop asking "Select Text to Process : ". When you want to end the loop select a blank area of the screen. This will work for text and mtext.
Code:
;;
(defun splitstr ( s d / p ) (if (setq p (vl-string-search d s))(cons (substr s 1 p) (splitstr (substr s (+ p 1 (strlen d))) d)) (list s)))
(vl-load-com)
(defun c:nos ( / sel ent obj str)
(while (setq sel (entsel "\nSelect Text to Process : "))
(setq obj (vlax-ename->vla-object (setq ent (car sel))))
(cond ( (or (= "TEXT" (cdr (assoc 0 (entget ent))))
(= "MTEXT" (cdr (assoc 0 (entget ent))))
);end_or
(setq str (car (splitstr (vlax-get-property obj 'textstring) " ")))
(vlax-put obj 'textstring str)
)
)
)
)
;;
Once loaded type nos to run