CAD Forum ► EN ► AutoCAD ► Lisp for creating rectangle make a chamfer and ext
Display full version of the post: Lisp for creating rectangle make a chamfer and ext
Bogart07
11.02.2016, 15:35
Hi Guys,I need help for my lisp. Can someone help me? I just want to create a LISP that will create a rectangle after that adding chamfer on two sides and extrude it. Thanks in advance guys!
John Connor
11.02.2016, 17:33
You might want to tell us how you are going to size the rectangle.Is it a fixed size?Or will two diagonal corners be picked on screen?Or will the user be prompted to enter the size manually?Will the height be fixed or will the user be prompted to enter the height?What two sides will be chamfered and how will they be selected?Will this all be done on the current layer or will a new layer have to be created first?
Bogart07
12.02.2016, 08:24
(defun c:qwe (/ p1 p2 p3 p4 d1) (setq p1 (getpoint "\nEnter first corner of rectangle : ")) (setq p3 (getpoint "\nEnter Second corner of rectangle : "))(setq chamfera (getdist "\nEnter Chamfer Distance : "))(setq chamferb (getdist "\nEnter Chamfer Distance2 : ")) (setq p2 (list (car p1)(cadr p3)))(setq p4 (list (car p3)(cadr p1))) (command "pline" p1 p2 p3 p4 "c")(command "_.chamfer" chamfera chamferb)) (princ) I'm trying to use this. this will create your rectangle. i'm a beginner in lisp that's why I'm trying to create my own. Thanks in advance for your help.
John Connor
16.02.2016, 11:20
Thank you for answering all my questions.