12-13-2024
02:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-13-2024
02:51 PM
Hi, maybe this will do the trick
Dim offset As Double = 5 '50 mm offset Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument Try ' Get the component definition of the part Dim compDef As PartComponentDefinition = oPartDoc.ComponentDefinition ' Get the workplanes collection Dim workPlanes As WorkPlanes = compDef.WorkPlanes ' Loop through the workplanes in reverse order (to avoid index shifting during deletion) Dim obc As ObjectCollection For i As Integer = workPlanes.Count To 1 Step -1 Dim workPlane As WorkPlane = workPlanes.Item(i) Dim oPoint As Point = workPlane.Plane.RootPoint Dim z As Double = oPoint.Z If offset = oPoint.Z Then workPlane.Delete() End If Next Catch ex As Exception End Try
If a response answers your question, please use ACCEPT SOLUTION to assist other users later.
Also be generous with Likes! Thank you and enjoy!