Extract preview thumbnails from 3dm file with same name

dear All,
I’m looking for a fast way to extract all the thumbnails of 3dm files I have in a folder. If possible I would named all the new picture with the same name of 3dm file.
I work on Rhino V5 for windows.

thank to all in advanced

greetings,

Andrea

Hi Andrea,

The way to extract the preview is is via
http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_RhinoDoc_ExtractPreviewImage.htm

To do this for a folder you will need to pass the filenames in the extraction method, you can then save the extracted bit map on a location yiou want.

To save the preview of the current open file(note that an unsaved file will throw errors)

import Rhino
import scriptcontext


#get path of currently open document
path = scriptcontext.doc.Path
#get preview bitmap of file
bitmap = Rhino.RhinoDoc.ExtractPreviewImage(path)
#create path for imagefile by replacing extension
image_path = path.replace('.3dm','.jpg')
bitmap.Save(image_path)

HTH
-Willem