Message 1 of 4

Not applicable
02-14-2019
02:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello. this is layer rename lsp that is only a partial change.
I want to remove that input texts.
for example. if there are layer names. aaabx1. aaavv2. aaaxy3. aaazz4... etc.
input "aaa"
bx1
vv2
xy3
zz4... etc
always thank you all for help.
(defun c:lann (/ old new doc)
(vl-load-com)
(and
(setq old (getstring T "\nold\w string: "))
(or
(snvalid old 1)
(prompt " Invalid string.")
)
(setq new (getstring T "\nnew string: "))
(or
(snvalid new 1)
(prompt " Invalid string.")
)
(or
(/= new old)
(prompt " Same string.")
)
(vlax-for layer
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(vla-put-name
layer
(vl-string-subst
new
old
(vla-get-name layer)
)
)
)
)
(princ)
)
Solved! Go to Solution.