Rename the text

Discussion in 'AutoCAD' started by Adesu, Apr 13, 2004.

  1. Adesu

    Adesu Guest

    Dear Alls,
    I would create a text in title of drawing,and then recall them to rename
    the text,but I difficult to solve it,can anyone's help to me,this is sample;
    (command ".text" (list 5 6)2 "" (setq Z1 "NAME OF DRAWING") "")
    I mean want to call Z1 and rename it with new name.
    Best regards
    Ade Suharna
     
    Adesu, Apr 13, 2004
    #1
  2. Adesu

    bob.at Guest

    Do you want the user to input the name of drawing (-> 1) or to you want to use the actual name of drawing (->2)?

    1.) (command "_.text" (list 5 6) "2" ""(getstring "\nName of drawing: "))

    2.) (command "_.text" (list 5 6) "2" ""(getvar "dwgname"))

    bob.at
     
    bob.at, Apr 13, 2004
    #2
  3. Adesu

    Adesu Guest

    Hi bob.at,thanks a lot for your reply.
    for
    1) become overlay
    2) ? (no action)
    (command ".text" (list 5 6)2 "" (setq Z1 "NAME OF DRAWING")"") --> it's
    default program.
    at the next program I want call Z1 and replace it with new name drawing.
    Best regards
    Ade Suharna
    use the actual name of drawing (->2)?
     
    Adesu, Apr 14, 2004
    #3
  4. Adesu

    bob.at Guest

    Hi Ade

    1) what do you mean with "become overlay"?
    2) places an AutoCAD text element at point 5,6 which contains the name of the actual drawing.

    Its not clear to me what you really want to do. Your command makes two things: first it defines a variable Z1 which contanins the text string "NAME OF DRAWING" (exactly this string, but not the real name of the drawing). Second it generates an AutoCAD text at position 5,6 with same text as above.
    At your next step you must distinguish the to elements:
    You can change the content of variable Z1 by writing (setq Z1 "NEW DRAWING NAME"). But this doesnt affect the AutoCAD text. Or you can change the text element with:
    (setq el (entget (car (entsel "\Select text: "))))
    (entmod (subst (cons 1 "NEW DRAWING NAME") (assoc 1 el) el))
    but this does not change var Z1.

    And there are 2 things you must decied:
    a) what textstring is the new text (fix string->see above, userinput or sysvar "dwgname")?
    b) how to select the AutoCAD text element (user selection ->see above, searching text on a certain layer or with a certain old text string,...)

    bob.at
     
    bob.at, Apr 14, 2004
    #4
  5. Adesu

    Adesu Guest

    Hi bob.at,thanks a lot and your lisp become here
    (setq el (entget (car (entsel "\Select text: "))))
    (entmod (subst (cons 1 (getstring "\nENTER NEW DRAWING NAME: ")) (assoc 1
    el) el))
    Best regards
    Ade Suharna
     
    Adesu, Apr 14, 2004
    #5
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.