Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
nishantkumat5921
458 Views, 6 Replies

Delete workpoints and workaxis using API

Hello,

I am trying to delete the work points but getting an unspecified error in the delete line.

      public static void DeletePoints(string wpoint)
        {
            AssemblyComponentDefinition assCompDef = assyDoc.ComponentDefinition;
            for (int i = 1; i <= assCompDef.WorkPoints.Count; i++)
            {
                try
                {
                    if (assCompDef.WorkPoints[i].Name== wpoint)
                    {
                        assCompDef.WorkPoints[i].Delete();
                    }
                }
                catch (Exception)
                {

                  
                }
               
            }
        }

 

Thanks in advance.