KB no longer maintained - Voxler is a retired product. Golden Software retired products are still supported, but no longer receive new features or updates. Many of Voxler's features are moving to Surfer . Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for loading a data file, adding as exclusion filter to it, changing the legend properties of the exclusion filter, and adding a scatter plot and axes to view the results.
To run this script:
- Copy the script below, or click here to download the BAS file: ExclusionFilterModule.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Voxler 4\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
'******************************************************************************************** ' ExclusionFilterModule.bas ' This script loads a data file and adds a exclusion filter to it. ' It then changes the legend properties of the exclusion filter. ' It then adds a scatter plot and axes to view the results. '******************************************************************************************** ' If Voxler is running, retrieve the current instance of Voxler. Otherwise, ' create a new instance of Voxler. Function VoxlerApplication() On Error Resume Next Set VoxlerApplication = GetObject(, "Voxler.Application") If Err.Number <> 0 Then Set VoxlerApplication = CreateObject("Voxler.Application") End If On Error GoTo 0 End Function Sub Main 'Retrieve running instance of Voxler or create a new instance of Voxler Dim VoxlerApp As Object Set VoxlerApp = VoxlerApplication() 'Make Voxler visible VoxlerApp.Visible = True 'Access CommandApi Set CommandApi = VoxlerApp.CommandApi 'Create a new Voxler document CommandApi.Construct ("New") CommandApi.DoOnce() 'Load the data file CommandApi.Construct("Import") CommandApi.Option("AutoConnect", "False") CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\GoldConcentration.dat") CommandApi.Option ("Filter", "dat") CommandApi.Option ("Options", "Defaults=1;EatWhitespace=1;Delimiter=Space,tab,comma,semicolon;TextQualifier=doublequote,quote") CommandApi.Option ("GuiEnabled", "False") CommandApi.Do() 'Add an Exclusion Filter module CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "ExclusionFilter") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "GoldConcentration.dat") CommandApi.Do() 'Remove points that are greater than Z= 50 CommandApi.Construct ("ModifyModule") CommandApi.Option ("Module", "ExclusionFilter") CommandApi.Option ("ExclusionFilterExpr", "Z>50") CommandApi.Do() 'Attach a scatter plot to the Exclusion filter CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "ScatterPlot") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "ExclusionFilter") CommandApi.Do() 'Attach axes to the exclusion filter CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "Axes") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "ExclusionFilter") CommandApi.Do() End Sub
Updated September 6, 2018
Comments
0 comments
Please sign in to leave a comment.