known SY

Discussion in 'AutoCAD' started by John Callaway, Sep 4, 2009.

  1. John Callaway

    strawberry Guest

    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, Sep 9, 2009
    #21
  2. 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
     
    John Callaway, Sep 9, 2009
    #22
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.