Frequently Asked Question

Export images reporting oversize to a separate folder
Last Updated 3 years ago


SplitOnline VBScript Module

Option Explicit

' Global Variables
Dim FileSaveModule
Dim TopSizeTrigger

Dim objFso, objFolder, objFile' Objects
Dim strFolder, strFileName, strPath ' Strings

Const ForAppending = 8

' Called when channel execution begins
Sub OnChannelExecute

' Names of Split Fragmentation modules in this channel
Dim FileSaveModuleName

FileSaveModuleName = "Big_Rock_Save"
Set FileSaveModule = Channel.GetModule(FileSaveModuleName)

TopSizeTrigger = 10

strFileName = "\Large Rock Log.csv"
strFolder = "C:\Users\eking.SPLITENG\Desktop\Belt Mask Example Images\Topsize"
strPath = strFolder & strFileName

End Sub

' Called when channel execution terminates
Sub OnChannelTerminate

Set FileSaveModule = Nothing

End Sub

' Called when this module is executed in each channel iteration
Sub OnIteration

Dim TopSizeValue

On Error Resume Next

' Get TopSize
TopSizeValue = Channel.GetValue("Fnos\Topsize")

' Set File Save Off by default

If TopSizeValue > TopSizeTrigger Then
' Enable FileSaveModule
SplitApp.Log "Saving Picture of large Rock... Topsize: " & TopSizeValue

' Write Time and Topsize to file
Set objFso = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolder) Then
Set objFolder = objFSO.GetFolder(strFolder)
Set objFolder = objFSO.CreateFolder(strFolder)
End If

'Create the file if it doesn't already exist
If objFSO.FileExists(strPath) Then
Set objFile = objFso.OpenTextfile(strPath, ForAppending, True)
Set objFile = objFso.CreateTextFile(strPath, True)
objFile.WriteLine("TimeStamp" & "," & "TopSize")
End If

'Close File
objFile.WriteLine(Now & "," & TopSizeValue)

End If

End Sub

Instructions to Install Script:

Both the VB Script module and File Save module are to inserted in the channel after the calibration module


Please Wait!

Please wait... it will take a second!