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 an existing VOXB file, adding a clip plane, and changing all the properties of the clip plane.
To run this script:
- Copy the script below, or click here to download the BAS file: ClipPlaneModule.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.
*********
'******************************************************************************************** ' ClipPlaneModule.bas ' This script loads an existing VOXB file and adds clip plane. ' It then changes all the properties of the clip plane. '******************************************************************************************** ' 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() 'Open an existing file CommandApi.Construct ("Open") CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\Gold (ScatterPlot).voxb") CommandApi.DoOnce() 'Add a clip plane CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "ClipPlane") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "ScatterPlot") CommandApi.Do() 'Alter the axis that the clip plane is showing - clip along X CommandApi.Construct ("ModifyModule") CommandApi.Option ("Module", "ClipPlane") CommandApi.Option ("ClipPlaneOrientation", "0") CommandApi.Do() Wait (2) 'Alter the axis that the clip plane is showing - clip along Y CommandApi.Option ("ClipPlaneOrientation", "1") CommandApi.Do() Wait (2) 'Alter the axis that the clip plane is showing - clip along Z CommandApi.Option ("ClipPlaneOrientation", "2") CommandApi.Do() Wait (2) 'Alter the axis that the clip plane is showing - clip Custom angle CommandApi.Option ("ClipPlaneOrientation", "3") CommandApi.Do() 'Set the custom clip orientation CommandApi.Option ("ClipPlaneXDir", "1") CommandApi.Do() CommandApi.Option ("ClipPlaneYDir", "1") CommandApi.Do() CommandApi.Option ("ClipPlaneZDir", "2") CommandApi.Do() 'Swap the clip plane direction CommandApi.Option ("ClipPlaneSwap", "True") CommandApi.Do() 'Change the clip plane distance so it is not at the center of the map CommandApi.Option ("ClipPlaneDistance", "10") CommandApi.Do() 'Show the clip plane dragger CommandApi.Option ("ClipPlaneDragger", "True") CommandApi.Do() End Sub
Updated September 6, 2018
Comments
0 comments
Please sign in to leave a comment.