How can i activate the Enter key thro VBA.

Discussion in 'AutoCAD' started by kamalesh, Jun 9, 2004.

  1. kamalesh

    kamalesh Guest

    Hi buddies,

    I'm using VBA+LISP to create a text in AutoCAD. I'm passing the text value from VBA to LISP and then it is passed to AutoCAD. Here when i tend to end the string using " " (i.e. space) it is also added to the string. So the only way to terminate the string is by passing the command to activate the ENTER key.

    Here is my question, How can i activate the ENTER Key from VBA

    This is my code in lisp:
    (setq qty(getstring 1 "Enter Qty:"))
    (command "text" "1,1,1" "0" qty)
    (setq qy(getstring 1 "Enter details:"))
    (command "text" "8,8,8" "0" qy)

    This is the corresponding code in VBA
    ThisDrawing.SendCommand ("3")
    ThisDrawing.SendCommand (" ")
    ThisDrawing.SendCommand ("Hi How are you")
    ThisDrawing.SendCommand (" ")

    Obatined Result:
    "3 Hi How are you"
    but i want in this to be two different strings...

    Can any one help me....

    Thanks in advance...

    Regards,
    Kamalesh.
     
    kamalesh, Jun 9, 2004
    #1
  2. kamalesh

    Michel Guest

    You mean you want a carriage return? Look in the help for vbCr and vbLf and vbCrLf.

    for example:
    "text 1" & vbCrLf & "text 2"

    regards,
    Michel
     
    Michel, Jun 9, 2004
    #2
  3. kamalesh

    kamalesh Guest

    Dear Michel ,

    I tried it with VbCr...
    Wow It works!!!!!

    Thanks a lot buddy...
    U helped me a lot...

    Thnx n Regards,
    Kamalesh.
     
    kamalesh, Jun 9, 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.