New Territory (for me) - programming a button

Discussion in 'AutoCAD' started by Bill Allen, May 10, 2004.

  1. Bill Allen

    Bill Allen Guest

    I insert a certain block lots and lots of times.

    It's called "detbub" and it's a detail bubble. It has two attributes.

    I want to insert it, scale it to the current dimscale, don't ask me for a
    rotation, just give me command line prompts for the two attributes.

    I can *almost* do this with a script file (except the sizing part).

    Would someone tell me the steps for the whole procedure?

    I will understand if the consensus is RTFM.

    Thanks,

    Bill
     
    Bill Allen, May 10, 2004
    #1
  2. Bill Allen

    Rudy Tovar Guest

    (defun c:det (/)
    (command "insert" "<name_path_etc>" pause (getvar"dimscale") "" "" pause
    pause)
    (princ)
    )
     
    Rudy Tovar, May 10, 2004
    #2
  3. Bill Allen

    Bill Allen Guest

    Thanks, Rudy.

    I'm assuming this is a lisp routine.

    My next question is what do I do with it? Remember, I barely know how to
    create a new button.

    Thanks,

    Bill
     
    Bill Allen, May 11, 2004
    #3
  4. ^C^C^Pdet in the button detail should work (otherwise ^C^C^P(command
    "det"))

    Probably Overkill with the C's & P's...
     
    Thomas 'bacco|007' Baxter, May 11, 2004
    #4
  5. Bill Allen

    Larry Travis Guest

    Just put that code into a file with a .lsp extension and put the file in
    your acad search path. Then in the button properties enter the following
    for the macro:

    ^C^C(IF (not c:det)(load "det"));det;


    Hope this helps,
    LT
     
    Larry Travis, May 12, 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.