<?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: About Box Object in API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480479#M109501</link>
    <description>&lt;P&gt;You may be able to use this technique, but I haven't tried using it with a TransientGeometry object.&amp;nbsp; It would likely work for them too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example, I'm using a the coordinates of a WorkPoint's Point object, as the input within the 'IsPointInside' Property.&amp;nbsp; But you can just delete the Dim oPoint line and replace the oPoint.X etc with simple Double (numerical) values, if you want.&amp;nbsp; It works the same either way.&amp;nbsp; Getting the kOnContainment answer is a bit odd though.&amp;nbsp; Not entirely sure how this is calculated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oBodies As SurfaceBodies = oPDef.SurfaceBodies
Dim oBody As SurfaceBody = oBodies.Item(1)
Dim oPoint As Point = oPDef.WorkPoints.Item(1).Point
Dim oCoords(2) As Double 'Use (2) for 3 doubles, because 0 is counted
oCoords(0) = oPoint.X
oCoords(1) = oPoint.Y
oCoords(2) = oPoint.Z
Dim oContEnum As ContainmentEnum = oBody.IsPointInside(oCoords,False)
Select Case oContEnum
	Case ContainmentEnum.kInsideContainment
		MsgBox("It is Inside the body.")
	Case ContainmentEnum.kOnContainment
		MsgBox("It is On the body.")
	Case ContainmentEnum.kOutsideContainment
		MsgBox("It is Outside the body.")
	Case ContainmentEnum.kUnknownContainment
		MsgBox("Its location is Unknown in relation to the body.")
End Select&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;If this solves your problem, or answers your questions, please click 'Accept As Solution".&lt;BR /&gt;Or, if this helps you reach your goal, please click 'LIKES" &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.&lt;BR /&gt;If you agree with any of them, please vote for them.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add more capabilities to the 'Customize' dialog box (exe. Add Tab &amp;amp; Add Panel) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/add-more-capabilities-to-the-customize-dialog-box-exe-add-tab/idi-p/9371747/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;MessageBox, InputBox, and InputListBox Size &amp;amp; Format Options &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/text-format-amp-size-options-messagebox-inputbox-inputlistbox/idi-p/9169817/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Constrain &amp;amp; Dimension Images In Assembly Sketches &amp;amp; Drawing Sketches (TitleBlocks &amp;amp; SketchedSymbols) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/we-need-the-ability-to-fully-constrain-amp-dimension-images/idi-p/9299088/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/save-section-view-status-in-designviewrepresentation-so-is/idi-p/9270962/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Add SolidBodies Folder In iLogic Rule Editor Model Tab &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/ilogic-rule-editor-gt-model-tab-add-a-solid-bodies-folder-for/idi-p/9270898/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawings-in-oldversions-set-all-views-to-raster-before-autosave/idi-p/9185521/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;SetDesignViewRepresentation - Fix limitations for DrawingView of a Part &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/setdesignviewrepresentation-fix-limitations-for-drawingview-of-a/idi-p/9369920/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Create DocumentSubTypeEnum &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/create-enum-for-documentsubtype-amp-or-document-subtype/idi-p/9402300/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 17:45:41 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-04-29T17:45:41Z</dc:date>
    <item>
      <title>About Box Object in API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9454927#M108171</link>
      <description>&lt;P&gt;Hi, all,&lt;/P&gt;&lt;P&gt;Inventor has a Box Object which is a mathematical utility object that represents a rectangular &lt;FONT color="#ffffff"&gt;box&lt;/FONT&gt; whose faces are always parallel to the model X Y Z planes. Right now we are using its method such as "Box.contains(...)" for the purpose to identifying whether a part or component is within this box or not, for further processing.&lt;/P&gt;&lt;P&gt;But in many cases, we need some NON-rectangular boxes such as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is it possible to define a mathematical boxes (such as adding or deducting some shaped&amp;nbsp; boxes together) like these and use the mathematical "contains" method?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 200px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/756933i2A521D598DFAD9BF/image-size/small?v=v2&amp;amp;px=200" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 164px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/756935i192F90AA19C0C9C7/image-dimensions/164x216?v=v2" width="164" height="216" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 03:23:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9454927#M108171</guid>
      <dc:creator>liminma8458</dc:creator>
      <dc:date>2020-04-20T03:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: About Box Object in API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9479786#M109454</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/553194"&gt;@liminma8458&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sounds like a tough one. Are you using the RangeBox of a ComponentOccurrence or just making a box and trying to find whats in it? Without knowing why the box needs to be non-rectangular or other details, my first thought is to think of this problem as finding a point in a polygon. The non-rectangular box would be the polygon and the point would be a point on the part. Below is a link that has C# code to find a 3D point in a 3D polygon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.codeproject.com/Articles/1070593/Point-Inside-D-Convex-Polygon-in-Csharp" target="_blank" rel="noopener"&gt;https://www.codeproject.com/Articles/1070593/Point-Inside-D-Convex-Polygon-in-Csharp&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And maybe if you provided a little more information on why the box needs to be non-rectangular, someone could come up with some work around that doesn't require a non-rectangular box? Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 13:22:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9479786#M109454</guid>
      <dc:creator>ianteneth</dc:creator>
      <dc:date>2020-04-29T13:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: About Box Object in API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480479#M109501</link>
      <description>&lt;P&gt;You may be able to use this technique, but I haven't tried using it with a TransientGeometry object.&amp;nbsp; It would likely work for them too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example, I'm using a the coordinates of a WorkPoint's Point object, as the input within the 'IsPointInside' Property.&amp;nbsp; But you can just delete the Dim oPoint line and replace the oPoint.X etc with simple Double (numerical) values, if you want.&amp;nbsp; It works the same either way.&amp;nbsp; Getting the kOnContainment answer is a bit odd though.&amp;nbsp; Not entirely sure how this is calculated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oBodies As SurfaceBodies = oPDef.SurfaceBodies
Dim oBody As SurfaceBody = oBodies.Item(1)
Dim oPoint As Point = oPDef.WorkPoints.Item(1).Point
Dim oCoords(2) As Double 'Use (2) for 3 doubles, because 0 is counted
oCoords(0) = oPoint.X
oCoords(1) = oPoint.Y
oCoords(2) = oPoint.Z
Dim oContEnum As ContainmentEnum = oBody.IsPointInside(oCoords,False)
Select Case oContEnum
	Case ContainmentEnum.kInsideContainment
		MsgBox("It is Inside the body.")
	Case ContainmentEnum.kOnContainment
		MsgBox("It is On the body.")
	Case ContainmentEnum.kOutsideContainment
		MsgBox("It is Outside the body.")
	Case ContainmentEnum.kUnknownContainment
		MsgBox("Its location is Unknown in relation to the body.")
End Select&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;If this solves your problem, or answers your questions, please click 'Accept As Solution".&lt;BR /&gt;Or, if this helps you reach your goal, please click 'LIKES" &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.&lt;BR /&gt;If you agree with any of them, please vote for them.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add more capabilities to the 'Customize' dialog box (exe. Add Tab &amp;amp; Add Panel) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/add-more-capabilities-to-the-customize-dialog-box-exe-add-tab/idi-p/9371747/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;MessageBox, InputBox, and InputListBox Size &amp;amp; Format Options &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/text-format-amp-size-options-messagebox-inputbox-inputlistbox/idi-p/9169817/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Constrain &amp;amp; Dimension Images In Assembly Sketches &amp;amp; Drawing Sketches (TitleBlocks &amp;amp; SketchedSymbols) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/we-need-the-ability-to-fully-constrain-amp-dimension-images/idi-p/9299088/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/save-section-view-status-in-designviewrepresentation-so-is/idi-p/9270962/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Add SolidBodies Folder In iLogic Rule Editor Model Tab &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/ilogic-rule-editor-gt-model-tab-add-a-solid-bodies-folder-for/idi-p/9270898/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawings-in-oldversions-set-all-views-to-raster-before-autosave/idi-p/9185521/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;SetDesignViewRepresentation - Fix limitations for DrawingView of a Part &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/setdesignviewrepresentation-fix-limitations-for-drawingview-of-a/idi-p/9369920/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Create DocumentSubTypeEnum &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/create-enum-for-documentsubtype-amp-or-document-subtype/idi-p/9402300/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 17:45:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480479#M109501</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-04-29T17:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: About Box Object in API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480492#M109503</link>
      <description>&lt;P&gt;You can create several kinds of TransientGeometry objects that have volume, if you don't want to use visible geometry.&lt;/P&gt;&lt;P&gt;Some of the options are:&lt;/P&gt;&lt;P&gt;Box,OrientedBox,Cone,ElipticalCone,Cylinder,ElipticalCylinder,Torus, &amp;amp; Sphere&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 17:53:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480492#M109503</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-04-29T17:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: About Box Object in API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480672#M109507</link>
      <description>&lt;P&gt;I know the API have Box,OrientedBox,Cone,ElipticalCone,Cylinder,ElipticalCylinder,Torus, &amp;amp; Sphere. But we need a mathematical&amp;nbsp;TransientGeometry like a triangle body and a domed shape body such as below. And we don't need it&amp;nbsp; visible, only for mathematically containing purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture_1.PNG" style="width: 222px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/762657i90938CD137227446/image-dimensions/222x182?v=v2" width="222" height="182" role="button" title="Capture_1.PNG" alt="Capture_1.PNG" /&gt;&lt;/span&gt;&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture_2.PNG" style="width: 285px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/762658i30AFC8C1A3879AFF/image-dimensions/285x180?v=v2" width="285" height="180" role="button" title="Capture_2.PNG" alt="Capture_2.PNG" /&gt;&lt;/span&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture_3.PNG" style="width: 170px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/762659iD98C13FFD970F7EB/image-dimensions/170x180?v=v2" width="170" height="180" role="button" title="Capture_3.PNG" alt="Capture_3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:56:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/about-box-object-in-api/m-p/9480672#M109507</guid>
      <dc:creator>liminma8458</dc:creator>
      <dc:date>2020-04-29T18:56:49Z</dc:date>
    </item>
  </channel>
</rss>

