I am iterating over a shapefile and creating a new shape from each row. I will be creating several thousand individual shapes and do not want to inundate my TOC with that many layers (I bet ArcMap would crash if I did). Using the code below, each shape is added after being created. How could I remove the shape from the TOC after being created? I tried deleting the tempPoly variable but that did not do the trick.
polys = arcpy.SearchCursor(shapefile) #recall the cursor for poly in polys: print('starting at '+str(poly.FID)) whereClause = '"FID" = ' + str(poly.FID ) # Create a clause to select only the current record tempPoly=arcpy.FeatureClassToFeatureClass_conversion(shapefile,tempFilesPath,"tempPoly"+str(poly.FID),whereClause)
I am not working in a dataframe and am in the data view not the layout view.