known SY

; ----- SQUARETEST.LSP -----
; Draw rectangles by area

(defun C:SQUARETEST

; Degrees to Radians
(defun dtr (a)(* pi (/ a 180)) )

; Get area in square yards
(setq ar (getreal "AreaSY? "))

; Convert to square inches
(setq ar (* ar 1296))

; Get first point (bottom left-hand corner of square)
(setq p1 (getpoint "\nfirst corner of square: "))

; Calculate second point (top right-hand corner of square) (setq p2 (polar p1 (dtr 45.0) (sqrt (+ ar ar))))

; Execute
(command "rectangle" p1 p2)

; Exit quietly
(princ)
)
I think this will perform better...
; ----- SQUARETEST.LSP -----
; Draw squares by area

(defun C:SQUARETEST

; Degrees to Radians
(defun dtr (a)(* pi (/ a 180.0)) )

; Get area in square yards
(setq ar (getreal "AreaSY? "))

; Convert to square inches
(setq ar (* ar 1296))

; Get first point (bottom left-hand corner of square)
(setq p1 (getpoint "\nfirst corner of square: "))

; Calculate second point (top right-hand corner of square) (setq p2 (polar p1 (dtr 45.0) (sqrt (+ ar ar))))

; Execute
(command "rectangle" p1 p2)

; Exit quietly
(princ)
)
 
Strawberry,
That did the trick! Thanks for sticking with me on this. I remember a guy named Dennis that used to be on this group all the time. He helped me a lot over the years. I took several years off from using cad and when I started using it again, I found out that Dennis no longer was on this group. Also, I see there is less traffic on this group than it used to be years ago. Thanks again for all your help.

Sincerely,
John P. Callaway
 

Latest threads

Back
Top