<?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: a dynamic box? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13000784#M43048</link>
    <description>&lt;P&gt;One small suggestion would be to switch from using 'kDrawingPointFilter' as the selection filter, which does not exist in the &lt;A href="https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=SelectionFilterEnum" target="_blank" rel="noopener"&gt;SelectionFilterEnum&lt;/A&gt;, to&amp;nbsp;SelectionFilterEnum.&lt;SPAN&gt;kAllPointEntities variation.&amp;nbsp; And you should always include the name of the Enum, before the Enum variation name (SelectionFilterEnum.kAllPointEntities instead of just kAllPointEntities).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 16:24:41 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2024-09-04T16:24:41Z</dc:date>
    <item>
      <title>a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786219#M43039</link>
      <description>&lt;P class="lia-align-left"&gt;I wonder if you can make ilogic/VBA program.&lt;BR /&gt;that works similarly to bounding box, you have in CAM. so you can make a solid that represent the stock&amp;nbsp;based on the part.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;can you have you have the flexibility to increase the size, on the different sides.&lt;/P&gt;&lt;P class="lia-align-left"&gt;and then you will get a cutting info for the material.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 09:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786219#M43039</guid>
      <dc:creator>kim.salvesen</dc:creator>
      <dc:date>2021-11-28T09:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786442#M43040</link>
      <description>&lt;P&gt;The easiest function (that has no flexibility) looks like this. Creating a visual representation is more difficult and will add depending on what you want features to your model. is that what you want?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Main&lt;/SPAN&gt;()

    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt;

    &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;body&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SurfaceBodies&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Box&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;body&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;RangeBox&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;x&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;ConvertToDefault&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;X&lt;/SPAN&gt; - &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;X&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;y&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;ConvertToDefault&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Y&lt;/SPAN&gt; - &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Y&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;z&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;ConvertToDefault&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Z&lt;/SPAN&gt; - &lt;SPAN style="color: #db9652;"&gt;box&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Z&lt;/SPAN&gt;)

        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;msg&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Format&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Body: '{0}': x:{1} y:{2} z:{3}"&lt;/SPAN&gt;,
                                &lt;SPAN style="color: #db9652;"&gt;body&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;x&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;y&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;z&lt;/SPAN&gt;)
        &lt;SPAN style="color: #db9652;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;msg&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ConvertToDefault&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;value&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;value&lt;/SPAN&gt;,
            &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;,
            &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDefaultDisplayLengthUnits&lt;/SPAN&gt;)
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 13:08:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786442#M43040</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-11-28T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786550#M43041</link>
      <description>&lt;DIV class=""&gt;Hello thanks for quick reply&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;I shall try to explain my case, we are a small machine shop&lt;/DIV&gt;&lt;DIV class=""&gt;we use Fusion 360 on the cam side.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;when I do quotation to apart&lt;/DIV&gt;&lt;DIV class=""&gt;I need to know how big the stock is going to be, to get the price on the stock and the material.&lt;/DIV&gt;&lt;DIV class=""&gt;so this is the main purpose on the application.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;on the stock we need to make it a little bit bigger.&lt;/DIV&gt;&lt;DIV class=""&gt;so this is why I want to be able to adjust the size.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;and I figure I don't need to do the work two times&lt;/DIV&gt;&lt;DIV class=""&gt;that's why I want the solid to represent the stock.&lt;/DIV&gt;&lt;DIV class=""&gt;so basically I do all the prep&amp;nbsp;in Inventor&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;then I don't need to do the work again Fusion 360 when I pushed apart&amp;nbsp;to&amp;nbsp;Fusion.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;this is what I come up with so far.&lt;/DIV&gt;&lt;DIV class=""&gt;but in the picture you can see the blue&amp;nbsp;but it is only a visual representation&amp;nbsp;and I can't adjust it.&lt;/DIV&gt;&lt;DIV class=""&gt;and here is the code&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN&gt;' Get the current Part document.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;' Get the TransientBRep and TransientGeometry objects.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;transBRep&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;TransientBRep&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientBRep&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;transGeom&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;

&lt;SPAN&gt;' Combine all bodies in Part into a single transient Surface Body.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;surfBody&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;combinedBodies&lt;/SPAN&gt; = &lt;SPAN&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN&gt;Copy&lt;/SPAN&gt;(&lt;SPAN&gt;surfBody&lt;/SPAN&gt;)
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN&gt;DoBoolean&lt;/SPAN&gt;(&lt;SPAN&gt;combinedBodies&lt;/SPAN&gt;, &lt;SPAN&gt;surfBody&lt;/SPAN&gt;, &lt;SPAN&gt;BooleanTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kBooleanTypeUnion&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;' Get the oriented mininum range box of all bodies in Part.&lt;/SPAN&gt;
&lt;SPAN&gt;' NOTE: "OrientedMinimumRangeBox" was added in Inventor 2020.3/2021.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;minBox&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;OrientedBox&lt;/SPAN&gt; = &lt;SPAN&gt;combinedBodies&lt;/SPAN&gt;.&lt;SPAN&gt;OrientedMinimumRangeBox&lt;/SPAN&gt;

&lt;SPAN&gt;' Get length of each side of mininum range box.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dir1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dir2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dir3&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;

&lt;SPAN&gt;' Convert lengths to document's length units.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;uom&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;UnitsOfMeasure&lt;/SPAN&gt;

&lt;SPAN&gt;dir1&lt;/SPAN&gt; = &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN&gt;dir1&lt;/SPAN&gt;, &lt;SPAN&gt;"cm"&lt;/SPAN&gt;, &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt;)
&lt;SPAN&gt;dir2&lt;/SPAN&gt; = &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN&gt;dir2&lt;/SPAN&gt;, &lt;SPAN&gt;"cm"&lt;/SPAN&gt;, &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt;)
&lt;SPAN&gt;dir3&lt;/SPAN&gt; = &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN&gt;dir3&lt;/SPAN&gt;, &lt;SPAN&gt;"cm"&lt;/SPAN&gt;, &lt;SPAN&gt;uom&lt;/SPAN&gt;.&lt;SPAN&gt;LengthUnits&lt;/SPAN&gt;)

&lt;SPAN&gt;' Sort lengths from smallest to largest.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lengths&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;New&lt;/SPAN&gt; &lt;SPAN&gt;List&lt;/SPAN&gt;(&lt;SPAN&gt;Of&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;) &lt;SPAN&gt;From&lt;/SPAN&gt; {&lt;SPAN&gt;dir1&lt;/SPAN&gt;, &lt;SPAN&gt;dir2&lt;/SPAN&gt;, &lt;SPAN&gt;dir3&lt;/SPAN&gt; }
&lt;SPAN&gt;lengths&lt;/SPAN&gt;.&lt;SPAN&gt;Sort&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;minLength&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;lengths&lt;/SPAN&gt;(0)
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;midLength&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;lengths&lt;/SPAN&gt;(1)
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;maxLength&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;lengths&lt;/SPAN&gt;(2)

&lt;SPAN&gt;' Create surface to represent oriented range box...&lt;/SPAN&gt;

&lt;SPAN&gt;' Create starting box with dimensions of oriented rangebox.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;startBox&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Box&lt;/SPAN&gt; = &lt;SPAN&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN&gt;CreateBox&lt;/SPAN&gt;()
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;boxMaxPoint&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Point&lt;/SPAN&gt; = &lt;SPAN&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint&lt;/SPAN&gt;(&lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;, &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;, &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;)
&lt;SPAN&gt;startBox&lt;/SPAN&gt;.&lt;SPAN&gt;Extend&lt;/SPAN&gt;(&lt;SPAN&gt;boxMaxPoint&lt;/SPAN&gt;)

&lt;SPAN&gt;' Create transformation matrix to move box to correct location/orientation.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;transMatrix&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Matrix&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN&gt;transMatrix&lt;/SPAN&gt;.&lt;SPAN&gt;SetCoordinateSystem&lt;/SPAN&gt;(&lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;CornerPoint&lt;/SPAN&gt;, &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN&gt;AsVector&lt;/SPAN&gt;, &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN&gt;AsVector&lt;/SPAN&gt;, &lt;SPAN&gt;minBox&lt;/SPAN&gt;.&lt;SPAN&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN&gt;AsVector&lt;/SPAN&gt;)

&lt;SPAN&gt;' Create surface body for the range box.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;minBoxSurface&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN&gt;CreateSolidBlock&lt;/SPAN&gt;(&lt;SPAN&gt;startBox&lt;/SPAN&gt;)

&lt;SPAN&gt;' Transform range box surface body to the correct location/orientation.&lt;/SPAN&gt;
&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN&gt;Transform&lt;/SPAN&gt;(&lt;SPAN&gt;minBoxSurface&lt;/SPAN&gt;, &lt;SPAN&gt;transMatrix&lt;/SPAN&gt;)

&lt;SPAN&gt;' Display range box on screen.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;transac&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Transaction&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransactionManager&lt;/SPAN&gt;.&lt;SPAN&gt;StartTransaction&lt;/SPAN&gt;(&lt;SPAN&gt;partDoc&lt;/SPAN&gt;, &lt;SPAN&gt;"DisplayRangeBox"&lt;/SPAN&gt;)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;cGraphics&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ClientGraphics&lt;/SPAN&gt;

&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;cGraphics&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;ClientGraphicsCollection&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;"OrientedRangeBox"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;surfacesNode&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;GraphicsNode&lt;/SPAN&gt; = &lt;SPAN&gt;cGraphics&lt;/SPAN&gt;.&lt;SPAN&gt;AddNode&lt;/SPAN&gt;(1)
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;surfGraphics&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceGraphics&lt;/SPAN&gt; = &lt;SPAN&gt;surfacesNode&lt;/SPAN&gt;.&lt;SPAN&gt;AddSurfaceGraphics&lt;/SPAN&gt;(&lt;SPAN&gt;minBoxSurface&lt;/SPAN&gt;)
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;targetAppearance&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Asset&lt;/SPAN&gt;
	
	&lt;SPAN&gt;Try&lt;/SPAN&gt;
		&lt;SPAN&gt;targetAppearance&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Assets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Clear - Blue"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sourceAppearance&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Asset&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;AssetLibraries&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"314DE259-5443-4621-BFBD-1730C6CC9AE9"&lt;/SPAN&gt;).&lt;SPAN&gt;AppearanceAssets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"InvGen-001-1-2"&lt;/SPAN&gt;) &lt;SPAN&gt;' "Clear - Blue"&lt;/SPAN&gt;
		&lt;SPAN&gt;targetAppearance&lt;/SPAN&gt; = &lt;SPAN&gt;sourceAppearance&lt;/SPAN&gt;.&lt;SPAN&gt;CopyTo&lt;/SPAN&gt;(&lt;SPAN&gt;partDoc&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
	
	&lt;SPAN&gt;surfacesNode&lt;/SPAN&gt;.&lt;SPAN&gt;Appearance&lt;/SPAN&gt; = &lt;SPAN&gt;targetAppearance&lt;/SPAN&gt;

	&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveView&lt;/SPAN&gt;.&lt;SPAN&gt;Update&lt;/SPAN&gt;

	&lt;SPAN&gt;' Display message with minimum rangebox size.&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Oriented Minimum Rangebox Size: "&lt;/SPAN&gt; &amp;amp;
	&lt;SPAN&gt;minLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;midLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;),
	&lt;SPAN&gt;"Oriented Minimum Rangebox"&lt;/SPAN&gt;, &lt;SPAN&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN&gt;OK&lt;/SPAN&gt;, &lt;SPAN&gt;MessageBoxIcon&lt;/SPAN&gt;.&lt;SPAN&gt;Information&lt;/SPAN&gt;)
	
	

	
&lt;SPAN&gt;Finally&lt;/SPAN&gt;
	&lt;SPAN&gt;' Remove range box from screen.&lt;/SPAN&gt;
	&lt;SPAN&gt;transac&lt;/SPAN&gt;.&lt;SPAN&gt;Abort&lt;/SPAN&gt;
	&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveView&lt;/SPAN&gt;.&lt;SPAN&gt;Update&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Material"&lt;/SPAN&gt;) = &lt;SPAN&gt;"Z"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;minLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN&gt;" Y"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;midLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN&gt;" X"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) + 5
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Min Material"&lt;/SPAN&gt;) = &lt;SPAN&gt;minLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;midLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;)


&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"X"&lt;/SPAN&gt;) = &lt;SPAN&gt;minLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) 
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Y"&lt;/SPAN&gt;) = &lt;SPAN&gt;midLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;) 
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Z"&lt;/SPAN&gt;) = &lt;SPAN&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;(&lt;SPAN&gt;"#.###"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;and I also try something in vba&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;Private Sub UserForm_Click()&lt;BR /&gt;' Get the active part document.&lt;BR /&gt;Dim invPartDoc As PartDocument&lt;BR /&gt;Set invPartDoc = ThisApplication.ActiveDocument&lt;/P&gt;&lt;P&gt;' Get the custom property set.&lt;BR /&gt;Dim invCustomPropertySet As PropertySet&lt;BR /&gt;Set invCustomPropertySet = invPartDoc.PropertySets.Item("Inventor User Defined Properties")&lt;BR /&gt;'******&lt;BR /&gt;Dim length As Property&lt;BR /&gt;Dim width As Property&lt;BR /&gt;Dim height As Property&lt;BR /&gt;'******&lt;BR /&gt;Set length = invCustomPropertySet.Item("X")&lt;BR /&gt;Set width = invCustomPropertySet.Item("Y")&lt;BR /&gt;Set height = invCustomPropertySet.Item("Z")&lt;BR /&gt;'******&lt;/P&gt;&lt;P&gt;'MsgBox length.Value&lt;BR /&gt;txtW.Text = length.Value&lt;BR /&gt;txtH.Text = width.Value&lt;BR /&gt;txtD.Text = height.Value&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;I Am brand new to inventor&amp;nbsp;so I deeply appreciate the help.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 28 Nov 2021 15:01:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786550#M43041</guid>
      <dc:creator>kim.salvesen</dc:creator>
      <dc:date>2021-11-28T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786911#M43042</link>
      <description>&lt;P&gt;does this work for you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Main&lt;/SPAN&gt;()
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Get the current Part document.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Get the TransientBRep and TransientGeometry objects.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Combine all bodies in Part into a single transient Surface Body.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SurfaceBodies&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Copy&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DoBoolean&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;BooleanTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kBooleanTypeUnion&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Get the oriented mininum range box of all bodies in Part.&lt;/SPAN&gt;
    &lt;SPAN style="color: #b2b2b5;"&gt;' NOTE: "OrientedMinimumRangeBox" was added in Inventor 2020.3/2021.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;OrientedBox&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;OrientedMinimumRangeBox&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Create starting box with dimensions of oriented rangebox.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Box&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateBox&lt;/SPAN&gt;()
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;boxMaxPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint&lt;/SPAN&gt;(
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt;,
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt;,
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt;)
    &lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Extend&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;boxMaxPoint&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;boxMinPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint&lt;/SPAN&gt;(-&lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt;, -&lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt;, -&lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt;)
    &lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Extend&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;boxMinPoint&lt;/SPAN&gt;)

    &lt;SPAN style="color: #b2b2b5;"&gt;' Create surface body for the range box.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateSolidBlock&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;)

    &lt;SPAN style="color: #b2b2b5;"&gt;' Create transformation matrix to move box to correct location/orientation.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Matrix&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateMatrix&lt;/SPAN&gt;
    &lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SetCoordinateSystem&lt;/SPAN&gt;(
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CornerPoint&lt;/SPAN&gt;,
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;,
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;,
        &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;)

    &lt;SPAN style="color: #b2b2b5;"&gt;'Dim transMatrix2 As Matrix = ThisApplication.TransientGeometry.CreateMatrix&lt;/SPAN&gt;
    &lt;SPAN style="color: #b2b2b5;"&gt;'transMatrix2.SetTranslation(transGeom.CreateVector(-margin, -margin, -margin))&lt;/SPAN&gt;
    &lt;SPAN style="color: #b2b2b5;"&gt;'transMatrix.TransformBy(transMatrix2)&lt;/SPAN&gt;


    &lt;SPAN style="color: #b2b2b5;"&gt;' Transform range box surface body to the correct location/orientation.&lt;/SPAN&gt;
    &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Transform&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt;)


    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ClientGraphics&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;CreateBox&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt;)


    &lt;SPAN style="color: #b2b2b5;"&gt;' Get length of each side of mininum range box.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;

    &lt;SPAN style="color: #b2b2b5;"&gt;' Convert lengths to document's length units.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt;

    &lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)
    &lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)
    &lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)

    &lt;SPAN style="color: #b2b2b5;"&gt;' Sort lengths from smallest to largest.&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;List&lt;/SPAN&gt;(&lt;SPAN style="color: #ce5c95;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;From&lt;/SPAN&gt; {&lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt;}
    &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Sort&lt;/SPAN&gt;()

    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(0)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(1)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(2)

    &lt;SPAN style="color: #b2b2b5;"&gt;' Display message with minimum rangebox size.&lt;/SPAN&gt;
    &lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Oriented Minimum Rangebox Size: "&lt;/SPAN&gt; &amp;amp;
        &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;),
        &lt;SPAN style="color: #35b173;"&gt;"Oriented Minimum Rangebox"&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;OK&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;MessageBoxIcon&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Information&lt;/SPAN&gt;)

    &lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Material"&lt;/SPAN&gt;) = &lt;SPAN style="color: #35b173;"&gt;"Z"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" Y"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" X"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5
    &lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Min Material"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)


    &lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"X"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Y"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Z"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)

    &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Delete&lt;/SPAN&gt;()

&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;


&lt;SPAN style="color: #ce5c95;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;CreateBox&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;surface&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Object&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ClientGraphics&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ClientGraphics&lt;/SPAN&gt;

    &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ClientGraphicsCollection&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"OrientedRangeBox"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;surfacesNode&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;GraphicsNode&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddNode&lt;/SPAN&gt;(1)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;surfGraphics&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceGraphics&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;surfacesNode&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddSurfaceGraphics&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;surface&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;targetAppearance&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Asset&lt;/SPAN&gt;

    &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;targetAppearance&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Assets&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Clear - Blue"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Catch&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;sourceAppearance&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Asset&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AssetLibraries&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"314DE259-5443-4621-BFBD-1730C6CC9AE9"&lt;/SPAN&gt;).&lt;SPAN style="color: #db9652;"&gt;AppearanceAssets&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"InvGen-001-1-2"&lt;/SPAN&gt;) &lt;SPAN style="color: #b2b2b5;"&gt;' "Clear - Blue"&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;targetAppearance&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;sourceAppearance&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CopyTo&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;

    &lt;SPAN style="color: #db9652;"&gt;surfacesNode&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Appearance&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;targetAppearance&lt;/SPAN&gt;

    &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ActiveView&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Update&lt;/SPAN&gt;()

    &lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;cGraphics&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 20:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786911#M43042</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-11-28T20:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786977#M43043</link>
      <description>&lt;P&gt;hello&amp;nbsp;and thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is absolutely a step in the right direction.&lt;/P&gt;&lt;P&gt;I need the blue to be a solid&amp;nbsp;not just a presentation.&lt;/P&gt;&lt;P&gt;if I can make a solid Bounding box,&amp;nbsp;then we get big step on the way&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 21:25:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10786977#M43043</guid>
      <dc:creator>kim.salvesen</dc:creator>
      <dc:date>2021-11-28T21:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10787044#M43044</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #b2b2b5;"&gt;' cm&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Get the current Part document.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Get the TransientBRep and TransientGeometry objects.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Combine all bodies in Part into a single transient Surface Body.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SurfaceBodies&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Copy&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;transBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DoBoolean&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;surfBody&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;BooleanTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kBooleanTypeUnion&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Get the oriented mininum range box of all bodies in Part.&lt;/SPAN&gt;
&lt;SPAN style="color: #b2b2b5;"&gt;' NOTE: "OrientedMinimumRangeBox" was added in Inventor 2020.3/2021.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;OrientedBox&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;combinedBodies&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;OrientedMinimumRangeBox&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Create starting box with dimensions of oriented rangebox.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Box&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateBox&lt;/SPAN&gt;()
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;boxMaxPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint&lt;/SPAN&gt;(
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt;,
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt;,
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Extend&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;boxMaxPoint&lt;/SPAN&gt;)
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;boxMinPoint&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Point&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;transGeom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreatePoint&lt;/SPAN&gt;(-&lt;SPAN style="color: #db9652;"&gt;margin1&lt;/SPAN&gt;, -&lt;SPAN style="color: #db9652;"&gt;margin2&lt;/SPAN&gt;, -&lt;SPAN style="color: #db9652;"&gt;margin3&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Extend&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;boxMinPoint&lt;/SPAN&gt;)

&lt;SPAN style="color: #b2b2b5;"&gt;' Create surface body for the range box.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceBody&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateSolidBlock&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;startBox&lt;/SPAN&gt;)

&lt;SPAN style="color: #b2b2b5;"&gt;' Create transformation matrix to move box to correct location/orientation.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Matrix&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SetCoordinateSystem&lt;/SPAN&gt;(
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CornerPoint&lt;/SPAN&gt;,
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;,
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;,
    &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsUnitVector&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AsVector&lt;/SPAN&gt;)

&lt;SPAN style="color: #b2b2b5;"&gt;'Dim transMatrix2 As Matrix = ThisApplication.TransientGeometry.CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #b2b2b5;"&gt;'transMatrix2.SetTranslation(transGeom.CreateVector(-margin, -margin, -margin))&lt;/SPAN&gt;
&lt;SPAN style="color: #b2b2b5;"&gt;'transMatrix.TransformBy(transMatrix2)&lt;/SPAN&gt;


&lt;SPAN style="color: #b2b2b5;"&gt;' Transform range box surface body to the correct location/orientation.&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientBRep&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Transform&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;transMatrix&lt;/SPAN&gt;)


&lt;SPAN style="color: #b2b2b5;"&gt;' Create a base body feature of the result.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;nonParamFeatures&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;NonParametricBaseFeatures&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Features&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;NonParametricBaseFeatures&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;nonParamDef&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;NonParametricBaseFeatureDefinition&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;nonParamFeatures&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;tObjs&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;TransientObjects&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;TransientObjects&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;objs&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ObjectCollection&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;tObjs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;CreateObjectCollection&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;objs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;minBoxSurface&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;nonParamDef&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;BRepEntities&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;objs&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;nonParamDef&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;OutputType&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;BaseFeatureOutputTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kSolidOutputType&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;nonParamFeatures&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddByDefinition&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;nonParamDef&lt;/SPAN&gt;)


&lt;SPAN style="color: #b2b2b5;"&gt;' Get length of each side of mininum range box.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionOne&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionTwo&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;minBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DirectionThree&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Length&lt;/SPAN&gt;

&lt;SPAN style="color: #b2b2b5;"&gt;' Convert lengths to document's length units.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UnitsOfMeasure&lt;/SPAN&gt;

&lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)
&lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ConvertUnits&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;UnitsTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kDatabaseLengthUnits&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;uom&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;LengthUnits&lt;/SPAN&gt;)

&lt;SPAN style="color: #b2b2b5;"&gt;' Sort lengths from smallest to largest.&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;List&lt;/SPAN&gt;(&lt;SPAN style="color: #ce5c95;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;From&lt;/SPAN&gt; {&lt;SPAN style="color: #db9652;"&gt;dir1&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;dir2&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;dir3&lt;/SPAN&gt;}
&lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Sort&lt;/SPAN&gt;()

&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(0)
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(1)
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;lengths&lt;/SPAN&gt;(2)

&lt;SPAN style="color: #b2b2b5;"&gt;' Display message with minimum rangebox size.&lt;/SPAN&gt;
&lt;SPAN style="color: #db9652;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Oriented Minimum Rangebox Size: "&lt;/SPAN&gt; &amp;amp;
    &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;),
    &lt;SPAN style="color: #35b173;"&gt;"Oriented Minimum Rangebox"&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;OK&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;MessageBoxIcon&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Information&lt;/SPAN&gt;)

&lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Material"&lt;/SPAN&gt;) = &lt;SPAN style="color: #35b173;"&gt;"Z"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" Y"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5 &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" X"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) + 5
&lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Min Material"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #35b173;"&gt;" x "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)


&lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"X"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;minLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)
&lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Y"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;midLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)
&lt;SPAN style="color: #9d6bce;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Z"&lt;/SPAN&gt;) = &lt;SPAN style="color: #db9652;"&gt;maxLength&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"#.###"&lt;/SPAN&gt;)&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Nov 2021 22:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10787044#M43044</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-11-28T22:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10787485#M43045</link>
      <description>Thank you very much it helps so much &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;</description>
      <pubDate>Mon, 29 Nov 2021 06:40:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/10787485#M43045</guid>
      <dc:creator>kim.salvesen</dc:creator>
      <dc:date>2021-11-29T06:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/12999035#M43046</link>
      <description>&lt;P&gt;Hi Jelte!&lt;/P&gt;&lt;P&gt;I am trying to use this "dynamic box" rule to get the overall dimensions of an irregular part and it works perfectly for that purpose. In addition to this, I wanted to detail the part and the oriented view shows that the points I arrowed to need to be horizontal so I can get dimensions as calculated by this "dynamic box" rule.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do that, I came up with this rule that lets the user pick the drawing view and is supposed to let user pick the first and second points and will calculate the angle of rotation for the drawing view. However, it is not letting me pick the points. Can you please evaluate and maybe suggest a fix? Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()
    &lt;SPAN&gt;' Get the active drawing document&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
    &lt;SPAN&gt;oDrawingDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
    
    &lt;SPAN&gt;' Prompt the user to select the drawing view&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;Resume&lt;/SPAN&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;
    &lt;SPAN&gt;oView&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;kDrawingViewFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select the drawing view to rotate"&lt;/SPAN&gt;)
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;GoTo&lt;/SPAN&gt; 0
    &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Drawing view selection was cancelled or invalid."&lt;/SPAN&gt;, &lt;SPAN&gt;vbExclamation&lt;/SPAN&gt;)
        &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN&gt;' Prompt the user to select the first point&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPoint1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Point2d&lt;/SPAN&gt;
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;Resume&lt;/SPAN&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;
    &lt;SPAN&gt;oPoint1&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;kDrawingPointFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select the first point"&lt;/SPAN&gt;)
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;GoTo&lt;/SPAN&gt; 0
    &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPoint1&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"First point selection was cancelled or invalid."&lt;/SPAN&gt;, &lt;SPAN&gt;vbExclamation&lt;/SPAN&gt;)
        &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN&gt;' Prompt the user to select the second point&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPoint2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Point2d&lt;/SPAN&gt;
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;Resume&lt;/SPAN&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;
    &lt;SPAN&gt;oPoint2&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;kDrawingPointFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select the second point"&lt;/SPAN&gt;)
    &lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;GoTo&lt;/SPAN&gt; 0
    &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPoint2&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Second point selection was cancelled or invalid."&lt;/SPAN&gt;, &lt;SPAN&gt;vbExclamation&lt;/SPAN&gt;)
        &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN&gt;' Calculate the angle in radians&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;angle&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
    &lt;SPAN&gt;angle&lt;/SPAN&gt; = &lt;SPAN&gt;Math&lt;/SPAN&gt;.&lt;SPAN&gt;Atan2&lt;/SPAN&gt;(&lt;SPAN&gt;oPoint2&lt;/SPAN&gt;.&lt;SPAN&gt;Y&lt;/SPAN&gt; - &lt;SPAN&gt;oPoint1&lt;/SPAN&gt;.&lt;SPAN&gt;Y&lt;/SPAN&gt;, &lt;SPAN&gt;oPoint2&lt;/SPAN&gt;.&lt;SPAN&gt;X&lt;/SPAN&gt; - &lt;SPAN&gt;oPoint1&lt;/SPAN&gt;.&lt;SPAN&gt;X&lt;/SPAN&gt;)
    
    &lt;SPAN&gt;' Convert the angle to degrees&lt;/SPAN&gt;
    &lt;SPAN&gt;angle&lt;/SPAN&gt; = &lt;SPAN&gt;angle&lt;/SPAN&gt; * 180 / &lt;SPAN&gt;Math&lt;/SPAN&gt;.&lt;SPAN&gt;PI&lt;/SPAN&gt;
    
    &lt;SPAN&gt;' Rotate the view&lt;/SPAN&gt;
    &lt;SPAN&gt;oView&lt;/SPAN&gt;.&lt;SPAN&gt;Rotation&lt;/SPAN&gt; = &lt;SPAN&gt;angle&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VictorTuguinay_0-1725401189082.png" style="width: 477px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1405391iBC28D1807B45A738/image-dimensions/477x369?v=v2" width="477" height="369" role="button" title="VictorTuguinay_0-1725401189082.png" alt="VictorTuguinay_0-1725401189082.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VictorTuguinay_2-1725401393016.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1405398i3178CD25847AAE4A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VictorTuguinay_2-1725401393016.png" alt="VictorTuguinay_2-1725401393016.png" /&gt;&lt;/span&gt;&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;</description>
      <pubDate>Tue, 03 Sep 2024 22:18:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/12999035#M43046</guid>
      <dc:creator>Victor.Tuguinay</dc:creator>
      <dc:date>2024-09-03T22:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/12999118#M43047</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&lt;BR /&gt;Or is there an easier way to rotate the drawing view based on that minimum bounding box? I am looking to orient the view by making the long side of the bounding box horizontal.</description>
      <pubDate>Tue, 03 Sep 2024 23:32:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/12999118#M43047</guid>
      <dc:creator>Victor.Tuguinay</dc:creator>
      <dc:date>2024-09-03T23:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13000784#M43048</link>
      <description>&lt;P&gt;One small suggestion would be to switch from using 'kDrawingPointFilter' as the selection filter, which does not exist in the &lt;A href="https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=SelectionFilterEnum" target="_blank" rel="noopener"&gt;SelectionFilterEnum&lt;/A&gt;, to&amp;nbsp;SelectionFilterEnum.&lt;SPAN&gt;kAllPointEntities variation.&amp;nbsp; And you should always include the name of the Enum, before the Enum variation name (SelectionFilterEnum.kAllPointEntities instead of just kAllPointEntities).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 16:24:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13000784#M43048</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-09-04T16:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13136079#M43049</link>
      <description>Hello! In Inventor 2016 API, there is no "OrientedMinimumRangeBox". Can other alternative code be used to achieve this? Thank you!</description>
      <pubDate>Thu, 07 Nov 2024 11:46:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13136079#M43049</guid>
      <dc:creator>442780782</dc:creator>
      <dc:date>2024-11-07T11:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13136208#M43050</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7432789"&gt;@442780782&lt;/a&gt;.&amp;nbsp; Before the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-OrientedBox" target="_blank" rel="noopener"&gt;OrientedBox&lt;/A&gt; object type (originally available in 2016) and the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SurfaceBody_OrientedMinimumRangeBox" target="_blank" rel="noopener"&gt;OrientedMinimimRangeBox&lt;/A&gt; property (2021 &amp;amp; 2024) was available, we had to use the regular &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Box" target="_blank" rel="noopener"&gt;Box&lt;/A&gt; object type and the regular &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SurfaceBody_RangeBox" target="_blank" rel="noopener"&gt;RangeBox&lt;/A&gt; property.&amp;nbsp; That RangeBox property could be found associated with several different types of objects.&amp;nbsp; It has different properties, so its size is determined differently, but there should actually be a lot more discussions and examples of dealing with RangeBox property and the Box object, and their sizes, than there are for the newer objects / properties, since they were around a lot longer.&amp;nbsp; As far as I could tell, the only way you encountered an OrientedBox in 2016 is by 'creating' one yourself, using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=TransientGeometry_CreateOrientedBox" target="_blank" rel="noopener"&gt;TransientGeometry.CreateOrientedBox&lt;/A&gt;&amp;nbsp;method.&amp;nbsp; But obtaining the proper and accurate input data for defining it, based on existing geometry in a model, was likely much more challenging in 2016 version of Inventor.&amp;nbsp; However, when working with a Box, instead of an OrientedBox, there is a much simpler way to generate 'transient' geometry from that using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=TransientBRep_CreateSolidBlock" target="_blank" rel="noopener"&gt;TransientBRep.CreateSolidBlock&lt;/A&gt;&amp;nbsp;method.&amp;nbsp; It lets us specify a Box as input, and returns a transient SurfaceBody object.&amp;nbsp; And once you have that, you can use the other simpler route of with the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=NonParametricBaseFeatures_Add" target="_blank" rel="noopener"&gt;NonParametricBaseFeatures.Add&lt;/A&gt;&amp;nbsp;method, to create the visible body representing the RangeBox, if you want to.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 12:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13136208#M43050</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-11-07T12:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13137682#M43051</link>
      <description>Thank you for your guidance! Can you provide the complete code that supports Inventor 2016? I would be very grateful, thank you!</description>
      <pubDate>Fri, 08 Nov 2024 00:33:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13137682#M43051</guid>
      <dc:creator>442780782</dc:creator>
      <dc:date>2024-11-08T00:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: a dynamic box?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13138786#M43052</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7432789"&gt;@442780782&lt;/a&gt;.&amp;nbsp; Below is an example iLogic rule that I think should work OK in 2016 version of Inventor.&amp;nbsp; It will create a rectangular prism shaped solid body the same size as the bounding box that should fully encompasses all current bodies in a part.&amp;nbsp; The resulting body is a 'new' solid body that is not 'combined' with all the others, but is independent, and can have its visibility turned on/off, or that feature that created it can be suppressed.&amp;nbsp; However, I do not believe it will remain accurate (it will not update itself automatically) if you make further changes to the pre-existing bodies, or add more bodies into the part after creating it.&amp;nbsp; So, if you make changes after that, and need it to be accurate again, then you may need to run this rule (or one like it) again.&amp;nbsp; The rule assigns the name "Bounding Box" to this feature, so if the rule runs again, it will try to delete an existing feature of that type, with that name, before creating the new one with that same name.&amp;nbsp; This rule also uses a 'Transaction' to wrap the feature creation and name change into one item in the UNDO list, so it can be undone again in one click on the undo button, if you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oPDoc As PartDocument = TryCast(ThisDoc.Document, Inventor.PartDocument)
	If oPDoc Is Nothing Then Return
	Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
	Dim oMainBox As Inventor.Box = Nothing
	For Each oBody As SurfaceBody In oPDef.SurfaceBodies
		Dim oBodyBox As Inventor.Box = oBody.RangeBox
		If oMainBox Is Nothing Then
			oMainBox = oBodyBox.Copy
		Else
			Try : oMainBox.Extend(oBodyBox.MinPoint) : Catch : End Try
			Try : oMainBox.Extend(oBodyBox.MaxPoint) : Catch : End Try
		End If
	Next oBody
	Dim oTBody As SurfaceBody = oInvApp.TransientBRep.CreateSolidBlock(oMainBox)
	Dim oNPBFs As NonParametricBaseFeatures = oPDef.Features.NonParametricBaseFeatures
	Dim oNPBFDef As NonParametricBaseFeatureDefinition = oNPBFs.CreateDefinition()
	Dim oObjColl As Inventor.ObjectCollection = oInvApp.TransientObjects.CreateObjectCollection
	oObjColl.Add(oTBody)
	oNPBFDef.BRepEntities = oObjColl
	oNPBFDef.OutputType = BaseFeatureOutputTypeEnum.kSolidOutputType
	Dim oTrans As Inventor.Transaction = oInvApp.TransactionManager.StartTransaction(oPDoc, "Create Bounding Box - iLogic")
	Try : oNPBFs.Item("Bounding Box").Delete : Catch : End Try
	Dim oNPBF As NonParametricBaseFeature = oNPBFs.AddByDefinition(oNPBFDef)
	oNPBF.Name = "Bounding Box"
	oTrans.End
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 13:11:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/a-dynamic-box/m-p/13138786#M43052</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-11-08T13:11:15Z</dc:date>
    </item>
  </channel>
</rss>

