Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import arcpy
  2. import os
  3. import fnmatch
  4. import glob
  5.  
  6. # getting list of mxds
  7. if rec:
  8. # going recursive
  9. matches = []
  10. for root, dirnames, filenames in os.walk(root_fld):
  11. for filename in fnmatch.filter(filenames, '*.mxd'):
  12. matches.append(os.path.join(root, filename))
  13. else:
  14. # going flat
  15. matches = glob.glob(os.path.join(root_fld, '*.mxd'))
  16.  
  17. # create thmb
  18. for m in matches:
  19. mxd = arcpy.mapping.MapDocument(m)
  20. mxd.makeThumbnail()
  21. mxd.save()
  22.  
  23. ...
  24. if not mxd.hasThumbnail():
  25. mxd.makeThumbnail()
  26. mxd.save()
  27.  
  28. Public Sub test()
  29. Dim pMapDocument As IMapDocument
  30. Set pMapDocument = ThisDocument
  31. Dim pic As stdole.IPicture
  32. On Error GoTo eH
  33. Set pic = pMapDocument.Thumbnail
  34. Exit Sub
  35. eH:
  36. MsgBox "Map Document has no thumbnail!", vbExclamation
  37. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement