Basically, I am trying to generate polygon geometries based on the selection of another polygon layer. These polygons will be copied into a new empty schema. I avoiding using the Append and Copy operations since they won't meet all the requirements needed for my output. I also found the cursors help me achieving the desired result way faster. As a result, I need to print the polygon coordinates as one single line text string instead of multi-line. This output will be used as a variable to generate the polygon later in the code.
for row in arcpy.da.SearchCursor("countAddrPnts_lyr", ["OID@", "SHAPE@", "SITUS_STREET_NUMBER_END2", "SITUS_STREET_NUMBER2"]):
x = 0
for part in row[1]:
for pnt in part:
if pnt:
pntArray = ("arcpy.Point(" + "{}, {}".format(pnt.X, pnt.Y) + "),")
print pntArray
x += 1
The current output looks like this:
arcpy.Point(907781.079669, 628629.095669),
arcpy.Point(907782.765669, 628579.116669),
arcpy.Point(907649.596669, 628574.910669),
arcpy.Point(907647.068669, 628649.878669),
arcpy.Point(907780.236669, 628654.092669),
arcpy.Point(907781.079669, 628629.095669),
I need it to look as follows:
arcpy.Point(907781.079669, 628629.095669), arcpy.Point(907782.765669, 628579.116669), arcpy.Point(907649.596669, 628574.910669), arcpy.Point(907647.068669, 628649.878669), arcpy.Point(907780.236669, 628654.092669), arcpy.Point(907781.079669, 628629.095669)
Maybe my approach is not the correct one, so any suggestions will be welcome.
BTW, I am not a programmer per se therefore, my code will not be the prettiest but it is doing the job.
In this other post you can download the data in GDB format, as well as the py script.