Skip to navigation
Export 3dm to jpg rhino script
09.09.20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' BatchExtractThumbnails.rvb -- October 2008 ' If this code works, it was written by Dale Fugier. ' If not, I don't know who wrote it. ' Works with Rhino 4.0. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Option Explicit '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' BatchExtractThumbnails '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub BatchExtractThumbnails() ' Allow the user to interactively pick a folder Dim sFolder : sFolder = Rhino.WorkingFolder sFolder = Rhino.BrowseForFolder(sFolder, "Select folder to process", "Batch Extract Thumbnails" ) If IsNull(sFolder) Then Exit Sub ' Create a file system object Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject") ' Get a folder object based on the selected folder Dim oFolder : Set oFolder = oFSO.GetFolder(sFolder) ' Process the entire folder Call DoThumbnailExtraction(oFSO, oFolder) ' Done Call Rhino.Print("Done!") End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' DoThumbnailExtraction '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub DoThumbnailExtraction(oFSO, oFolder) ' Process all 3dm files in the folder Dim oFile, strOpen, strSave For Each oFile In oFolder.Files If LCase(oFSO.GetExtensionName(oFile.Path)) = "3dm" Then strOpen = LCase(oFile.Path) strSave = LCase(Replace(strOpen, ".3dm", ".jpg", 1, -1, 1)) Call Rhino.Print("Processing " & strOpen & "...") Call Rhino.ExtractPreviewImage(strSave, strOpen) End If Next ' Un-comment the following if you want to recurse this folder 'Dim oSubFolder 'For Each oSubFolder In oFolder.SubFolders ' Call DoThumbnailExtraction(oFSO, oSubFolder) 'Next End Sub
https://github.com/antonszilasi/rhinoscript
Reply
Anonymous
Information Epoch 1745937599
There is no perfect productivity system.
Home
Notebook
Contact us