Passing a space in a script file.

Discussion in 'AutoCAD' started by Sage Cowsert, Feb 25, 2004.

  1. Sage Cowsert

    Sage Cowsert Guest

    I'm sure this has been asked a thousand times but I'm unable to find a
    solution. I'm writing a script file to run the cht lisp routine to eliminate
    double spaces in mtext. I need to pass two spaces in the script file to the
    lisp routine. If I qoute the spaces then it looks for the actual qoutes as
    well. I'm guessing that the lisp routine is using (getstring). I've tried
    setting the double spaces with (setq replacestring " ") then calling it up
    with !replacestring, no go. It looks for the actual word "!replacestring".
    At this point I'm tempted to write my own find and replace lisp routine just
    for this. If I could get cht to work it would be helpful. So heres what I've
    got. I'm looking to replace " " with ******************* at this point.

    Thanks

    ================================================
    (SSGET "X" '((0 . "MTEXT")))
    CHT
    P

    T
    G

    *******************
     
    Sage Cowsert, Feb 25, 2004
    #1
  2. Sage Cowsert

    ECCAD Guest

    Sage,
    You might try using the (chr 32) equivalent to a " ".
    e.g.
    (SSGET "X" '((0 . "MTEXT")))
    CHT
    P
    (strcat (chr 32)(chr 32))
    T
    G

    *******************

    Bob
     
    ECCAD, Feb 25, 2004
    #2
  3. Sage Cowsert

    Sage Cowsert Guest

    Thanks, the problem is that I think your replying to a getstring command.

    If you go (getstring "\nPut your attempt here: ")
    Then paste this into the command line (strcat (chr 32)(chr 32)) it replys as
    "(strcat (chr 32)(chr 32))" and I think then looks for that quoted string
    rather then " ".

    I'm stumped, without custom building my own find and replace.
     
    Sage Cowsert, Feb 25, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.