• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    *Expert Elite*
    Posts: 2,066
    Registered: ‎11-24-2009

    Re: Pre-defined find & replace lisp

    06-03-2011 12:09 AM in reply to: kameron1967

    why of course it can, you need to provide us the block name if you want this to run without promptng for selection

     

     

     

    Please use plain text.
    Distinguished Contributor
    Posts: 136
    Registered: ‎09-05-2008

    Re: Pre-defined find & replace lisp

    06-03-2011 09:22 AM in reply to: pbejse

    The block name is BLOCKA and Tag name is DESCRIPTION.  But the change I want to update is what's written on the description.  So if it says "ISSUED FOR ABCDE", I'd like it to say "ISSUED FOR 12345".  Let me know if you need more information.

     

    Thanks, pbejse.

    Please use plain text.
    Active Contributor
    Posts: 33
    Registered: ‎04-03-2007

    Re: Pre-defined find & replace lisp

    08-04-2011 12:07 AM in reply to: Kent1Cooper

    Have you ever used the AEFINDTERMTEXT command in ACAD Electrical?  I've tried but it's not working.

    Please use plain text.
    Distinguished Contributor
    greg.battin
    Posts: 122
    Registered: ‎12-10-2010

    Re: Pre-defined find & replace lisp

    08-04-2011 06:31 AM in reply to: blackseabrew

    If the command isn't working because it says that the command is "Unknown" you may be able to use the command REDEFINE and bring the command "back to life"

    Please use plain text.
    Distinguished Contributor
    Posts: 136
    Registered: ‎09-05-2008

    Re: Pre-defined find & replace lisp

    04-23-2012 10:18 AM in reply to: pbejse

    Pbejse - I was wondering if you have a modified version that includes block name (BlockA) and description attribute (DESC) so that if Block A exists, we then check if DESC has "Issued for ABC".  If it does, we then update it to say "Issued for XYZ".  Thanks in advance.

    Please use plain text.
    *Expert Elite*
    Posts: 2,066
    Registered: ‎11-24-2009

    Re: Pre-defined find & replace lisp

    04-23-2012 10:12 PM in reply to: kameron1967

    kameron1967 wrote:

    Pbejse - I was wondering if you have a modified version that includes block name (BlockA) and description attribute (DESC) so that if Block A exists, we then check if DESC has "Issued for ABC".  If it does, we then update it to say "Issued for XYZ".  Thanks in advance.


     

      Start with this <----

     

    Holler if you hit a snag.

     

     

     

     

    Please use plain text.
    Distinguished Contributor
    Posts: 136
    Registered: ‎09-05-2008

    Re: Pre-defined find & replace lisp

    04-24-2012 12:57 PM in reply to: pbejse

    Thanks, Pbejse!  I think I have what I need.  But will let you know if I do hit a snag! :smileyhappy:

    Please use plain text.
    Active Contributor
    rwydesk500
    Posts: 36
    Registered: ‎01-13-2010

    Re: Pre-defined find & replace lisp

    05-20-2013 09:56 AM in reply to: Kent1Cooper

    How would the second instance of code be modified to account for spaces at the beginning and end of a text string? Thank you!

    Regards,

    Rick Yoerger
    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,086
    Registered: ‎09-13-2004

    Re: Pre-defined find & replace lisp

    05-20-2013 10:24 AM in reply to: rwydesk500

    rwydesk500 wrote:

    How would the second instance of code be modified to account for spaces at the beginning and end of a text string? Thank you!


    If I understand correctly, just include them inside the double-quotes wrapping the string, e.g. " issued for construction ".  If you might not always have the same number of spaces at the beginning or end of existing strings, you would probably need to use something like this:

     

    (setq tss (ssget "X" '((1 . "*issued for tender*"))))

     

    to find them [though that would also find strings with the same content even if what's outside it is not just spaces], and apply (vl-string-trim) if you want them removed.

    Kent Cooper
    Please use plain text.
    Active Contributor
    rwydesk500
    Posts: 36
    Registered: ‎01-13-2010

    Re: Pre-defined find & replace lisp

    05-20-2013 10:42 AM in reply to: Kent1Cooper

    I thought the spaces at either end of the word I am replacing was what was preventing it from working. However, it is not. After I load TRC.lsp and type the command, it returns the following error...

     

    "Command: TRC ; error: bad argument type: lselsetp nil"

     

    ...not sure why. I cut and pasted the code directly from your post. Thanks

    Regards,

    Rick Yoerger
    Please use plain text.