Insert Block
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Insert Block

 
Post new topic   Reply to topic    CADForums.net Forum Index -> AutoCAD
Author Message
Tim Robben
Guest





Posted: Thu Apr 28, 2005 8:10 am    Post subject: Insert Block Reply with 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

Back to top
Michael Bulatovich
Guest





Posted: Thu Apr 28, 2005 4:10 pm    Post subject: Re: Insert Block Reply with quote

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

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> AutoCAD All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB