I have written a very simple tool that builds thumbnails for every map document in a folder : root_fld stands for root folder and rec tells if search must be recursive.
import arcpy
import os
import fnmatch
import glob
# getting list of mxds
if rec:
# going recursive
matches = []
for root, dirnames, filenames in os.walk(root_fld):
for filename in fnmatch.filter(filenames, '*.mxd'):
matches.append(os.path.join(root, filename))
else:
# going flat
matches = glob.glob(os.path.join(root_fld, '*.mxd'))
# create thmb
for m in matches:
mxd = arcpy.mapping.MapDocument(m)
mxd.makeThumbnail()
mxd.save()
Works fine but some thumbnails are a pain to create and i'd like my script to filter and ignore mxds that already have a thumbnail :
...
if not mxd.hasThumbnail():
mxd.makeThumbnail()
mxd.save()
According to MapDocument class documentation (http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s30000000n000000), this property doesn't seem to exist. But maybe there's a workaround ?