Angled rectangle

Angled rectangle

Anonymous
Not applicable
945 Views
3 Replies
Message 1 of 4

Angled rectangle

Anonymous
Not applicable

I would like to draw a rectangle by picking 3 points. The rectangle is never orientated to the UCS.

 

The first two points determine an edge of the rectangle.

 

The third point is the parallel offset distance. (The other side of the rectangle).

 

Then two lines are automatically drawn joining the ends of the above two lines, forming a rectangle.

 

Thanks in advance.

 

Paul.

0 Likes
Accepted solutions (1)
946 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

Sounds like a job for Offset's Through option.  Something like this, perhaps?

(defun C:REC3 (/ 1data 2data)

  (command "_.line" pause pause "")

  (setq 1data (entget (entlast)))

  (command "_.offset" "_through" (entlast) pause "")

  (setq 2data (entget (entlast)))

  (command

    "_.line" (cdr (assoc 10 1data)) (cdr (assoc 10 2data)) ""

    "_.line" (cdr (assoc 11 1data)) (cdr (assoc 11 2data)) ""

  ); command

); defun

 

As usual, enhancements are possible [even desirable], but it works in its simple way.  Turn the pauses into (getpoint) functions with appropriate prompts, if you like.

Kent Cooper, AIA
0 Likes
Message 3 of 4

marko_ribar
Advisor
Advisor

My version :
http://www.theswamp.org/index.php?topic=12813.msg527277#msg527277
(You have to have www.theswamp.org membership and to be logged to download lisp)

Another one by Lee Mac :
http://www.lee-mac.com/3pointrectangle.html

M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 4 of 4

Anonymous
Not applicable

Works perfectly, thank you...

0 Likes