Calling AutoCAD Commands

Discussion in 'AutoCAD' started by Sunburned Surveyor, Nov 12, 2004.

  1. I've got a quick question about calling AutoCAD commands from within AutoCAD.

    I want to create some MTEXT from within an AutoLISP routine. I know I can use the command in the following format:

    (command "_MTEXT" POINT1 POINT2 STRING "")

    However, is there a way to pull up the normal MTEXT Dialog from within the AutoLISP routine? Or even have AutoCAD display the propmts for the two points and MTEXT contents at the command prompt? I can't get this to work. What is the trick?

    I am also having a problem calling the _QLEADER command to draw a leader from within the AutoLISP routine. If I try the following statement:

    (command "_qleader" "")

    I am automatically directed into the Leader Settings Dialog. Is there a way to use the QLEADER command, skip the settings dialog, and have the user select the points to draw the leader?

    I tried:

    (command "_qleader")

    But it didn't work.....

    Thanks for the help.

    The Sunburned Surveyor
     
    Sunburned Surveyor, Nov 12, 2004
    #1
  2. Sunburned Surveyor

    Jeff Mishler Guest

    (command "qleader") works, but make sure cmdecho is set to 1 or you won't
    see the prompts.......
    Same thing for Mtext....but Mtext also needs (initdia) called immediately
    before the (command "mtext")
     
    Jeff Mishler, Nov 12, 2004
    #2
  3. Sunburned Surveyor

    ECCAD Guest

    Try this add-in..
    ......
    (setq PT1 (getpoint "\nPick beginning Leader Point: "))
    (setq PT2 (getpoint PT1 "\nNext Leader Point: "))
    (setq DX (distance PT1 PT2))
    (setq PT3 (list (+ (car PT2) 0.20)(+ (cadr PT2) 0.0)))
    (setq TXT1 "FIRST LINE" TXT2 "SECOND LINE")
    (command "_qleader" PT1 PT2 PT3 TXT1 TXT2 "")
    (command "_ddedit" "_L" ""); wait on edit, exit..
    ..........
    You also could 'prompt' for TXT1 and TXT2..
    (setq TXT1 (getstring 1 "\n1st Line of Text:"))

    Bob
     
    ECCAD, Nov 12, 2004
    #3
  4. Thanks for the help guys.....
     
    Sunburned Surveyor, Nov 12, 2004
    #4
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.