<?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: Bounding box with offset code help in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419167#M20854</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2383949"&gt;@bee&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondary question, does get-boundingbox work with multiple selected entities? As in, could I feed this code multiple objects, and would it be able to make a large bounding box around them?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2023 20:26:00 GMT</pubDate>
    <dc:creator>atrotto</dc:creator>
    <dc:date>2023-12-04T20:26:00Z</dc:date>
    <item>
      <title>Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419075#M20847</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just getting started with AutoLISP / Active X, and I cannot figure out why this isn't working. The bottom left corner of the rectangle drew with offset when I was testing with just mno, but when I replicated it with mxo, the code stops working. The bulk of this code is borrowed, leaving honorable mention in the comments.&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;;;Foamstamp.lsp
;;Bounding code borrowed from BlackBox on CadTutor

(defun c:FoamStamp (/ eName mn mx mno mxo)
 (vl-load-com)
 (if (setq eName (car (entsel "\n  &amp;gt;&amp;gt;  Select Object  &amp;gt;&amp;gt; ")))
   (progn
     (vla-getboundingbox (vlax-ename-&amp;gt;vla-object eName) 'mn 'mx)
     
     (vl-cmdf "._rectang" (
                            (setq mno (mapcar (lambda (a)(- a 0.25))(vlax-safearray-&amp;gt;list mn)))
			    (setq mxo (mapcar (lambda (b)(+ b 0.25))(vlax-safearray-&amp;gt;list mx)))
                          )
     ) 
    (princ)
   )
 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:46:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419075#M20847</guid>
      <dc:creator>atrotto</dc:creator>
      <dc:date>2023-12-04T19:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419078#M20848</link>
      <description>&lt;P&gt;It must be &lt;STRONG&gt;'&lt;/STRONG&gt;(lambda... or &lt;STRONG&gt;(function&lt;/STRONG&gt; (lambda...&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:48:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419078#M20848</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-04T19:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419085#M20849</link>
      <description>Thanks, figured it was something simple...</description>
      <pubDate>Mon, 04 Dec 2023 19:50:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419085#M20849</guid>
      <dc:creator>atrotto</dc:creator>
      <dc:date>2023-12-04T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419094#M20850</link>
      <description>&lt;P&gt;But this way would be more readable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FoamStamp (/ eName mn mx mno mxo)
  (vl-load-com)
  (if (setq eName (car (entsel "\n  &amp;gt;&amp;gt;  Select Object  &amp;gt;&amp;gt; ")))
    (progn
      (vla-getboundingbox (vlax-ename-&amp;gt;vla-object eName) 'mn 'mx)
      (vl-cmdf "._rectang"
	       (mapcar '+ (vlax-safearray-&amp;gt;list mn) '(-0.25 -0.25))
	       (mapcar '+ (vlax-safearray-&amp;gt;list mx) '(+0.25 +0.25)))))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:55:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419094#M20850</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-04T19:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419110#M20851</link>
      <description>Even better. I was going down a rabbit hole with lambda mostly because it was the Neat New Thing I read about on the Autodesk resource. Thank you so much.</description>
      <pubDate>Mon, 04 Dec 2023 20:02:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419110#M20851</guid>
      <dc:creator>atrotto</dc:creator>
      <dc:date>2023-12-04T20:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419133#M20852</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;....
	       (mapcar '+ (vlax-safearray-&amp;gt;list mn) '(-0.25 -0.25))
	       (mapcar '+ (vlax-safearray-&amp;gt;list mx) '(+0.25 +0.25)))))
....
&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A small thing, but it seems a little odd to &lt;EM&gt;add negative numbers&lt;/EM&gt; to the coordinates....&amp;nbsp; [And the plus signs on the numbers for the upper right are not needed.]&amp;nbsp; How about:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (mapcar '&lt;FONT size="4" color="#FF0000"&gt;-&lt;/FONT&gt; (vlax-safearray-&amp;gt;list mn) '(0.25 0.25))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (mapcar '+ (vlax-safearray-&amp;gt;list mx) '(0.25 0.25))))) &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:13:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419133#M20852</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-12-04T20:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419165#M20853</link>
      <description>&lt;P&gt;That is what I like about it. Directly see that it goes left and down. Don't have to think about&amp;nbsp;what is subtracted from what... But I guess it's just a matter of personal preference.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:25:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419165#M20853</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-04T20:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419167#M20854</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2383949"&gt;@bee&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondary question, does get-boundingbox work with multiple selected entities? As in, could I feed this code multiple objects, and would it be able to make a large bounding box around them?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419167#M20854</guid>
      <dc:creator>atrotto</dc:creator>
      <dc:date>2023-12-04T20:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419171#M20855</link>
      <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.lee-mac.com/ssboundingbox.html" target="_blank"&gt;http://www.lee-mac.com/ssboundingbox.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:27:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419171#M20855</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-04T20:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419192#M20856</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14612690"&gt;@atrotto&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;does get-boundingbox work with multiple selected entities? As in, could I feed this code multiple objects, and would it be able to make a large bounding box around them?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not this Topic's code directly, but in addition to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;'s link,&amp;nbsp;I also have a routine that will do that, called &lt;STRONG&gt;DrawBoundingBoxMult.lsp&lt;/STRONG&gt;, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/simple-bounding-box-code/m-p/10017075/highlight/true#M409966" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&amp;nbsp; I imagine there are more out there for the Searching.&amp;nbsp; Any of them would need to be adjusted similarly to this topic if you want the box outboard of the actual extents by some distance.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12419192#M20856</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-12-04T20:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12428476#M20857</link>
      <description>Hello, I started looking into this code, but the way Lee approaches handling creating the polyline has me scratching my head as to where to sneak in the offset. Ideally, I'd like to do it in the testcode he gave, so that I could reference the bounding box protocol in a few other programs that would have different offsets.&lt;BR /&gt;Am I right in saying that I can't just jam the calculation into his block creating the point coordinates starting at line 21?</description>
      <pubDate>Fri, 08 Dec 2023 14:00:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12428476#M20857</guid>
      <dc:creator>atrotto</dc:creator>
      <dc:date>2023-12-08T14:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12428718#M20858</link>
      <description>&lt;P&gt;Your line is this one&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="brkt"&gt;(&lt;/SPAN&gt;&lt;SPAN class="func"&gt;setq&lt;/SPAN&gt; box &lt;SPAN class="brkt"&gt;(&lt;/SPAN&gt;LM:ssboundingbox sel&lt;SPAN class="brkt"&gt;))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="brkt"&gt;(&lt;SPAN class="func"&gt;setq&lt;/SPAN&gt; box (:offset box))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="brkt"&gt;So add one more line below it and figure out the :offset function. It does not necessarily be a function, possibly just an expression that does the offset to coords saved as a list in box variable.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 15:41:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12428718#M20858</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-08T15:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Bounding box with offset code help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12429934#M20859</link>
      <description>&lt;P&gt;Like BeekeeCZ the 'box'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq box (LM:SSBOUNDINGBOX (ssget)))
!pts ((20.0 38.0 0.0) (179.0 201.0 0.0))
so offset pts (car box) &amp;amp; (cadr box)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is 2 points as a list, so can apply the offset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2023 06:12:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bounding-box-with-offset-code-help/m-p/12429934#M20859</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-12-09T06:12:58Z</dc:date>
    </item>
  </channel>
</rss>

