STRCAT command

Discussion in 'AutoCAD' started by Metpar, Aug 11, 2004.

  1. Metpar

    Metpar Guest

    I have a lisp routine that prompts the user to enter a string and displays the default response. But I want to be able to call this lisp from a menu script file and have the "default concatenation" entered or accepted automatically without user input. If I try to simply insert a carraige return in the script file, the variable stays empty as if the user entered no response. How do I force the variable to accept the concatenation through STRCAT?

    This is a portion of the lisp file in question...

    (While
    (Null TmpTop)
    (SetQ
    TmpTop
    (ReadString
    T
    (StrCat
    "\nEnter Vanity description <PY VANITY "
    VanSize
    " "
    VanCol
    ">: "
    )
    )
    TmpTop
    (Cond
    ((And (= TmpTop "") VanTop) VanTop)
    (TmpTop TmpTop)
    (T Nil)
    )
    )
    )


    After this part, the user will see a prompt at the command line to enter a vanity description. The default response would include preset text ("PY VANITY ") followed by 2 variables defined beforehand ('VANSIZE' and 'VANCOL'). How do I combine all 3 into one new variable without user intervention so that I can call this new variable and insert it into a block attribute as part of a menu script file?

    Thanks.
     
    Metpar, Aug 11, 2004
    #1
  2. Metpar

    dblaha Guest

    You can define a flag value in the button definition and modify the lisp to watch for the flag:

    ^C^C(setq use_default T) 'YOUR ROUTINE NAME HERE'

    In the lisp routine, add an IF statement that checks the status of the use_default variable. If it's T, bypass the user input process. Be sure to set the use_default variable to NIL after it is checked.
     
    dblaha, Aug 11, 2004
    #2
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.