There is a problem in my arcgis add-in when I try to create layer from selected features of 'fc' layer, add-in button creates layer from all features of 'fc' layer not only selected features. When i try to do this process in arcmap python window, it works for both Make Feature layer management and copy features management. But in add-in it doesn't work for both analyses.
Here is my code:
class ButtonClass17(object):
"""Implementation for PPPpoint_addin.button_2 (Button)"""
fc = r"C:\New_Geodatabase.gdb\test"
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
arcpy.MakeFeatureLayer_management(fc,'kapi3')