ddurgaprasad

Polygon Buffer - How to set  FLAT corner paramater

Discussion created by ddurgaprasad on Jan 23, 2012
Latest reply on Dec 13, 2012 by govindgrp
How do I modify the code below to get the Buffer polygon with FLAT corners


Sub MyCreatePolygonBuffer()

    Dim pMap As IMap
   Dim pMxDoc As IMxDocument
   Dim pFeatureClass As IFeatureClass
   Dim pFeatureLayer As IFeatureLayer
   Dim pFeatureCursor As IFeatureCursor
   Dim pOutFeatureCursor As IFeatureCursor
   Dim pfeature As IFeature
   
   'Split lines for selected layer
   Set pMxDoc = ThisDocument
   If Not pMxDoc.SelectedLayer Is Nothing Then
     Set pFeatureLayer = pMxDoc.SelectedLayer
   Else
      MsgBox "Please select a polygon layer to buffer"
      Exit Sub
   End If
      
    Dim pLayerInnerPolygon As IFeatureLayer
    Dim pLayerOuterPolygon As IFeatureLayer
    
    Set pMap = pMxDoc.FocusMap
    Set pLayerInnerPolygon = pMap.Layer(0)
    
   Set pFeatureClass = pLayerInnerPolygon.featureClass
   Set pFeatureCursor = pFeatureClass.Update(Nothing, False)
   Set pfeature = pFeatureCursor.NextFeature
    
   Dim pBufferConstruction  As IBufferConstruction
   Set pBufferConstruction = New BufferConstruction
   
   Dim pBufferPolygon As IPolygon
   Set pBufferPolygon = New polygon
   
  'How to make use of this property ?
   'Dim pBufferConstructionProperties As IBufferConstructionProperties
  ' pBufferConstructionProperties.EndOption = esriBufferFlat
   
   Do Until pfeature Is Nothing
            Dim pPolygon As IPolygon
            Set pPolygon = pfeature.Shape
            Set pBufferPolygon = pBufferConstruction.Buffer(pPolygon, 10)
            Set pfeature = pFeatureCursor.NextFeature
  Loop    

 AddPolygonToGraphicsLayer pBufferPolygon

End Sub

Outcomes