Using SelectByLocation and Buffer_Analysis - strange behavior

Discussion created by MadsGren on Sep 28, 2011
Latest reply on Oct 3, 2011 by MadsGren
Hi, I'm using this little piece of code...

i've already made a featurelayer called sublayer and analyselayer

arcpy.SelectLayerByLocation_management(sublayer, 'WITHIN_A_DISTANCE', analyseLayer, bufferSize, "NEW_SELECTION")
            if arcpy.GetCount_management(sublayer):
                arcpy.AddMessage('SelByLoc WithinADistance : ' + str(arcpy.GetCount_management(sublayer)))
                arcpy.Buffer_analysis(sublayer, 'in_memory/'+bufferOut, bufferSize + ' Meters','FULL', 'ROUND', 'NONE')

but when i run it, it makes a buffer in all the features in sublayer, shouldent it only make a buffer on selected features ?