When I used arcgisscripting to create in-memory output layer with gp.makefeaturelayer, I would put it in a try/except block and delete the gp object in the except piece when the makefeaturelayer would fail. Now when I am using arcpy, it looks like I need to close the idle window and open again in order to get the in-memory output layer to get deleted.
How could I have the output layer from my makefeaturelayer tool get deleted in a try/except block? Thanks.
Answer
arcpy.Delete_management(featureLayer)
No comments:
Post a Comment