Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
- ...
- if not mxd.hasThumbnail():
- mxd.makeThumbnail()
- mxd.save()
- Public Sub test()
- Dim pMapDocument As IMapDocument
- Set pMapDocument = ThisDocument
- Dim pic As stdole.IPicture
- On Error GoTo eH
- Set pic = pMapDocument.Thumbnail
- Exit Sub
- eH:
- MsgBox "Map Document has no thumbnail!", vbExclamation
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement