Results 1 to 3 of 3

Thread: Lisp for rectangle

  1. #1
    Member
    Join Date
    2011-10
    Posts
    3
    Login to Give a bone
    0

    Unhappy Lisp for rectangle

    Dear All,
    I need Lisp to draw rectangle. I want to give only 4 inputs to draw rectangle as per attached file.
    These are the inputs following,
    1) P1 Center point of one side.
    2) P2 Center point of another side.
    3) P3 Opposing width of rectangle.
    4) P4 Offset width from reference line to sides(P1&P2).
    I am waiting for your assistance.
    Please refer the attached file.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp for rectangle

    What was your opinion for this post .????

    http://forums.augi.com/showthread.php?t=133903

  3. #3
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp for rectangle

    a crude way


    Code:
    (setq osmode (getvar 'osmode))
    (setvar 'osmode 0)
    (setq orthomode (getvar 'orthomode))
    (setvar 'orthomode 1)
    
    
    (setq p1 (getpoint "select the point1"))
    
    (setq p2 (getpoint p1 "select the other point"))
    
    (setq p3 (getdist "select the distance  "))
    
    (setq p4 (getdist p2 "select the offset"))
    
    
    (setq q1 (polar p1 (/ pi 2) p4))
    
    (setq p1-p2 (distance p1 p2))
    
    (setq q2 (polar q1 ( * pi 1.5) (+ p4 p4  p1-p2   )))
    
    (setq q1-q2 (distance q1 q2))
    
    (setq a1 (polar q2 pi (/ p3 2)))
    (setq a2 (polar a1 (/ pi 2) q1-q2))
    (setq a3 (polar a2 0 p3))
    (setq a4 (polar a1 0 p3))
    
    (command "_pline" a1 a2 a3 a4 "C")

Similar Threads

  1. Isometric Rectangle
    By Mike.Pearce179044 in forum AutoCAD General
    Replies: 2
    Last Post: 2011-10-05, 02:58 PM
  2. Rectangle
    By sandrews.253556 in forum Dynamic Blocks - Sharing
    Replies: 0
    Last Post: 2010-07-28, 04:01 PM
  3. Replies: 3
    Last Post: 2009-04-15, 07:30 PM
  4. LISP to calculate area of rectangle
    By Rynakor in forum AutoLISP
    Replies: 13
    Last Post: 2006-06-20, 01:15 PM
  5. Bend a 3D Rectangle
    By jacobharasimo in forum AutoCAD 3D (2006 or below)
    Replies: 11
    Last Post: 2005-11-18, 07:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •