<?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 Select set and function member being cancelled in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-set-and-function-member-being-cancelled/m-p/10176768#M51710</link>
    <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a strange one for me, hopefully i can get answer to-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am create a Face member&lt;/P&gt;&lt;P&gt;Dim oFace As Face&lt;/P&gt;&lt;P&gt;Set oFace = oApp.CommandManager.Pick(kAllPlanarEntities, "pick face 1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this face with another face selection to get an edge (see other recent posts)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;long story short, when i run a Sweep function, oFace becomes empty. I am checking the Edge count and the moment the Sweep is initiated, i lose the face and edge count. I added an ObjectCollection and assigned the face to it which still remains in the collection after the Sweep but i am unable to reasign oFace as the Collection object... There is only 1 face in the collection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could cause this behavior? I have turned off any error trapping and nothing is occurring.. My Sweep code is this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Add(oWP, False)

Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

Dim oLine As SketchLine3D
Set oLine = oSketch3D.Include(oEdge)

Dim oPath As Path
Set oPath = oCompDef.Features.CreatePath(oLine)

Dim SweepFeats As SweepFeatures
Set SweepFeats = oPartDoc.ComponentDefinition.Features.SweepFeatures

Dim spDef As SweepDefinition
Set spDef = SweepFeats.CreateSweepDefinition(kPathSweepType, oProfile, oPath, kCutOperation)

Dim sp As SweepFeature
Set sp = SweepFeats.Add(spDef) 'this line changes oFace to nothing



&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Mar 2021 17:18:36 GMT</pubDate>
    <dc:creator>NachoShaw</dc:creator>
    <dc:date>2021-03-22T17:18:36Z</dc:date>
    <item>
      <title>Select set and function member being cancelled</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-set-and-function-member-being-cancelled/m-p/10176768#M51710</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a strange one for me, hopefully i can get answer to-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am create a Face member&lt;/P&gt;&lt;P&gt;Dim oFace As Face&lt;/P&gt;&lt;P&gt;Set oFace = oApp.CommandManager.Pick(kAllPlanarEntities, "pick face 1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this face with another face selection to get an edge (see other recent posts)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;long story short, when i run a Sweep function, oFace becomes empty. I am checking the Edge count and the moment the Sweep is initiated, i lose the face and edge count. I added an ObjectCollection and assigned the face to it which still remains in the collection after the Sweep but i am unable to reasign oFace as the Collection object... There is only 1 face in the collection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could cause this behavior? I have turned off any error trapping and nothing is occurring.. My Sweep code is this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Add(oWP, False)

Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

Dim oLine As SketchLine3D
Set oLine = oSketch3D.Include(oEdge)

Dim oPath As Path
Set oPath = oCompDef.Features.CreatePath(oLine)

Dim SweepFeats As SweepFeatures
Set SweepFeats = oPartDoc.ComponentDefinition.Features.SweepFeatures

Dim spDef As SweepDefinition
Set spDef = SweepFeats.CreateSweepDefinition(kPathSweepType, oProfile, oPath, kCutOperation)

Dim sp As SweepFeature
Set sp = SweepFeats.Add(spDef) 'this line changes oFace to nothing



&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 17:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-set-and-function-member-being-cancelled/m-p/10176768#M51710</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2021-03-22T17:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select set and function member being cancelled</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-set-and-function-member-being-cancelled/m-p/10177530#M51711</link>
      <description>&lt;P&gt;realised that when the Sweep Feature was implemented, the original selected face no longer existed as it was different.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 21:53:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-set-and-function-member-being-cancelled/m-p/10177530#M51711</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2021-03-22T21:53:53Z</dc:date>
    </item>
  </channel>
</rss>

