Select to view content in your preferred language

Can I safely clear out XML files from ArcToolBox History folder?

1124
4
Jump to solution
09-19-2022 04:43 PM
DarrenConly
Regular Contributor

Greetings All,

 

I'm doing a clean-out of my drive and noticed I have over 5GB of XML files in the following folder:

DarrenConly_0-1663630861662.png

 

Can I delete these without hurting anything? Should I delete through the File Explorer or can I do so through Arc Pro?

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Here are your candidate environments accessed via arcpy.

I work on one machine, using locally stored data, so yours will differ.  I have nothing in the ...  Appdata\ Roaming ... folder at all

 

import arcpy

environments = arcpy.ListEnvironments()

environments.sort()

for environment in environments:
    # Format and print each environment and its current setting.
    # (The environments are accessed by key from arcpy.env.)
    print("{0:<30}: {1}".format(environment, arcpy.env[environment]))
    
MDomain                       : None
MResolution                   : None
MTolerance                    : None
S100FeatureCatalogueFile      : None
XYDomain                      : None
XYResolution                  : None
XYTolerance                   : None
ZDomain                       : None
ZResolution                   : None
ZTolerance                    : None
addOutputsToMap               : True
annotationTextStringFieldLength: None
autoCancelling                : True
autoCommit                    : 1000
baDataSource                  : None
baNetworkSource               : None
baUseDetailedAggregation      : False
buildStatsAndRATForTempRaster : True
cartographicCoordinateSystem  : None
cartographicPartitions        : None
cellAlignment                 : DEFAULT
cellSize                      : MAXOF
cellSizeProjectionMethod      : CONVERT_UNITS
coincidentPoints              : MEAN
compression                   : LZ77
configKeyword                 : None
extent                        : None
geographicTransformations     : None
gpuId                         : 0
isCancelled                   : False
maintainAttachments           : True
maintainCurveSegments         : None
maintainSpatialIndex          : False
mask                          : None
matchMultidimensionalVariable : True
nodata                        : NONE
outputCoordinateSystem        : None
outputMFlag                   : Same As Input
outputZFlag                   : Same As Input
outputZValue                  : None
overwriteOutput               : False
packageWorkspace              : C:\Users\dan_p\AppData\Local\Temp
parallelProcessingFactor      : None
preserveGlobalIds             : False
processingServer              : None
processingServerPassword      : None
processingServerUser          : None
processorType                 : None
pyramid                       : PYRAMIDS -1 NEAREST DEFAULT 75 NO_SKIP NO_SIPS
qualifiedFieldNames           : True
randomGenerator               : 0 ACM599
rasterStatistics              : STATISTICS 1 1
recycleProcessingWorkers      : None
referenceScale                : None
resamplingMethod              : NEAREST
retryOnFailures               : None
scratchFolder                 : C:\Users\dan_p\AppData\Local\Temp\scratch
scratchGDB                    : C:\Users\dan_p\AppData\Local\Temp\scratch.gdb
scratchWorkspace              : None
scriptWorkspace               : C:\Users\dan_p\AppData\Local\Temp
snapRaster                    : None
terrainMemoryUsage            : False
tileSize                      : 128 128
tinSaveVersion                : CURRENT
transferDomains               : False
transferGDBAttributeProperties: False
unionDimension                : False
workspace                     : None

 

 

 

you might want to look at

GetLogHistory—ArcGIS Pro | Documentation

and

SetLogHistory—ArcGIS Pro | Documentation

GetLogMetadata—ArcGIS Pro | Documentation 

and

SetLogMetadata—ArcGIS Pro | Documentation

it looks like it can be shut off

 

.. 


... sort of retired...

View solution in original post

4 Replies
DanPatterson
MVP Esteemed Contributor

Analysis tab, left most tool on 2nd row... aka History.... click it.

Select and delete all that you don't want.

Check your options in Project, Options

history.png


... sort of retired...
0 Kudos
DarrenConly
Regular Contributor

Hi @DanPatterson, Thanks for quick reply.

Referring to your Options screenshot, I confirmed that the "log to XML" box is un-checked.

Based on a test, the XML files appear to get created when I run a python script that uses arcpy outside of Pro, e.g., when I run through VSCode or some similar interpreter. Specifically, when I ran a script via VSCode, it made a new XML file, but when I ran the same script via a Pro toolbox, it didn' t create an XML file.

So it seems like running arcpy script outside of Pro creates the XML file? I wonder if there's some env parameter you can set in the script to prevent creation of XML files?

 

Thanks,

 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Here are your candidate environments accessed via arcpy.

I work on one machine, using locally stored data, so yours will differ.  I have nothing in the ...  Appdata\ Roaming ... folder at all

 

import arcpy

environments = arcpy.ListEnvironments()

environments.sort()

for environment in environments:
    # Format and print each environment and its current setting.
    # (The environments are accessed by key from arcpy.env.)
    print("{0:<30}: {1}".format(environment, arcpy.env[environment]))
    
MDomain                       : None
MResolution                   : None
MTolerance                    : None
S100FeatureCatalogueFile      : None
XYDomain                      : None
XYResolution                  : None
XYTolerance                   : None
ZDomain                       : None
ZResolution                   : None
ZTolerance                    : None
addOutputsToMap               : True
annotationTextStringFieldLength: None
autoCancelling                : True
autoCommit                    : 1000
baDataSource                  : None
baNetworkSource               : None
baUseDetailedAggregation      : False
buildStatsAndRATForTempRaster : True
cartographicCoordinateSystem  : None
cartographicPartitions        : None
cellAlignment                 : DEFAULT
cellSize                      : MAXOF
cellSizeProjectionMethod      : CONVERT_UNITS
coincidentPoints              : MEAN
compression                   : LZ77
configKeyword                 : None
extent                        : None
geographicTransformations     : None
gpuId                         : 0
isCancelled                   : False
maintainAttachments           : True
maintainCurveSegments         : None
maintainSpatialIndex          : False
mask                          : None
matchMultidimensionalVariable : True
nodata                        : NONE
outputCoordinateSystem        : None
outputMFlag                   : Same As Input
outputZFlag                   : Same As Input
outputZValue                  : None
overwriteOutput               : False
packageWorkspace              : C:\Users\dan_p\AppData\Local\Temp
parallelProcessingFactor      : None
preserveGlobalIds             : False
processingServer              : None
processingServerPassword      : None
processingServerUser          : None
processorType                 : None
pyramid                       : PYRAMIDS -1 NEAREST DEFAULT 75 NO_SKIP NO_SIPS
qualifiedFieldNames           : True
randomGenerator               : 0 ACM599
rasterStatistics              : STATISTICS 1 1
recycleProcessingWorkers      : None
referenceScale                : None
resamplingMethod              : NEAREST
retryOnFailures               : None
scratchFolder                 : C:\Users\dan_p\AppData\Local\Temp\scratch
scratchGDB                    : C:\Users\dan_p\AppData\Local\Temp\scratch.gdb
scratchWorkspace              : None
scriptWorkspace               : C:\Users\dan_p\AppData\Local\Temp
snapRaster                    : None
terrainMemoryUsage            : False
tileSize                      : 128 128
tinSaveVersion                : CURRENT
transferDomains               : False
transferGDBAttributeProperties: False
unionDimension                : False
workspace                     : None

 

 

 

you might want to look at

GetLogHistory—ArcGIS Pro | Documentation

and

SetLogHistory—ArcGIS Pro | Documentation

GetLogMetadata—ArcGIS Pro | Documentation 

and

SetLogMetadata—ArcGIS Pro | Documentation

it looks like it can be shut off

 

.. 


... sort of retired...
DarrenConly
Regular Contributor

Thanks Dan!

Adding arcpy.SetLogHistory(False) made it so the script no longer creates XML files.

The method for listing environment settings is also useful.

Cheers,

0 Kudos