See the top rated post in this thread. Click here

Page 1 of 8 12345 ... LastLast
Results 1 to 10 of 74

Thread: AutoCAD Speak

  1. #1
    Login to Give a bone
    5

    Default AutoCAD Speak

    This thread was started on TheSwamp, http://www.theswamp.org/index.php?topic=14549.0, and you guys might have fun with it also.
    Code:
    (defun c:SayIt (/ Phrase$ Sapi)
      (if (setq Phrase$ (getstring "\nEnter phrase: " t))
        (progn
          (setq Sapi (vlax-create-object "Sapi.SpVoice"))
          (vlax-invoke Sapi "Speak" Phrase$ 0)
          (vlax-release-object Sapi)
        );progn
      );if
      (princ)
    );defun c:SayIt
    Last edited by Terry Cadd; 2007-01-19 at 04:26 AM. Reason: Needed to add Sapi as local variable

  2. #2
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    ok that is cool.
    I've got a VBA that will play WAV files, but nothing like this.

  3. #3
    100 Club jpduhon's Avatar
    Join Date
    2005-10
    Posts
    153
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    jumpin' Jesus, i'm gonna have fun with this one!!!
    thanks.

  4. #4
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Quote Originally Posted by jpduhon
    jumpin' Jesus, i'm gonna have fun with this one!!!
    thanks.
    Let's see.

    add a phrase to when an alert is issued. so you have a dialog and verbal.
    add to customer commands just for fun. ("now running..." "input data now" "program complete")
    has to be someway to make it speak commands after they are entered.

    mess with unsuspecting users at time intervals or on specific commands.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Quote Originally Posted by madcadder
    has to be someway to make it speak commands after they are entered.
    Just rearrange it to be a function with an argument.
    Code:
    (defun SayIt (Phrase$/ )
      (if (setq Phrase$)
        (progn
          (setq sapi (vlax-create-object "Sapi.SpVoice"))
          (vlax-invoke sapi "Speak" Phrase$ 0)
          (vlax-release-object sapi)
        );progn
      );if
      (princ)
    );defun c:SayIt
    Now you could call it without user intervention, e.g. in the begincommand event:
    (sayit commandname)
    C:> ED WORKING....

  6. #6
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Quote Originally Posted by Ed Jobe
    Just rearrange it to be a function with an argument.
    Code:
    (defun SayIt (Phrase$/ )
      (if (setq Phrase$)
        (progn
          (setq sapi (vlax-create-object "Sapi.SpVoice"))
          (vlax-invoke sapi "Speak" Phrase$ 0)
          (vlax-release-object sapi)
        );progn
      );if
      (princ)
    );defun c:SayIt
    Now you could call it without user intervention, e.g. in the begincommand event:
    (sayit commandname)
    Just a little more instruction if you would. You make it sound like I can load the routine and when a command is typed and executed it would speak the command.

    What I see (scary) is this would work with another lisp and I could make it speak the custom command.

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Quote Originally Posted by madcadder
    Just a little more instruction if you would. You make it sound like I can load the routine and when a command is typed and executed it would speak the command.
    Sorry, I assumed you had a lisp or vba background. In lisp you would place the code in a reactor and "commandname" would be returned from monitoring the current command sysvar (CMDNAMES). In vba, "commandname" is passed via the BeginCommand event.
    C:> ED WORKING....

  8. #8
    I could stop if I wanted to sschwartz85916's Avatar
    Join Date
    2005-04
    Location
    Oakland County, Michigan
    Posts
    424
    Login to Give a bone
    0

    Talking Re: AutoCAD Speak

    Quote Originally Posted by Terry Cadd
    This thread was started on TheSwamp, http://www.theswamp.org/index.php?topic=14549.0, and you guys might have fun with it also.
    Code:
    (defun c:SayIt (/ Phrase$)
      (if (setq Phrase$ (getstring "\nEnter phrase: " t))
        (progn
          (setq sapi (vlax-create-object "Sapi.SpVoice"))
          (vlax-invoke sapi "Speak" Phrase$ 0)
          (vlax-release-object sapi)
        );progn
      );if
      (princ)
    );defun c:SayIt
    Oh, this is some seriously good stuff.

  9. #9
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Here's a shorter version. Also found that certain characters can be used as a slight pause, such as periods and commas.
    (SayIt "What you, talkin about. Willis?")
    (SayIt "Houston, we have a problem!");<-- great for an *error* function...
    Code:
    (defun SayIt (Phrase$ / Sapi)
      (setq Sapi (vlax-create-object "Sapi.SpVoice"))
      (vlax-invoke Sapi "Speak" Phrase$ 0)
      (vlax-release-object Sapi)
      (princ)
    );defun SayIt
    Last edited by Terry Cadd; 2007-01-18 at 07:29 PM. Reason: Added local variable.

  10. #10
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: AutoCAD Speak

    Sow do I make this say, "Good day to you sir, today we are going to conquer the world!"
    when I first open AutoCad?

Page 1 of 8 12345 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 2015-08-07, 04:03 PM
  2. Speak 4 cad
    By maa in forum Software
    Replies: 9
    Last Post: 2006-06-30, 12:13 PM
  3. speak to autocad
    By jaberwok in forum Software
    Replies: 9
    Last Post: 2005-11-09, 08:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •