tuantrinhdp Posted September 19, 2021 Posted September 19, 2021 Hello everyone. I have 3 points and i want to draw rectangle, can you help me get lisp ? draw house.dwg Quote
eldon Posted September 19, 2021 Posted September 19, 2021 Perhaps you can help yourself by searching. Hint - look at Lee Mac's web site. Quote
eldon Posted September 19, 2021 Posted September 19, 2021 I see there are at least two solutions to your example. Which one do you want? It might be more simple to draw the rectangle yourself. Quote
Grrr Posted September 19, 2021 Posted September 19, 2021 I've ended up drawing a rhomboid, not sure if thats desired but sharing the code anyways - ; Draws rhomboid by specifying 3 points (defun C:test ( / p1 p2 p3 p4 ) (and (setq p1 (getpoint "\nSpecify first point: ")) (setq p2 (getpoint "\nSpecify second point: " p1)) (progn (grdraw p1 p2 1) t) (setq p3 (getpoint "\nSpecify third point: " p2)) (progn (grdraw p2 p3 1) t) (setq p4 (inters p1 (mapcar '+ p1 (mapcar '- p2 p3)) p3 (mapcar '+ p3 (mapcar '- p2 p1)) nil ) ); setq p4 (entmakex (append '((0 . "LWPOLYLINE")(100 . "AcDbEntity")(100 . "AcDbPolyline")(90 . 4)(70 . 1)) (mapcar (function (lambda (p) (cons 10 p))) (list p1 p2 p3 p4)) ) ) ) (redraw) (princ) ); defun 1 Quote
tombu Posted September 19, 2021 Posted September 19, 2021 Using Civil 3D field codes 2 points and an offset distance is all you'd need. https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=GUID-59F46AEC-0E42-4F98-A257-F864C31F0E37 To draw a Rectangle using 3 points try Lee Mac's 3-Point Rectangle lisp http://www.lee-mac.com/3pointrectangle.html 1 Quote
tuantrinhdp Posted September 20, 2021 Author Posted September 20, 2021 (edited) 11 hours ago, eldon said: I see there are at least two solutions to your example. Which one do you want? It might be more simple to draw the rectangle yourself. Any solution is fine ^^ I've found lisp Lee-Mac. Thank you ^^ Edited September 20, 2021 by tuantrinhdp Quote
tuantrinhdp Posted September 20, 2021 Author Posted September 20, 2021 12 hours ago, eldon said: Perhaps you can help yourself by searching. Hint - look at Lee Mac's web site. Wow, thank for your help. I will use lisp Lee-Mac. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.