This project is read-only.

BufferByDistance on Shapefile

Nov 1, 2011 at 1:04 AM

Hello all,

Has anyone used the "BufferByDistance" function in the VBA environment? Using the code below, I was able to get to the message box that tells me how many shapes are selected within my shapefile, but when it trys to execute the "BufferByDistance" function, the entire application simply disappears with no error message. I tried the same code block below with the "Aggregate" function and it worked fine. Any ideas?

Thanks in advance!


Dim result As MapWinGIS.Shapefile
Dim sf As MapWinGIS.Shapefile

Set sf = ActiveSheet.MapWindow.GetObject(hnd_DATA)

If Not sf Is Nothing Then
	MsgBox "About to buffer " & sf.NumSelected & " shapes."
        result = sf.BufferByDistance(CDbl(200), CInt(20), True, False)
        MsgBox "Buffered Data"
        hnd_DATA = map.AddLayer(result, True)
End If