Insert Block

Discussion in 'AutoCAD' started by Tim Robben, Apr 28, 2005.

  1. Tim Robben

    Tim Robben Guest

    I have made a lisp and script like this:
    ---------------------------------
    Script: "O.scr"

    (if (not c:O) (load "O"))
    O
    ---------------------------------

    Lisp: "O.lsp"

    (defun C:O ()(command "insert" "O" pause "1" "1" "0"))

    ---------------------------------

    This script works, I have made a button in AutoCAD 2005 and the code for
    that button is:

    ^C^CSCRIPT;O

    ---------------------------------

    All this works fine,

    The only thing what I want to add, that it automaticly put it in the right
    layer, with the right color.

    The layer name has to be: "Banken en afvalbakken"
    The color has to be: red (1)

    Maybe if it is possible that at last the prompt shows: "U kunt nu de
    betreffende locatie aangeven".



    Hope somebody can handle this problem,

    Thanks for all reactions,

    T. Robben
     
    Tim Robben, Apr 28, 2005
    #1
  2. Before your command call to INSERT in your LISP, you need to add two others
    at least. One to set the current layer to the one you want, the other to set
    your current color. A better approach would be to add a few lines at first
    to save the current layer and color to a couple of variables, then do the
    work, then restore the layer and color to their original values.

    The prompt you want could be done with the PROMPT, PRINT, PRINTC, or ALERT
    calls.
     
    Michael Bulatovich, Apr 28, 2005
    #2
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.