Print Page | Close Window

Lisp for creating rectangle make a chamfer and ext

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=11636
Printed Date: 20.Apr.2026 at 20:17


Topic: Lisp for creating rectangle make a chamfer and ext
Posted By: Bogart07
Subject: Lisp for creating rectangle make a chamfer and ext
Date Posted: 11.Feb.2016 at 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!





Replies:
Posted By: John Connor
Date Posted: 11.Feb.2016 at 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?


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Bogart07
Date Posted: 12.Feb.2016 at 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.



Posted By: John Connor
Date Posted: 16.Feb.2016 at 11:20
Thank you for answering all my questions.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>




Print Page | Close Window