Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone, I'm in trouble again
This LISP is a square made of two triangles
Can achieve the effect of drawing two points into a rectangle
But the rectangle is not in the positive direction
Can this LISP be changed to a rectangle in the positive direction?
Above the photo is the LISP effect
I want the effect of red below
(defun :GR (a) (* pi (/ a 180.0)))
(defun C:SQR ( / ANG12 ANG1X ANG2X P1 P2 PXL PXR)
(setq p1 (getpoint "\nfirst point :"))
(setq p2 (getpoint p1 "\nsecond point :"))
(setq ang12 (angle p1 p2)
ang2x (+ ang12 (:GR 45.0))
ang1x (+ ang12 (:GR 135.0))
)
(setq pxl (inters p2 (polar p2 ang2x 1.0) p1 (polar p1 ang1x 1.0) nil))
(setq pxr (inters p1 (polar p1 (+ ang2x pi) 1.0) p2 (polar p2 (+ ang1x pi) 1.0) nil))
(vl-cmdf "line" p1 p2 "")
(vl-cmdf "pline" p1 pxr p2 pxl p1 "")
)
Solved! Go to Solution.