Skip to main content
Adding code
Source Link
kenbuja
  • 5.9k
  • 2
  • 19
  • 30

You'll have to loop through each feature in the feature class to get a polyline instead of trying to cast the entire featurelayer to a polyline.

*To answer your comment, it would look something like this. You'll have to translate into C#

Dim pFCur As IFeatureCursor
Dim pFeat As IFeature

pFCur = pfc.Search(Nothing, False)
pFeat = pFCur.NextFeature
Do Until pFeat Is Nothing
    Dim pPolyline As IPolyline
    pPolyline = pFeat.ShapeCopy

    'your code to construct the offset

    pFeat = pFCur.NextFeature
Loop

You'll have to loop through each feature in the feature class to get a polyline instead of trying to cast the entire featurelayer to a polyline.

You'll have to loop through each feature in the feature class to get a polyline instead of trying to cast the entire featurelayer to a polyline.

*To answer your comment, it would look something like this. You'll have to translate into C#

Dim pFCur As IFeatureCursor
Dim pFeat As IFeature

pFCur = pfc.Search(Nothing, False)
pFeat = pFCur.NextFeature
Do Until pFeat Is Nothing
    Dim pPolyline As IPolyline
    pPolyline = pFeat.ShapeCopy

    'your code to construct the offset

    pFeat = pFCur.NextFeature
Loop
Source Link
kenbuja
  • 5.9k
  • 2
  • 19
  • 30

You'll have to loop through each feature in the feature class to get a polyline instead of trying to cast the entire featurelayer to a polyline.