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

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#.

 

 

Dim part As PartDocument = ThisDoc.Document
Dim wPoints As WorkPoints = part.ComponentDefinition.WorkPoints

Dim undeletablePoints As Integer = 0

Do While wPoints.Count > undeletablePoints
	Dim wPoint As WorkPoint = wPoints(undeletablePoints + 1)
	Try
		wPoint.Delete()
	Catch
		undeletablePoints += 1
	End Try
Loop