This is possible interactively:
I used Trim operation.
Thanks a lot.
I could get programmatic equivalent as well....as below ..see if its ok/correct (or can it be better)
Sub Split()
Dim oDoc As PartDocument
oDoc = _invApp.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
'arguments
Dim oWS1 As WorkSurface
oWS1 = oCompDef.WorkSurfaces(1)
Dim cntws As Integer = oCompDef.WorkSurfaces.Count
Dim oObjColl As ObjectCollection
oObjColl = _invApp.TransientObjects.CreateObjectCollection()
Dim cntsrf As Integer = oCompDef.SurfaceBodies.Count
Dim oSurface As SurfaceBody 'WorkSurface
oSurface = oCompDef.Features.ExtrudeFeatures.Item("ExtrusionSrf1").SurfaceBodies.Item(1)
Dim cntsrffa As Integer = oSurface.Faces.Count
Dim oSolid As SurfaceBody 'Cylinder
oSolid = oCompDef.SurfaceBodies.Item(1)
Dim oFace As Face
For Each oFace In oSurface.Faces
oObjColl.Add(oFace)
Next
Dim oSplit As SplitFeature
oSplit = oCompDef.Features.SplitFeatures.SplitFaces(oSolid, False, oObjColl)
Dim oFaceColl As FaceCollection
oFaceColl = _invApp.TransientObjects.CreateFaceCollection
Dim orFace As Face = oSurface.Faces.Item(1) ' hardcoded for test
oFaceColl.Add(orFace)
' can I avoid following extra feature call
Dim oDeleteFace As DeleteFaceFeature
oDeleteFace = oCompDef.Features.DeleteFaceFeatures.Add(oFaceColl)
oCompDef.SurfaceBodies.Item(1).Visible = False
End Sub
Shame it does not seem possible to create a TrimFeature (that Vladimir used in the UI) through the API.
If you go with SplitFeature, I guess you'll have to delete the face by yourself, as you are doing it now.