Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm looking for a lisp routine that can find and replace multileader text.
I want to replace "T." with "T+" and "B." with "B+".
All the multileaders are on layers with a suffix of "-elev".
Any help will be greatly appreciated.
Thanks in advance,
Larry
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
bdsmls wrote:I'm looking for a lisp routine that can find and replace multileader text.
I want to replace "T." with "T+" and "B." with "B+".
All the multileaders are on layers with a suffix of "-elev".
Any help will be greatly appreciated.
Thanks in advance,
Larry
command: _find
settings....
Text types
Dimension/Leader text
Why the need for lisp codes?
Anyway, since i'm replying.
(defun c:REpME (/ sel e)
(setq sel (ssget "_X" '((0 . "MULTILEADER")(8 . "*-elev"))))
(repeat (sslength sel)
(setq e (vlax-ename->vla-object (ssname sel 0)))
(vla-put-textstring
e
(vl-string-translate
"B.T."
"B+T+"
(vla-get-textstring e)))
(ssdel (ssname sel 0) sel)
)
)
HTH
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Scratch the previous post
This is more specific:
(defun c:REpME (/ sel e)
(if (setq sel (ssget '((0 . "MULTILEADER")(8 . "*-elev"))))
(repeat (sslength sel)
(setq e (vlax-ename->vla-object (ssname sel 0))
str (vla-get-textstring e))
(if (setq f
(cond
((wcmatch str "*B.*") (list "B." "B+"))
((wcmatch str "*T.*") (list "T." "T+"))))
(vla-put-textstring e
(vl-string-subst (cadr f)(car f) str) )
)
(ssdel (ssname sel 0) sel)
)
)
(princ)
)
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
That's what i was looking for. Thanks for your help.
Larry
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
@pbejse: FYI, wcmatch IS case sensitive.
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You are absolutely right.. my mistake ![]()
Thanks Alanjt.....
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Would this work if a block with an attribute is embedded in the multileader?
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
bbarkman.jedson wrote:Would this work if a block with an attribute is embedded in the multileader?
Yes i think its possible, what do you have in mind?
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Find and replace multileade r text with LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Here's the code.



