<?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: Code to re-select edge? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6323407#M63833</link>
    <description>&lt;P&gt;Can you loop through all of the edges in the second part comparing if oEdgeNew.TransientKey equals oEdge.TransientKey?&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 16:55:03 GMT</pubDate>
    <dc:creator>NSBowser</dc:creator>
    <dc:date>2016-05-12T16:55:03Z</dc:date>
    <item>
      <title>Code to re-select edge?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6320706#M63810</link>
      <description>&lt;P&gt;I can use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oEdge = oApp.CommandManager.Pick(Inventor.SelectionFilterEnum.kPartEdgeCircularFilter, "Select an edge.") to grab an edge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From 'oEdge' I can get the occurence of the owning part ( Occurrence = oEdge.Parent.Parent )&lt;/P&gt;&lt;P&gt;I can get the unique identifier from 'oEdge' using oEdge.TransientKey (?) which will then allow me to iterate another occurence of the same part and find the equivalent edge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I then select the 'new' edge programmatically but with the same outcome/properties as oApp.CommandManager.Pick (ie I need to get the occurence name from the newly selected edge via&amp;nbsp; Occurrence = oNewEdge.Parent.Parent)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MattH&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 15:18:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6320706#M63810</guid>
      <dc:creator>MattH_Work</dc:creator>
      <dc:date>2016-05-11T15:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Code to re-select edge?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6323407#M63833</link>
      <description>&lt;P&gt;Can you loop through all of the edges in the second part comparing if oEdgeNew.TransientKey equals oEdge.TransientKey?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 16:55:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6323407#M63833</guid>
      <dc:creator>NSBowser</dc:creator>
      <dc:date>2016-05-12T16:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Code to re-select edge?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6324624#M63847</link>
      <description>&lt;P&gt;As it happens, that is exactly what I am already doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the oApp.CommandManager.Pick method I can get the occurence owner of the edge by Occurrence = oEdge.Parent.Parent because there is a value to the effect of &lt;FONT color="#0000FF"&gt;oEdge.Parent.Parent.occurence = "Part1:1"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I iterate the second occurence's edges, find the matching TransientKey, then drill down there is no &lt;FONT color="#0000FF"&gt;oEdge&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;.Parent.Parent.&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;occurence&lt;/FONT&gt; &lt;FONT color="#000000"&gt;entry, therefore the code I subsiquently use, which relies on both the &lt;FONT color="#0000FF"&gt;oEdge&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;&lt;/FONT&gt; reference and its resulting &lt;FONT color="#0000FF"&gt;oEdge&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;.Parent.Parent.occurence = "&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000FF"&gt;Part1:&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;"&lt;/FONT&gt; does not work because I am failing to get the &lt;FONT color="#0000FF"&gt;oEdge&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;.Parent.Parent.occurence = "Part1:&lt;FONT color="#008000"&gt;2&lt;/FONT&gt;"&lt;/FONT&gt; element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 11:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6324624#M63847</guid>
      <dc:creator>MattH_Work</dc:creator>
      <dc:date>2016-05-13T11:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Code to re-select edge?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6349808#M64194</link>
      <description>&lt;P&gt;I do not know how your workflow is, i normally search for identic edges like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Select_Same_Edges()
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = oApp.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = oAsmDoc.ComponentDefinition
Dim oSelectedEdge As EdgeProxy
Set oSelectedEdge = ThisApplication.CommandManager.Pick(kPartEdgeCircularFilter, "Celect circular edge")
'Occurrence ermitteln
Dim oSelectedOcc As Inventor.ComponentOccurrence
Set oSelectedOcc = oSelectedEdge.Parent.Parent

'Loop through all occs of the assembly, if want all oOccs (inc. child-occs) you have to write a recursive function
Dim oOcc As ComponentOccurrence
For Each oOcc In oAsmCompDef.Occurrences
    Dim oEdge As Edge
    If TypeOf oOcc.Definition.Document Is PartDocument Then
        For Each oEdge In oOcc.Definition.SurfaceBodies.Item(1).Edges
            If oEdge Is oSelectedEdge.NativeObject Then
                 Dim oEdgeProxy As EdgeProxy
                 Call oOcc.CreateGeometryProxy(oEdge, oEdgeProxy)
                 Call oAsmDoc.SelectSet.Select(oEdgeProxy)
            End If
        Next
    End If
Next
End Sub&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2016 05:03:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/code-to-re-select-edge/m-p/6349808#M64194</guid>
      <dc:creator>dg2405</dc:creator>
      <dc:date>2016-05-26T05:03:00Z</dc:date>
    </item>
  </channel>
</rss>

