Select to view content in your preferred language

"The specified splitting distance is not included in the curve to be split."

597
2
02-01-2012 07:32 AM
MarAlcaraz1
Emerging Contributor
Hi everyone,

I am trying to run the IPolygon.SplitAtPoint method in this code. But I get a runtime-error:

"The specified splitting distance is not included in the curve to be split."

I am trying to insert new vertex in polygon features. Any idea??? Thanks!!!


Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMap As IMap
Set pMap = pMxDoc.FocusMap

Dim pFLayer As IFeatureLayer
Set pFLayer = pMap.Layer(0)

Dim pFeatClass As IFeatureClass
Set pFeatClass = pFLayer.FeatureClass

Dim pPointLayer As IFeatureLayer
Set pPointLayer = pMap.Layer(1)

Dim pFCPoint As IFeatureClass
Set pFCPoint = pPointLayer.FeatureClass

For i = 0 To pFeatClass.FeatureCount(Nothing)
Dim pFeat As IFeature
Set pFeat = pFeatClass.GetFeature(i)

Dim pPoly As IPolygon
Set pPoly = pFeat.Shape

For j = 0 To pFCPoint.FeatureCount(Nothing)
Dim pFPoint As IFeature
Set pFPoint = pFCPoint.GetFeature(j)

Dim pPColl As IPointCollection
Set pPColl = pFPoint.Shape

Dim pPoint As IPoint
Set pPoint = pPColl.Point(0)

Dim path As Long
Dim ring As Long

pPoly.SplitAtPoint pPoint, False, False, False, path, ring => Runtime errorr!!!
Next
Next
0 Kudos
2 Replies
WeifengHe
Esri Contributor
This error message means the input point is not on the polygon boundry.  Try to change the second parameter to true.
0 Kudos
MarAlcaraz1
Emerging Contributor
I tried different combinations of true and false for these parameters. There is no error, but the polygon is not splitted neither,
there aren't new vertex in it. Should I look for another function???

Thanks, Mar
0 Kudos