lisp insert command (scaling)

Discussion in 'AutoCAD' started by maryam, Jul 8, 2004.

  1. maryam

    maryam Guest

    Hi
    I have a lisp file that is supposed to insert a block in to the drawing.


    (progn
    (prompt "\nBlock insert < ")
    (prompt bname)
    (prompt ">")
    (command "insert" bname pause bscale bscale pause)
    (princ)
    )


    can someone please define what each elements does in this command ?
    (command "insert" bname pause bscale bscale pause)
    (princ)

    I don't understand the function of pause here as well as bscale. according to the definition in the file bscale is the insertion scale for blocks in imperial or metric.!
     
    maryam, Jul 8, 2004
    #1
  2. maryam

    T.Willey Guest

    (command "insert" <- insert command
    bname <- variable holding the name of the block
    pause <- pause used to wait for user input, here it's waiting for the insert point
    bscale <- variable holding the scale factor, this one is for the x direction
    bscale <- variable holding the scale factor, this one is for the y direction
    pause) <- this pause is waiting for a rotation angle

    Hope this helps
    Tim
     
    T.Willey, Jul 8, 2004
    #2
  3. maryam

    zeha Guest

    In case the code
    this is equivalent ecxept that the block drags to the propriate scale


    (progn
    (prompt "\nBlock insert < ")
    (prompt bname)
    (prompt ">")
    (command "insert" "scale" bscale)
    (princ)
    )


    cheers
     
    zeha, Jul 9, 2004
    #3
  4. maryam

    maryam Guest

    thanks everyone. the problem with the code is that when the user clicks the insert point nothing happens. The object does not get inserted. the program asks for another user input......and it goes on.

    any idea why this happens?
     
    maryam, Jul 12, 2004
    #4
  5. maryam

    T.Willey Guest

    The last "pause" is waiting for the rotation angle from the insert point. If you want a "0" rotation angle put and enter in there ("") and it should work.
    change to
    (command "insert" bname pause bscale bscale "")

    Tim
     
    T.Willey, Jul 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.