Author Topic: Replace part of attribute  (Read 5524 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Replace part of attribute
« Reply #15 on: December 08, 2010, 06:39:37 PM »
Nice one Gary, I like it  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Replace part of attribute
« Reply #16 on: December 09, 2010, 08:29:17 AM »
Just being picky but s and n seem to be artifacts, no?

Code: [Select]
            (lambda ( a /[color=red] s n [/color])
              (if (wcmatch (vla-get-TextString a) 1st)
                (vla-put-TextString a 2nd)
              )
            )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Replace part of attribute
« Reply #17 on: December 09, 2010, 08:32:12 AM »
Just being picky but s and n seem to be artifacts, no?

Good catch Alan  :-)

Pad

  • Bull Frog
  • Posts: 342
Re: Replace part of attribute
« Reply #18 on: December 09, 2010, 10:55:16 AM »
I'm glad I saw this thread.
I've been having a problem blanking null value attributes since upgrading autocad.  In 2005 I could use find and then replace with nothing.
Since upgrading to 2009 you can't replace with nothing, a value has to be entered in the "replace with" box.

but
(defun c:nv ()(nullvalues "-999.00" ""))
works a treat thanks Lee and GDF!