strawberry
Usenet Archive
- Joined
- Jun 8, 2005
- Messages
- 204
- Reaction score
- 0
I think this will perform better...; ----- 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)
)
; ----- 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)
)