Tim Robben
Guest
|
Posted:
Thu Apr 28, 2005 8:10 am Post subject:
Insert Block |
|
|
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
|
|
Michael Bulatovich
Guest
|
Posted:
Thu Apr 28, 2005 4:10 pm Post subject:
Re: Insert Block |
|
|
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.
--
MichaelB
www.michaelbulatovich.ca
"Tim Robben" <timrobben@wanadoo.nl> wrote in message
news:42708b14$0$89829$dbd41001@news.wanadoo.nl...
| Quote: | 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
|
|
|