can any one please make me a lisp to draw a rectangle.....i also want it to prompt me for length and width....and then extrude it and prompt me for a depth depth....
please respond to my e-mail
rico72dominguez@aol.com
|
can any one please make me a lisp to draw a rectangle.....i also want it to prompt me for length and width....and then extrude it and prompt me for a depth depth....
please respond to my e-mail
rico72dominguez@aol.com
Code:(defun c:DrawExtRec () (command "_.rectangle" pause (strcat "@" (rtos (getdist "\n Length of rectange (x direction): ") 2 6) "," (rtos (getdist "\n Width of rectange (y direction): ") 2 6) ) "_.extrude" (entlast) "" (getdist "\n Thickness of rectangle: ") 0 ) (princ) )
or...> 3dr <
Code:(defun c:3dr (/ l w d ip) (setq l (getdist "\n Length?: ") w (getdist "\n Width?: ") d (getdist "\n Depth?: ") ip (getpoint "\n Insert: ")) (command "_.box" ip "l" l w d) (princ))
Last edited by paulmcz; 2006-06-12 at 02:16 PM.
Do you need AutoCad 2007 to get the box command?
I have it
Just AutoCAD, any version. It is built-in command.Originally Posted by Robert.Hall
you guys are awesome they work great
I prefer to keep all help here. In an email sent to me
You would do it like thisCode:how do i get your lisf file to default to 2.5 in the y and extrude to 3.5 automatically and then prompt the align after it draws the box?? thanks for your help (defun c:DrawExtRec () (command "_.rectangle" pause (strcat "@" (rtos (getdist " Length of rectange (x direction): ") 2 6) "," (rtos (getdist " Width of rectange (y direction): ") 2 6) ) "_.extrude" (entlast) "" (getdist " Thickness of rectangle: ") 0 ) (princ) )
Now for the align part, I'm not sure. I don't use the command, so maybe someone can help with that.Code:(defun c:DrawExtRec () (command "_.rectangle" pause (strcat "@" (rtos (getdist "\n Length of rectange (x direction): ") 2 6) "," (if (not (setq tmpDist (getdist \n Length of rectange (y direction) <2.5>: ))) "2.5" (rtos tmpDist 2 6) ) ) "_.extrude" (entlast) "" 3.5 0 ) (princ) )
tim
i keep getting an the following
error: no function definition: Y
Sorry about that. I forgot to add quotes around the question to getdist. This works for me now.
Code:(defun c:DrawExtRec (/ tmpDist) (command "_.rectangle" pause (strcat "@" (rtos (getdist "\n Length of rectange (x direction): ") 2 6) "," (if (not (setq tmpDist (getdist "\n Length of rectange (y direction) <2.5>: "))) "2.5" (rtos tmpDist 2 6) ) ) "_.extrude" (entlast) "" 3.5 0 ) (princ) )
tim
thanks that works great