<?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: Delete workpoints and workaxis using API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803272#M132091</link>
    <description>&lt;P&gt;This is because some workpoints is undeletable (Origin workpoint for example) and work point collection changes after each delete. Use following iLogic snippet for delete all workpoints in part. You need to translate it to C#.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim part As PartDocument = ThisDoc.Document
Dim wPoints As WorkPoints = part.ComponentDefinition.WorkPoints

Dim undeletablePoints As Integer = 0

Do While wPoints.Count &amp;gt; undeletablePoints
	Dim wPoint As WorkPoint = wPoints(undeletablePoints + 1)
	Try
		wPoint.Delete()
	Catch
		undeletablePoints += 1
	End Try
Loop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 10:39:11 GMT</pubDate>
    <dc:creator>Michael.Navara</dc:creator>
    <dc:date>2021-12-06T10:39:11Z</dc:date>
    <item>
      <title>Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10802984#M132089</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to delete the work points but getting an unspecified error in the delete line.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;      public static void DeletePoints(string wpoint)
        {
            AssemblyComponentDefinition assCompDef = assyDoc.ComponentDefinition;
            for (int i = 1; i &amp;lt;= assCompDef.WorkPoints.Count; i++)
            {
                try
                {
                    if (assCompDef.WorkPoints[i].Name== wpoint)
                    {
                        assCompDef.WorkPoints[i].Delete();
                    }
                }
                catch (Exception)
                {

                  
                }
               
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:41:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10802984#M132089</guid>
      <dc:creator>nishantkumat5921</dc:creator>
      <dc:date>2021-12-06T07:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803272#M132091</link>
      <description>&lt;P&gt;This is because some workpoints is undeletable (Origin workpoint for example) and work point collection changes after each delete. Use following iLogic snippet for delete all workpoints in part. You need to translate it to C#.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim part As PartDocument = ThisDoc.Document
Dim wPoints As WorkPoints = part.ComponentDefinition.WorkPoints

Dim undeletablePoints As Integer = 0

Do While wPoints.Count &amp;gt; undeletablePoints
	Dim wPoint As WorkPoint = wPoints(undeletablePoints + 1)
	Try
		wPoint.Delete()
	Catch
		undeletablePoints += 1
	End Try
Loop&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 10:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803272#M132091</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2021-12-06T10:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803440#M132092</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1104556"&gt;@Michael.Navara&lt;/a&gt;&amp;nbsp;for the quick reply. But the below code does not delete the work points. It goes to the catch statement and adds on&amp;nbsp;undeletablePoints.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 12:22:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803440#M132092</guid>
      <dc:creator>nishantkumat5921</dc:creator>
      <dc:date>2021-12-06T12:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803588#M132093</link>
      <description>&lt;P&gt;This code deletes all workpoints which can be deleted. Some workpoints can't be deleted. Part origin, USS origins, derived workpoints, etc.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 13:37:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10803588#M132093</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2021-12-06T13:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805413#M132128</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9852170"&gt;@nishantkumat5921&lt;/a&gt;&amp;nbsp;the delete method will fail for derived parts . Check this link for inventor docs&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-7FE2414C-DAAB-4D61-85D8-BA7AC9FF1F20" target="_blank"&gt;Inventor 2022 Help | WorkPoint.Delete Method | Autodesk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 06:17:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805413#M132128</guid>
      <dc:creator>fidel.makatiaD5W7V</dc:creator>
      <dc:date>2021-12-07T06:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805418#M132130</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11310889"&gt;@fidel.makatiaD5W7V&lt;/a&gt;&amp;nbsp;I have tried both the Booleans option and still get an unspecified error. The part is not derived.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 06:23:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805418#M132130</guid>
      <dc:creator>nishantkumat5921</dc:creator>
      <dc:date>2021-12-07T06:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete workpoints and workaxis using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805453#M132132</link>
      <description>&lt;P&gt;Can you provide a screenshot of the workpoints location in the assembly?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 07:01:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-workpoints-and-workaxis-using-api/m-p/10805453#M132132</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2021-12-07T07:01:35Z</dc:date>
    </item>
  </channel>
</rss>

