rwatson83

How to delete a graph via arcpy

Discussion created by rwatson83 on Jul 19, 2012
Latest reply on May 10, 2017 by ed_mtns
After getting the graphs to work, I am interested in cycling through (via a loop of some sort) to create multiple graphs.

My problem is that it appears that the 'graph' is stored in not-easily-referenced memory.

MakeGraph_management is pretty straight forward:

arcpy.MakeGraph_management(graph_grf, graph, "temp")

I can't replace "temp" with a variable (I mean, I can, but its useless) since the sting value is what names the output of MakeGraph.

arcpy.env.overwriteOutput = True  Does noting to help me.

arcpy.Delete_management('temp') looks like it *should* work as the help file indicates "Graph" as a valid input data type, but then I try that I get an error like:
ERROR 000732: Input Data Element: Dataset temp does not exist or is not supported
Failed to execute (Delete).


I suppose I could change the name that gets passed to make graph, and never delete anything but that seems sloppy and I plan on iterating through hundreds if not thousands of inputs... I'd imagine eventually I will run out of memory.

I'm using 10.1, service pack 2 (build 3200) if that matters.  I'm not interested in using other python packages to graph due to organizational constraints.

Any ideas?  Thanks.

Outcomes