<?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: Create a workfeature in a Part FROM an Assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-workfeature-in-a-part-from-an-assembly/m-p/10050577#M120643</link>
    <description>&lt;P&gt;Typical, you struggle for ages, post it on the forum and fix it straight away!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;For Each outerLoop In oFace.EdgeLoops&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;For Each outerLoop In oFace.&lt;FONT color="#339966"&gt;NativeObject&lt;/FONT&gt;.EdgeLoops&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 12:57:24 GMT</pubDate>
    <dc:creator>MattH_Work</dc:creator>
    <dc:date>2021-02-02T12:57:24Z</dc:date>
    <item>
      <title>Create a workfeature in a Part FROM an Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-workfeature-in-a-part-from-an-assembly/m-p/10050554#M120642</link>
      <description>&lt;P&gt;&lt;FONT color="#333333"&gt;Using the API, can I create a workpoint in a Part, using the face of that Part selected within its Parent Assembly?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;(to reiterate, I want to select the Part in the Assembly, and the workfeature MUST be created in the Part NOT the Assembly)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;I can get the Face using&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;oFace = oApp.CommandManager.Pick(Inventor.SelectionFilterEnum.kPartFaceFilter, "Pick Face")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;I can get the Part using&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Dim oOcc As Inventor.ComponentOccurrence&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;oOcc = oFace.ContainingOccurrence&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Dim oPartCompDef As Inventor.PartComponentDefinition&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;oPartCompDef = oOcc.Definition&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;But I cannot create a workpoint&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Dim outerLoop As Inventor.EdgeLoop = Nothing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;For Each outerLoop In oFace.EdgeLoops&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;If outerLoop.IsOuterEdgeLoop Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Exit For&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;End If&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Next&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Dim oWorkPoint As Inventor.WorkPoint&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;oWorkPoint = oPartCompDef.WorkPoints.AddAtCentroid(outerLoop)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;oWorkpoint comes back equalling 'Nothing'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;Thanks in advance&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 12:50:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-workfeature-in-a-part-from-an-assembly/m-p/10050554#M120642</guid>
      <dc:creator>MattH_Work</dc:creator>
      <dc:date>2021-02-02T12:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a workfeature in a Part FROM an Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-workfeature-in-a-part-from-an-assembly/m-p/10050577#M120643</link>
      <description>&lt;P&gt;Typical, you struggle for ages, post it on the forum and fix it straight away!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;For Each outerLoop In oFace.EdgeLoops&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;For Each outerLoop In oFace.&lt;FONT color="#339966"&gt;NativeObject&lt;/FONT&gt;.EdgeLoops&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 12:57:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-workfeature-in-a-part-from-an-assembly/m-p/10050577#M120643</guid>
      <dc:creator>MattH_Work</dc:creator>
      <dc:date>2021-02-02T12:57:24Z</dc:date>
    </item>
  </channel>
</rss>

