Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this code but i want to change it so i can search and change the last 9 characters of a string of 26 characters?
How do i do?
; Changes textstring if found regardless of block
(vl-load-com)
(defun ChgTxtStrJaar ( / attList a i obj ss)
(if(setq ss(ssget "_X" '((0 . "INSERT"))))
(progn
(repeat(setq i (sslength ss))
(setq obj (vlax-ename->vla-object(ssname ss(setq i(1- i))))
attList(vlax-invoke obj 'GetAttributes)
)
(foreach a attList
(if(=(vla-get-textstring a)"AAA.B.CCC=ABC.UC001-UCA01") ;Find string...
(vla-put-textstring a "AAA.B.CCC=ABC.UC551-UCA01") ; ...replace with this
)
);foreach
);repeat
);progn
);if
(princ)
)
Solved! Go to Solution.