lisp routine prompts

lisp routine prompts

Anonymous
Not applicable
668 Views
25 Replies
Message 1 of 26

lisp routine prompts

Anonymous
Not applicable
i have a lisp routine for the wipe out command, it reads like this: (defun c:WI () (command "-layer" "new" "wipeout" "color" "255" "wipeout" "set" "wipeout" "")(command "rectangle" pause pause)(command "WIPEOUT" "polyline" "last" "yes")(command "draworder" "crossing" pause pause "" "f"))

what i need is to put some prompts in here, after it creates the layer, and begins the rectangle command i want it to say "specify fist corner of wipeout" then "specify second corner of wipeout", then when it starts the draw order command i want it to say "select objects to move to front"

i've never had to put in prompts before but I'd like to start, i just need one example to go off of, or at least some direction

thanks in advance for all you help/comments
kenny
0 Likes
669 Views
25 Replies
Replies (25)
Message 21 of 26

Anonymous
Not applicable
Try commenting out these (temporarily),...
;;;(command "WIPEOUT" "n" "last" "yes")
;;;(command "draworder" "crossing" pause pause "" "f")
.... to see if it draws the rectangle..

Bob
0 Likes
Message 22 of 26

Anonymous
Not applicable
OK, I just tested this in R2006.....

(defun c:WI (/ pt1 pt2)
(setq echo (getvar "cmdecho")
clay (getvar "clayer"))
(setvar "cmdecho" 0)
(if (tblsearch "layer" "wipeout")
(setvar "clayer" "wipeout")
(command "-layer" "new" "wipeout" "color" "255" "wipeout" "set"
"wipeout" "")
)
(Setq Pt1 (Getpoint "\nPick first point: "))
(Setq Pt2 (getcorner pt1 "\nPick second point: "))
(command "rectangle" PT1 PT2)
(command "WIPEOUT" "p" "last" "yes");change the "p" to "n" for versions
<2004
(setvar "cmdecho" 1)
(command "draworder" "crossing" pause pause "" "f")
(setvar "clayer" clay)
(setvar "cmdecho" echo)
(princ)
)
wrote in message news:5079666@discussion.autodesk.com...
acad 2004

it seems like it's not drawing the rectangle
0 Likes
Message 23 of 26

Anonymous
Not applicable
this variation seems to work well:

(defun c:WI ()
(command "-layer" "M" "wipeout" "color" "255" "wipeout" ""); Make / Set Layer
(Setq Pt1 (Getpoint "\nPick first point"))
(Setq Pt2 (getcorner Pt1 "\nPick second point"))
(setq Pt3 (list (car Pt2)(cadr Pt1) 0.0))
(setq Pt4 (list (car Pt1)(cadr Pt2) 0.0))
(command "_Pline" Pt1 Pt3 Pt2 Pt4 "_C")
(command "WIPEOUT" "polyline" "last" "yes")
(command "draworder" "crossing" pause pause "" "f")
); function

compliments of bob

but it also needs to say "select objects to bring foward" after the word crossing in the draw order command.

thanks again
0 Likes
Message 24 of 26

Anonymous
Not applicable
THAT'S PERFECT!!!!!!!!!!!

CAN'T THANK YOU ENOUGH!!!!!!
0 Likes
Message 25 of 26

Anonymous
Not applicable
You should have seen the rectangle.

Getcorner is made for this.

Did you put p1 in the getcorner function?

Bill
0 Likes
Message 26 of 26

Anonymous
Not applicable
Add this:
(prompt "\nselect objects to bring foward")
.. just prior to:
(command "draworder" "crossing" pause pause "" "f")
.. should do it.

Bob
0 Likes