12-06-2021
02:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-06-2021
02:38 AM
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