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

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!