<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get bounding box in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11790098#M33728</link>
    <description>&lt;P&gt;&lt;STRIKE&gt;&lt;FONT color="#999999"&gt;You can at least get very close with SmallestRectangle.lsp, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/the-smallest-rectangle-enclosing-selected-set-of-objects/m-p/3795624/highlight/true#M309506" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&amp;nbsp; It goes in 1° increments of rotation, but you can reduce that.&amp;nbsp; But it won't give you precisely the outline you want unless the original's angles fall on one of the rotational increments.&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;EDIT:&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt; Never mind that -- see Message 5.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 14:42:13 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2023-03-01T14:42:13Z</dc:date>
    <item>
      <title>How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789640#M33725</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;How can I get bounding box of such rotated polyline in below posted snapshot to get the red polyline ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BB.PNG" style="width: 434px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1182921iCBA30E690B4B6556/image-size/large?v=v2&amp;amp;px=999" role="button" title="BB.PNG" alt="BB.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 08:51:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789640#M33725</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2023-03-01T08:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789698#M33726</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you can define some roles to rotate this figure to align with wcs then you can use (vla-getboundingbox)&lt;/P&gt;&lt;P&gt;I would try to find the&amp;nbsp;&lt;SPAN&gt;dominant&lt;/SPAN&gt; vertex (who's angle appears the most).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 09:28:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789698#M33726</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-01T09:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789704#M33727</link>
      <description>&lt;P&gt;Maybe try&amp;nbsp;&lt;A href="http://www.lee-mac.com/minboundingbox.html" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But agree with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;t&lt;SPAN&gt;hat it might be advantageous to follow the angle of the longest segment or sum of lengths.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 09:35:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11789704#M33727</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-03-01T09:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11790098#M33728</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;&lt;FONT color="#999999"&gt;You can at least get very close with SmallestRectangle.lsp, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/the-smallest-rectangle-enclosing-selected-set-of-objects/m-p/3795624/highlight/true#M309506" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&amp;nbsp; It goes in 1° increments of rotation, but you can reduce that.&amp;nbsp; But it won't give you precisely the outline you want unless the original's angles fall on one of the rotational increments.&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;EDIT:&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt; Never mind that -- see Message 5.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 14:42:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11790098#M33728</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-01T14:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11790107#M33729</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1677673852928.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1183013iD558E569353D63E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1677673852928.png" alt="Kent1Cooper_0-1677673852928.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With OFFSETGAPTYPE set to zero, Offset the original [white] outboard by a large distance relative to the size of the undulations.&amp;nbsp; [In this case, the Offset distance is the shorter dimension of the enclosing rectangle.]&amp;nbsp; That outward Offset gives the red result, which kills all the undulations.&amp;nbsp; Offset that back inward by the same distance to get the yellow result.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 14:41:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11790107#M33729</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-01T14:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791056#M33730</link>
      <description>&lt;P&gt;Thank you all for your kind and quick replies.&lt;/P&gt;&lt;P&gt;I was thinking the same to rotate the polyline from the longest segment and this will take more codes from me to get that working but this deserves a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kent, your offset idea seems good but I got the curves offset as well even with system variable set to zero and not like your example in snapshot.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 17:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791056#M33730</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2023-03-01T17:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791078#M33731</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;.... your offset idea seems good but I got the curves offset as well even with system variable set to zero ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That must mean, I think, that your original has slightly rounded corners.&amp;nbsp; Does it work if you do Fillet, Radius zero, Polyline option on it first?&amp;nbsp; If the corners are rounded with a single arc segment at each, that would square them off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An actual drawing file with some real-life examples may be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking of setting the UCS to align with the Polyline under the Object option, then getting its bounding box, but I find the bounding box is returned in WCS values, even when in a different UCS.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 18:06:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791078#M33731</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-01T18:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791268#M33732</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check this command PBND - works?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thank you Lee Mac for this (LM:ListDupes) function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;; List Duplicates  -  Lee Mac
;; Returns a list of items appearing more than once in a supplied list

(defun LM:ListDupes ( l )
    (if l
        (if (member (car l) (cdr l))
            (cons (car l) (LM:ListDupes (vl-remove (car l) (cdr l))))
            (LM:ListDupes (vl-remove (car l) (cdr l)))
        )
    )
)


(vl-load-com)

;; draw the boundary of zigzag pline based on angles
(defun c:pbnd (/ vertices angle_list _dtr _wcs2ucs
	         ss points^ angles^ AcDbPline p0 p1)

  
 ; return pline points 
 (defun vertices (ent)
  (vl-remove-if
   'not
   (mapcar
    '(lambda (itm)
      (if (= (car itm) 10) 
       (cdr itm)
      )
     ); lambda
    (entget ent)	    
   ); mapcar
  ); vl-remove-if
 ); vertices 


 (defun angle_list (lst / qang)

  (defun qang (a)
   (angtos 
    (if (and (&amp;gt;= a (* pi 0.5)) (&amp;lt; a (* pi 1.5)))
     a 
     (+ a pi)
    )
   0 4) 
  ); qang
   
  (mapcar
   (function
     (lambda (t0 t1)
      (atof (qang (angle t0 t1)))
     )
   )
   lst (append (cdr lst) (list (car lst)))
  )
 ); angle_list

 ; anonymous functions
 (setq _dtr (lambda (a) (* (/ a 360.0) 2 pi)))
 (setq _wcs2ucs (lambda (p) (trans p 0 1)))

  
 ; here start c:pbnd 
 (setvar "cmdecho" 0)
 (command "._undo" "_begin")
  
 (if (setq ss (ssget '((0 . "lwpolyline,polyline") (70 . 129))))
  (progn
   (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
    (setq points^ (vertices ename))
    (setq angles^ (vl-sort (LM:ListDupes (angle_list points^)) '&amp;gt;))

    (setq AcDbPline (vla-copy (vlax-ename-&amp;gt;vla-object ename)))
    (vla-rotate AcDbPline (vlax-3d-point '(0.0 0.0 0.0)) (- (* pi 2) (+ (_dtr (car angles^)) pi)))
    (vla-getBoundingBox AcDbPline 'p0 'p1)
    (vla-delete AcDbPline)
    (vlax-release-object AcDbPline)
     
    (command "._rectangle" (_wcs2ucs (vlax-safearray-&amp;gt;list p0)) (_wcs2ucs (vlax-safearray-&amp;gt;list p1)))
    (vla-rotate (vlax-ename-&amp;gt;vla-object (entlast)) (vlax-3d-point '(0.0 0.0 0.0)) (+ (_dtr (car angles^)) pi))
   ); foreach
  ); progn
 ); if


 (command "._undo" "_end") 
 (setvar "cmdecho" 1) 
  
 (princ)
); c:pbnd
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 19:34:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11791268#M33732</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-01T19:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792469#M33733</link>
      <description>&lt;P&gt;Sorry, I did not mean by curves rounded but sharp angles, the fillet did not solve / fix the polyline to work around it with offset as suggested earlier by you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did also thought about changing the UCS but that is what I have not worked with before.&lt;/P&gt;&lt;P&gt;Please find an example drawing in this post below.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 08:34:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792469#M33733</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2023-03-02T08:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792476#M33734</link>
      <description>&lt;P&gt;Thank you, that did not work at all and just drawn square box.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JRocks_0-1677746182440.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1183503iAA914AB7BC1DD02F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JRocks_0-1677746182440.png" alt="JRocks_0-1677746182440.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 08:36:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792476#M33734</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2023-03-02T08:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792541#M33735</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;post a sample dwg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 09:07:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792541#M33735</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-02T09:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792741#M33736</link>
      <description>&lt;P&gt;yes i see the issue working on it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 10:41:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11792741#M33736</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-02T10:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793010#M33737</link>
      <description>&lt;P&gt;Offsetting outward and then back inward, by the distance across the end of the overall shape, worked for me in your sample drawing.&amp;nbsp; Even though in this particular configuration the outward Offset included a bump in the left end [green]:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1677760660988.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1183595iD2B4048F8B975971/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1677760660988.png" alt="Kent1Cooper_0-1677760660988.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;still, Offsetting back inward removed that, and gave the red result.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 12:38:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793010#M33737</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-02T12:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793098#M33738</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok fixed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;; Count Items  -  Lee Mac
;; Returns a list of dotted pairs detailing the number of
;; occurrences of each item in a supplied list.

(defun LM:CountItems ( l / c x )
    (if (setq x (car l))
        (progn
            (setq c (length l)
                  l (vl-remove x (cdr l))
            )
            (cons (cons x (- c (length l))) (LM:CountItems l))
        )
    )
)


(vl-load-com)

;; draw the boundary of zigzag pline based on angles
(defun c:pbnd (/ vertices angle_list _dtr _wcs2ucs
	         ss points^ angles^ AcDbPline p0 p1)

  
 ; return pline points 
 (defun vertices (ent)
  (vl-remove-if
   'not
   (mapcar
    '(lambda (itm)
      (if (= (car itm) 10) 
       (cdr itm)
      )
     ); lambda
    (entget ent)	    
   ); mapcar
  ); vl-remove-if
 ); vertices 


 (defun angle_list (lst / qang)

  (defun qang (a)
   (angtos 
    (if (and (&amp;gt;= a (* pi 0.5)) (&amp;lt; a (* pi 1.5)))
     a 
     (+ a pi)
    )
   0 4) 
  ); qang
   
  (mapcar
   (function
     (lambda (t0 t1)
      (atof (qang (angle t0 t1)))
     )
   )
   lst (append (cdr lst) (list (car lst)))
  )
 ); angle_list

 ; anonymous functions
 (setq _dtr (lambda (a) (* (/ a 360.0) 2 pi)))
 (setq _wcs2ucs (lambda (p) (trans p 0 1)))

  
 ; here start c:pbnd 
 (setvar "cmdecho" 0)
 (command "._undo" "_begin")
  
 (if (setq ss (ssget '((0 . "lwpolyline,polyline"))))
  (progn
   (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
    (setq points^ (vertices ename))
    (setq angles^ (vl-sort (LM:CountItems (angle_list points^)) '(lambda (e0 e1) (&amp;gt; (cdr e0) (cdr e1)))))
     
    (setq AcDbPline (vla-copy (vlax-ename-&amp;gt;vla-object ename)))
    (vla-rotate AcDbPline (vlax-3d-point '(0.0 0.0 0.0)) (- (* pi 2) (+ (_dtr (caar angles^)) pi)))
    (vla-getBoundingBox AcDbPline 'p0 'p1)
    (vla-delete AcDbPline)
    (vlax-release-object AcDbPline)
     
    (command "._rectangle" (_wcs2ucs (vlax-safearray-&amp;gt;list p0)) (_wcs2ucs (vlax-safearray-&amp;gt;list p1)))
    (vla-rotate (vlax-ename-&amp;gt;vla-object (entlast)) (vlax-3d-point '(0.0 0.0 0.0)) (+ (_dtr (caar angles^)) pi))
   ); foreach
  ); progn
 ); if


 (command "._undo" "_end") 
 (setvar "cmdecho" 1) 
  
 (princ)
); c:pbnd&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Mar 2023 13:01:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793098#M33738</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-02T13:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793236#M33739</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Offsetting outward and then back inward, by the distance across the end of the overall shape, worked for me in your sample drawing.&amp;nbsp; ...&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which can be automated in a fairly short routine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(vl-load-com)
(defun C:CURE (/ sel rec UR start temp) ; = Clean Up Rectangle Edges
  (if
    (and
      (setq sel (entsel "\nRectangle to Clean Up: "))
      (wcmatch (cdr (assoc 0 (entget (setq rec (car sel))))) "*POLY*")
    ); and
    (progn ; then
      (vla-getboundingbox (vlax-ename-&amp;gt;vla-object rec) 'minpt 'maxpt)
      (command "_.offset"
        (apply 'min (cdr (reverse (mapcar '- (setq UR (vlax-safearray-&amp;gt;list maxpt)) (vlax-safearray-&amp;gt;list minpt)))))
          ;; lesser XY dimension of bounding box for Offset distance
        (setq start (vlax-curve-getStartPoint rec))
        (polar UR 0 1); guaranteed outboard
        ""
      ); command
      (setq temp (entlast))
      (command
        "_.zoom" "_object" temp "" ; [pick point must be visible on-screen]
        "_.offset" "" (vlax-curve-getStartPoint temp) start ""
        "_.zoom" "_previous"
      ); command
      (entdel temp)
      (entdel rec) ;;;;; OR NOT, if you want it to remain
    ); progn
  ); if
  (prin1)
); defun&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[It doesn't actually use the dimension across the end of the shape after all, but an easier-to-determine dimension that has the same effect.]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could use some of the usual enhancements.&amp;nbsp; It doesn't check that the Polyline is of the right kind of configuration, or closed, or on an unlocked Layer, etc. -- it's up to you to choose appropriate objects.&amp;nbsp; [Some of those things can be checked easily enough, but the configuration type would be a real challenge, if even possible.]&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793236#M33739</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-03-02T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793347#M33740</link>
      <description>&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;if that routine has to deal with singular convex pline only as shown at first picture, then that code may be of help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:pline_bounding_box (/ pline_ename vertex_list leftmost_vertex topmost_vertex rightmost_vertex bottommost_vertex bounding_box_pline)
	(setq pline_ename (car (entsel))
		  vertex_list (mapcar 'cdr (vl-remove-if-not '(lambda (group) (= 10 (car group))) (entget pline_ename)))
		  leftmost_vertex (car (vl-sort vertex_list '(lambda (vertex_1 vertex_2) (&amp;lt; (car vertex_1) (car vertex_2)))))
		  topmost_vertex (car (vl-sort vertex_list '(lambda (vertex_1 vertex_2) (&amp;gt; (cadr vertex_1) (cadr vertex_2)))))
		  rightmost_vertex (car (vl-sort vertex_list '(lambda (vertex_1 vertex_2) (&amp;gt; (car vertex_1) (car vertex_2)))))
		  bottommost_vertex (car (vl-sort vertex_list '(lambda (vertex_1 vertex_2) (&amp;lt; (cadr vertex_1) (cadr vertex_2)))))
	)
	(vla-put-color
		(setq bounding_box_pline (vla-addlightweightpolyline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
															 (vlax-safearray-fill 
															 	(vlax-make-safearray vlax-vbdouble '(0 . 7)) 
																(apply 'append (list leftmost_vertex topmost_vertex rightmost_vertex bottommost_vertex))
															 )
								 )
		)
		1
	)
	(vla-put-closed bounding_box_pline :vlax-true)
	(vlax-release-object bounding_box_pline) 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:22:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11793347#M33740</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-02T14:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11794328#M33741</link>
      <description>&lt;P&gt;Just thought that I'd try this routine for fun.&lt;BR /&gt;Thanks for your efforts.&lt;BR /&gt;See below for what I got from using c:pline_bounding_box.&lt;/P&gt;&lt;P&gt;~thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 19:52:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11794328#M33741</guid>
      <dc:creator>greg_battin</dc:creator>
      <dc:date>2023-03-02T19:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11794366#M33742</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp;There is also &lt;A href="http://www.lee-mac.com/minboundingbox.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;THIS&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 20:15:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11794366#M33742</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2023-03-02T20:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11795336#M33743</link>
      <description>&lt;P&gt;))) well it wasn't obviously pretended to replace 'getboundingbox))) for&amp;nbsp;orthogonally placed bitten rectangles&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 07:34:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11795336#M33743</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-03T07:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get bounding box</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11795495#M33744</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2911067"&gt;@J-Rocks&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;did you test it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6321610156112w960h540r721" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6321610156112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6321610156112w960h540r721');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6321610156112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 08:57:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-bounding-box/m-p/11795495#M33744</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-03T08:57:56Z</dc:date>
    </item>
  </channel>
</rss>

