<?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: adding a sub-component as a participant in an assembly feature in iLogic/API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/adding-a-sub-component-as-a-participant-in-an-assembly-feature/m-p/3005834#M140694</link>
    <description>&lt;P&gt;Below sample will show how to implement it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub AddParticipantSample()
    &lt;FONT color="#008000"&gt;' New an assembly, place a sub-assembly which has two occurrences
    ' create an extrude feature on the first occurrence of the sub-assembly
&lt;/FONT&gt;    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oExtrude As ExtrudeFeature
    Set oExtrude = oDoc.ComponentDefinition.Features.ExtrudeFeatures(1)
    
    Dim oOcc As ComponentOccurrence
    Set oOcc = oDoc.ComponentDefinition.Occurrences(1)
    
    Dim oSubOccProxy As ComponentOccurrenceProxy
    oOcc.CreateGeometryProxy oOcc.SubOccurrences(2), &lt;STRONG&gt;oSubOccProxy&lt;/STRONG&gt;
    
    oExtrude.AddParticipant oSubOccProxy
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You may want to see a topic in API document titled "Introduction to proxies", it will explain the concept of proxy. Hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2011 06:55:39 GMT</pubDate>
    <dc:creator>YuhanZhang</dc:creator>
    <dc:date>2011-04-28T06:55:39Z</dc:date>
    <item>
      <title>adding a sub-component as a participant in an assembly feature in iLogic/API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/adding-a-sub-component-as-a-participant-in-an-assembly-feature/m-p/3004978#M140693</link>
      <description>&lt;P&gt;Is there a trick to making a sub-component participate in a feature (ExtrudeFeature, SweepFeature, etc.)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using the SweepFeature.AddParticipant(ComponentOccurrence) and ExtrudeFeature(ComponentOccurrence) functions, and both work fine when the ComponentOcurrence is a direct component of the assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I explode down another level, and pass in a ComponentOccurrence for a sub-component, I get an INVALID_ARG error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do this manually in the Inventor model browser.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I worked around the problem by collapsing the assembly structure, but now my customer is pressing me "to do it right".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If necessary, I'll reconstruct a the code snippet that was failing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&amp;nbsp; thanks&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 17:54:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/adding-a-sub-component-as-a-participant-in-an-assembly-feature/m-p/3004978#M140693</guid>
      <dc:creator>MikeGillam5072</dc:creator>
      <dc:date>2011-04-27T17:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: adding a sub-component as a participant in an assembly feature in iLogic/API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/adding-a-sub-component-as-a-participant-in-an-assembly-feature/m-p/3005834#M140694</link>
      <description>&lt;P&gt;Below sample will show how to implement it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub AddParticipantSample()
    &lt;FONT color="#008000"&gt;' New an assembly, place a sub-assembly which has two occurrences
    ' create an extrude feature on the first occurrence of the sub-assembly
&lt;/FONT&gt;    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oExtrude As ExtrudeFeature
    Set oExtrude = oDoc.ComponentDefinition.Features.ExtrudeFeatures(1)
    
    Dim oOcc As ComponentOccurrence
    Set oOcc = oDoc.ComponentDefinition.Occurrences(1)
    
    Dim oSubOccProxy As ComponentOccurrenceProxy
    oOcc.CreateGeometryProxy oOcc.SubOccurrences(2), &lt;STRONG&gt;oSubOccProxy&lt;/STRONG&gt;
    
    oExtrude.AddParticipant oSubOccProxy
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You may want to see a topic in API document titled "Introduction to proxies", it will explain the concept of proxy. Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2011 06:55:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/adding-a-sub-component-as-a-participant-in-an-assembly-feature/m-p/3005834#M140694</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2011-04-28T06:55:39Z</dc:date>
    </item>
  </channel>
</rss>

