Add a field named YOL_NAME to Kapi layer, select a feature, then run the following script. (First, backup Kapi and Yol layer data sources)
yol_layer = "Yol"
yol_name_field = "AD" # yol name field in yol layer
kapi_layer = "Kapi"
kapi_yol_field = "YOL_NAME" # newly added yol name field in kapi layer to be populated
with arcpy.da.UpdateCursor(kapi_layer, ["SHAPE@", kapi_yol_field]) as cursor:
for kapi in cursor:
yol_cursor = arcpy.da.SearchCursor(yol_layer, ["SHAPE@", yol_name_field])
# distance dictionary {"AD": distane, "AD": distance, ...}
ds = {yol[1]: kapi[0].distanceTo(yol[0]) for yol in yol_cursor}
k = min(ds, key=ds.get) # get the key ("AD") with minimum value
d = ds[k] # get the minimum value
# set "YOL_NAME" based on min value is less than 5 or not
kapi[1] = k if d <= 5 else ''
cursor.updateRow(kapi)
print("Yol Name: " + k)
del yol_cursor
Notes:
- If there is no road in 5 m, it writes empty string to
YOL_NAME.
- If there are multiple roads within 5 m, then it gets the minimum one.
- When you have a selection, a
cursor will use only the selected ones. That means if you select nothing, the script will use all point features.
Example:

To print all road names within 5m use this script:
...
distance = 5
with arcpy.da.SearchCursor(kapi_layer, ["SHAPE@"]) as cursor:
for kapi in cursor:
yol_cursor = arcpy.da.SearchCursor(yol_layer, ["SHAPE@", yol_name_field])
# distance dictionary {"AD": distane, "AD": distance, ...}
ds = {yol[1]: kapi[0].distanceTo(yol[0]) for yol in yol_cursor}
names = [ds[i] for i in ds if ds[i] <= distance]
print(names)
del yol_cursor