Scripts - Add a space between text

Discussion in 'AutoCAD' started by Brockster, Feb 12, 2004.

  1. Brockster

    Brockster Guest

    I've search quite a bit and have not found an answer. I've created a script
    file that needed to changes an attribute string to "May 28, 2004". Seems
    simple, but have not found to explain how to add the space between "May",
    "28" and "2004". Any help is appreciated in advance.
     
    Brockster, Feb 12, 2004
    #1
  2. Brockster

    dean_bourke Guest

    Try placing:
    (eval "May 28, 2004")
    in place of the straight text.

    Dean
     
    dean_bourke, Feb 12, 2004
    #2
  3. Brockster

    Jaime Guest

    (strcat "MAY " "28, " "2004") (notice the extra space after "may" and "28"
     
    Jaime, Feb 13, 2004
    #3
  4. Brockster

    ECCAD Guest

    Brockster,
    IF you are building the script file, then running it, do something like this:
    (setq date_str (strcat (chr 34) month (chr 32) day "," (chr 32) year (chr 34)))
    The (chr 34) = "
    The (chr 32) = space, " "

    When building a script, you will need to (double quote) any string variable that will be placed on (1) line of the script.

    ex:
    insert "file_date" 0,0 1 1 0
    "MAY 28, 2004"
    or:
    insert "file_date" 0,0 1 1 0 date_str

    Bob
     
    ECCAD, Feb 13, 2004
    #4
  5. Brockster

    Brockster Guest

    I tried bother of the two above suggestions. In the first cases, If I use the (eval "May 28, 2004"), the script hangs. In the second case, the changed attribute text displays (strcat "MAY " "28, " "2004").
     
    Brockster, Feb 13, 2004
    #5
  6. Brockster

    Brockster Guest

    Sorry, the text example was just an example. Actually, what I need the attribute text to put in a revision description is something like "NOT FOR CONCTRUCTION" & "<SPACE>03/12/04". The space before the date is because the guy that designed the attribute block had a space in every (darn) attribute in the block and now it's just being noticed that is is there. Without tha space, the date sets on the the titleblock lines.
     
    Brockster, Feb 13, 2004
    #6
  7. Brockster

    Jaime Guest

    possibly if you posted the script or part of it you might get better
    answers...

    Jaime

    the (eval "May 28, 2004"), the script hangs. In the second case, the changed
    attribute text displays (strcat "MAY " "28, " "2004").
     
    Jaime, Feb 13, 2004
    #7
  8. Brockster

    Brockster Guest

    You want the script, I'll give you part of the script:

    -ATTEDIT
    n
    n
    pmehlbdr-info
    REV_DATE2
    <space>
    <space>
    01-23-04
    <space>

    The text <space> represents a " ". Now, what I need is to put a <space> in front of the date.
     
    Brockster, Feb 13, 2004
    #8
  9. Brockster

    Jaime Guest

    <SPACE>01-23-04

    this one work??


    front of the date.
     
    Jaime, Feb 13, 2004
    #9
  10. Brockster

    Brockster Guest

    It must be Friday 13th or something. I meant to type

    -ATTEDIT
    n
    n
    pmehlbdr-info
    REV_DATE2
    ;
    ;
    01-23-04
    ;

    The ; represents returns. Now, what I need is to put a <space> in front of the date.
     
    Brockster, Feb 13, 2004
    #10
  11. Brockster

    ECCAD Guest

    Maybe something like this: ?

    ----------------------
    -ATTEDIT
    n
    n
    pmehlbdr-info
    REV_DATE2
    ;
    ;
    " 01-23 -04"
    ;
     
    ECCAD, Feb 14, 2004
    #11
  12. Brockster

    Brockster Guest

    I tried that Bob, but the quotation marks are added to the text line, so on my sheet I see the text " 01-23 -04" quotation marks and all. Hmmm.... maybe the thing to do is to add the text with the two quotation marks and then run something afterwards just to remove the two quotations.

    Brock
     
    Brockster, Feb 16, 2004
    #12
  13. Brockster

    Jaime Guest

    why does this have to be a script?? why not use lisp?? and then call the
    lisp from a script ( i do this all the time)

    jaime

    on my sheet I see the text " 01-23 -04" quotation marks and all. Hmmm....
    maybe the thing to do is to add the text with the two quotation marks and
    then run something afterwards just to remove the two quotations.
     
    Jaime, Feb 16, 2004
    #13
  14. Brockster

    Brockster Guest

    That's even better, it's just has to be something I can edit from time to time. Each line of the revision box attribute has four attributes tag names: REV_NO1, REV_DATE1, REV_BY1, REV_DESCR1. The number indicates the attribute line, for example REV_NO1 is line one, REV_NO2 is line two, etc. If someone can create me a lisp file with the line one process, indicate where I should modify for the text string name to replace, I should be able to take it from there. Of course, any additional comment line would be welcome. Thanks!
     
    Brockster, Feb 16, 2004
    #14
  15. Brockster

    Jaime Guest

    do a search in this forum..there is a ton of stuff about modifying
    attributes im sure you could piece one together.

    Jaime

    time. Each line of the revision box attribute has four attributes tag names:
    REV_NO1, REV_DATE1, REV_BY1, REV_DESCR1. The number indicates the attribute
    line, for example REV_NO1 is line one, REV_NO2 is line two, etc. If someone
    can create me a lisp file with the line one process, indicate where I should
    modify for the text string name to replace, I should be able to take it from
    there. Of course, any additional comment line would be welcome. Thanks!
     
    Jaime, Feb 17, 2004
    #15
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.