<?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: Get bodies in Inventor pattern in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10628953#M129008</link>
    <description>&lt;P&gt;im not exactly sure what you are trying to do but if you want to get multiple bodies from a pattern then you should make the pattern like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1631866652491.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966366iCA04103A6EA75FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JelteDeJong_0-1631866652491.png" alt="JelteDeJong_0-1631866652491.png" /&gt;&lt;/span&gt;then you will get multiple bodies.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_1-1631866694624.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966367i30C27DD13C91C97A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JelteDeJong_1-1631866694624.png" alt="JelteDeJong_1-1631866694624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 08:19:19 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2021-09-17T08:19:19Z</dc:date>
    <item>
      <title>Get bodies in Inventor pattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10628883#M129005</link>
      <description>&lt;P&gt;Hello Autodesk,&lt;BR /&gt;&lt;BR /&gt;We want to read bodies in inventor pattern feature (rectangular, Circular, etc)&lt;BR /&gt;&lt;BR /&gt;We tried to read bodies in Pattern feature but it seems it whole pattern bodies as single body.&lt;BR /&gt;&lt;BR /&gt;We tried following code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;PartComponentDefinition partComponentDefinition = this.ivPartDocument.ComponentDefinition;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;RectangularPatternFeatures rectPatternFeatures = partComponentDefinition.Features.RectangularPatternFeatures;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;foreach (RectangularPatternFeature patternFeat in rectPatternFeatures)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;int patternBodiesCount = patternFeat.SurfaceBodies.Count; // Getting 1 body always though pattern contains many instances of a body&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;RectangularPatternFeatureDefinition patterndefinition = patternFeat.Definition;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;foreach (SurfaceBody surfaceBody in patternFeat.SurfaceBodies)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;int patternBodyFacesCount = patternFeat.SurfaceBodies.Faces.Count; // Faces count is total of faces all pattern body instances&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="book antiqua,palatino"&gt;I have attached sample part&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sandeep_vaal_0-1631863961343.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966345i4655E59B8A82D96B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sandeep_vaal_0-1631863961343.png" alt="sandeep_vaal_0-1631863961343.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;We tried differrent API's from RectangularPatternFeature but couldn't get disting bodies from pattern features.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sandeep_vaal_1-1631864164171.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966347i06A97F97112F5975/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sandeep_vaal_1-1631864164171.png" alt="sandeep_vaal_1-1631864164171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We tried many things but couldn't get each body data seperately from PatternFeature&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;PartFeaturesEnumerator partFeatureEnum = surfaceBody.AffectedByFeatures;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;foreach (PartFeature feature in surfaceBody.AffectedByFeatures) //&amp;nbsp;surfaceBody.AffectedByFeatures.Count = 2 but still body is same for each AffectedFeature.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;{ &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;&amp;nbsp; &amp;nbsp;SurfaceBody body = feature.SurfaceBody; // This body&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;Please suggest correct way if possible to achieve this. Looking for fastest resolution.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 07:42:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10628883#M129005</guid>
      <dc:creator>sandeep_vaal</dc:creator>
      <dc:date>2021-09-17T07:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get bodies in Inventor pattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10628953#M129008</link>
      <description>&lt;P&gt;im not exactly sure what you are trying to do but if you want to get multiple bodies from a pattern then you should make the pattern like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1631866652491.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966366iCA04103A6EA75FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JelteDeJong_0-1631866652491.png" alt="JelteDeJong_0-1631866652491.png" /&gt;&lt;/span&gt;then you will get multiple bodies.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_1-1631866694624.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/966367i30C27DD13C91C97A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JelteDeJong_1-1631866694624.png" alt="JelteDeJong_1-1631866694624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 08:19:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10628953#M129008</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-09-17T08:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get bodies in Inventor pattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10629242#M129020</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;But is it possible to get bodies separately without this change somehow through API's? Like for attached part without modifying pattern feature?&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 10:34:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10629242#M129020</guid>
      <dc:creator>sandeep_vaal</dc:creator>
      <dc:date>2021-09-17T10:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get bodies in Inventor pattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10629454#M129032</link>
      <description>&lt;P&gt;If you don't want to change the model to be actual separate bodies, then you have to look at the &lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-AF4EAA82-FD0C-45CF-BC43-EE03E22D5313" target="_blank" rel="noopener"&gt;FaceShells&lt;/A&gt; of the solid body.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;simple sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim pDef As PartComponentDefinition = TryCast(ThisApplication.ActiveDocument.ComponentDefinition, PartComponentDefinition)
If IsNothing(pDef) Then Exit Sub
	
Dim oBody As SurfaceBody = pDef.SurfaceBodies.Item(1)

MessageBox.Show(oBody.FaceShells.Count)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have hollow parts then you will have loop through All FaceShells to look out for Void FaceShells &lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-4A03C1E1-8279-454D-84A5-E4B217F71E0A" target="_blank" rel="noopener"&gt;[FaceShell Object]&lt;/A&gt;, but if not then Count should be sufficient.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 12:31:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10629454#M129032</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2021-09-17T12:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get bodies in Inventor pattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10633945#M129108</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4898893"&gt;@J-Camper&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Actually we need proper separate bodies for further&amp;nbsp; computations. I needed just confirmation that if the pattern is not created without separate bodies we can not get separate bodies using some API's or relational data from Inventor .&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;Thanks for your inputs.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 10:59:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-bodies-in-inventor-pattern/m-p/10633945#M129108</guid>
      <dc:creator>sandeep_vaal</dc:creator>
      <dc:date>2021-09-20T10:59:17Z</dc:date>
    </item>
  </channel>
</rss>

