Coordinate systems is GCS_WGS_1984 in the map, and I added
sr = arcpy.SpatialReference(4326)
polygon = arcpy.Polygon(array, sr)
And now I see in the properties that the coord sys are identical but I still get no entry in my log. I do log data from this addin's combo box selection change, but not this. Here's what I'm running.
def onRectangle(self, rectangle_geometry):
ext = rectangle_geometry
array = arcpy.Array()
array.add(arcpy.Point(ext.XMin, ext.YMin))
array.add(arcpy.Point(ext.XMin, ext.YMax))
array.add(arcpy.Point(ext.XMax, ext.YMax))
array.add(arcpy.Point(ext.XMax, ext.YMin))
array.add(arcpy.Point(ext.XMin, ext.YMin))
sr = arcpy.SpatialReference(4326)
polygon = arcpy.Polygon(array, sr)
arcpy.CopyFeatures_management(polygon, "in_memory//Polygon_Extent")
arcpy.MakeFeatureLayer_management("in_memory//Polygon_Extent", 'selectLyr')
arcpy.MakeFeatureLayer_management('events', 'eventsLyr')
f = open(r'E:\ArcMap\BuildingServices\20180411_misassignedInspectors\addin\log.txt','a')
f.write('what the hell?')
f.close()
arcpy.Delete_management("in_memory//Polygon_Extent")
arcpy.Delete_management('selectLyr')
arcpy.Delete_management('eventsLyr')
Nothing is written to the log, but the polygon is created in the map, so the def is running. : (