How to cut geometric elements
Ifeatureedit example
'Assume pset (Iset) and pmovevector (iline) already exist.
Dim punknown as iunknown, pfeatureedit as ifeatureedit
Set punknown = pset. Next
Do While punknown is not nothing
Set pfeatureedit = punknown
Pfeatureedit. moveset pset, pmovevector
Set punknown = pset. Next
Loop
The following code is an example of one way you cocould split a selected polygon features by a polyline.
Public sub splitfeatures (pselectionset as iselectionset, ppolyline as ipolympus)
'Open a feature cursor on the selected features that
'Intersect the splitting geometry
Dim pfeatcursor as ifeaturecursor
Dim pspatialfilter as ispatialfilter
Set pspatialfilter = new spatialfilter
Set pspatialfilter. Geometry = ppolyline
Pselectionset. Search pspatialfilter, true, pfeatcursor
'Clean up the splitting geometry
'This is necessary because, for polygons, ifeatureedit: Split
'Relies internally on itopologicaloperator: Cut
Dim ptopoopo as itopologicaloperator
Set ptopoopo = ppolyline
Ptopoopo. Simplify
'Loop through the features and split them
Dim pfeature as ifeature
Set pfeature = pfeatcursor. nextfeature
Do until pfeature is nothing
Dim pfeatureedit as ifeatureedit
Set pfeatureedit = pfeature
Pfeatureedit. Split ppolyline
Set pfeature = pfeatcursor. nextfeature
Loop
End sub