+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26
  1. #1
    Full Member
    Using
    AutoCAD 2009
    Join Date
    Aug 2011
    Posts
    45

    Default Need Lisp : create rectangle between rectangle

    Registered forum members do not see this ad.


    Need lisp for create rectangle (red colour) between rectangle (black colour)

  2. #2
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,951

    Default

    Consider the Offset, and the Trim & Pedit, or the Pedit Commands.
    "Potential has a shelf life." - Margaret Atwood

  3. #3
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,791

    Default

    Another way with lisp pick two diag corners xoff yoff can be different draws new rectang. 3pt answer if rectang on angle.

    I would go 3pt you can bet if you make it square only you need an angle version.
    A man who never made mistakes never made anything

  4. #4
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    169

    Default

    Git_thailand, please re-read all off topic that you have posted. Please give more detail for what you want.

  5. #5
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,106

    Default

    Quote Originally Posted by git_thailand View Post
    Need lisp for create rectangle (red colour) between rectangle (black colour)
    Looks easy enough. The only existing entiy is the black pline? and youre wanting to create 5 more? or just 4 not including the inner rectangle?

  6. #6
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,631

    Default

    Quote Originally Posted by pBe View Post
    and youre wanting to create 5 more? or just 4 not including the inner rectangle?
    I guess there are only two , aren't they ?
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  7. #7
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,106

    Default

    Quote Originally Posted by Tharwat View Post
    I guess there are only two , aren't they ?
    Oh yeah. ... but it could also be four depending on how you see it. 5 even if you include the middle one as a separate entity.

    Oh well....

    Code:
    (defun c:BeatBox (/ _HiLow _Box _trans rec pts low high)
      (defun _HiLow (lev lst)
        (list
          (apply lev (mapcar 'car lst))
          (apply lev (mapcar 'cadr lst))
        )
      )
      (defun _Box (p1 p2)
        (command "_rectang" "_non" p1 "_non" p2)
      )
      (setq _trans (lambda (pt) (trans pt 0 1)))
      (if (and
        (setq dist (cond
                        (   (getdist
                                (strcat "\nOffset Distance"
                                    (if dist (strcat " <" (rtos dist) ">: ") ": ")
                                )
                            )
                        )
                        (   dist   )
                    )
                )
        (setq rec (ssget 
           '((0 . "LWPOLYLINE") (-4 . "&=") (70 . 1))
           )
        ))
        (progn
        (repeat  (setq i (sslength rec))
        (setq pts (mapcar 'cdr
            (vl-remove-if-not
              '(lambda (j)
          (= (car j) 10)
        )
              (entget (setq e (ssname rec (setq i (1- i)))))
            )
           )
       pts (mapcar '_trans pts)
        )
        (setq Low  (_HiLow 'min pts)
       High (_HiLow 'max pts)
        )
      (_Box (list (car low) (+ (cadr low) dist))
            (list (car high) (- (cadr high) dist))
      )
      (_Box (list (+ (car low) dist) (cadr low))
            (list (- (car high) dist) (cadr high))
      )
     )
          )
      )
    )
    HTH
    UPDATED:
    Last edited by pBe; 20th Apr 2012 at 01:51 pm. Reason: Updated for Multiple objects

  8. #8
    Full Member
    Using
    AutoCAD 2009
    Join Date
    Aug 2011
    Posts
    45

    Default

    create rectangle between two rectangle

    before.jpgafter.jpg

  9. #9
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,138

    Default

    You really need a lisp routine to do this? Really??
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  10. #10
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,106

    Default

    Registered forum members do not see this ad.

    create rectangle between two rectangle
    Geez. I was right the first time. It is indeed 4.

    But then again...

    You really need a lisp routine to do this? Really??
    I am wondering myself.

Similar Threads

  1. LISP for a rectangle inside a rectangle
    By Grigs in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 5th Mar 2012, 07:11 pm
  2. select block or rectangle to create namedview
    By pmxcad in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 12th Feb 2012, 07:35 pm
  3. Lisp for rectangle
    By RRS1987 in forum AutoLISP, Visual LISP & DCL
    Replies: 43
    Last Post: 27th Oct 2011, 02:23 pm
  4. Replies: 2
    Last Post: 4th Oct 2010, 12:16 pm
  5. Create a Rectangle around Text
    By Zeusovsky in forum .NET, ObjectARX & VBA
    Replies: 3
    Last Post: 17th Aug 2010, 09:37 am

Bookmarks

Posting Permissions

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