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 creating a hatch map from a user-specified boundary file, adding a legend, and adding the current date.
To run this script:
- Copy the script below, or download the attached BAS file: TransformModule.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Voxler 4\Scripter.
- Double click on Scripter.exe to launch Scripter.
- If you copied this script, press Ctrl+A to select all of the existing lines, then press Ctrl+V to paste the copied script over those existing lines. 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.
*********
'******************************************************************************************** ' TransformModule.bas ' This script creates a test lattice. ' It adds a Transform module and changes the properties of the Transform. '******************************************************************************************** ' 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() 'Create a test lattice CommandApi.Construct ("CreateModule") CommandApi.Option("Type", "TestLattice") CommandApi.Do() 'Add a Transform module to the test lattice CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "Transform") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "TestLattice") CommandApi.Do() 'Add an isosurface to the transform CommandApi.Construct ("CreateModule") CommandApi.Option ("Type", "Isosurface") CommandApi.Option ("AutoConnect", "True") CommandApi.Option ("SourceModule", "Transform") CommandApi.Do() 'Display/hide the dragger for the transform CommandApi.Construct ("ModifyModule") CommandApi.Option ("Module", "Transform") CommandApi.Option ("TransformDragger", "True") CommandApi.Do() 'Change the X Translation value CommandApi.Option ("TransformXTrans", "1") CommandApi.Do() 'Change the Y Translation value CommandApi.Option ("TransformYTrans", "1") CommandApi.Do() 'Change the Z Translation value CommandApi.Option ("TransformZTrans", "1") CommandApi.Do() Wait (2) 'Reset the Translation values CommandApi.Option ("TransformTransReset", "True") CommandApi.Do() 'Change the X Scale value CommandApi.Option ("TransformXScale", "0.6") CommandApi.Do() 'Change the Y Scale value CommandApi.Option ("TransformYScale", "0.6") CommandApi.Do() 'Change the Z Scale value CommandApi.Option ("TransformZScale", "0.6") CommandApi.Do() Wait (2) 'Reset the Scale values CommandApi.Option ("TransformScaleReset", "True") CommandApi.Do() 'Change the X Rotation value CommandApi.Option ("TransformXRotation", "30") CommandApi.Do() 'Change the Y Rotation value CommandApi.Option ("TransformYRotation", "4") CommandApi.Do() 'Change the Z Rotation value CommandApi.Option ("TransformZRotation", "10") CommandApi.Do() 'Change the Rotation Angle value CommandApi.Option ("TransformRotationAngle", "50") CommandApi.Do() Wait (2) 'Reset the Rotation values CommandApi.Option ("TransformRotationReset", "True") CommandApi.Do() End Sub
Updated February 9, 2018
Comments
0 comments
Please sign in to leave a comment.