This is an example for LatticeResample.
'********************************************************************************************
' ResampleModule.bas
' This script creates a function lattice.
' It adds a resample module and changes the properties of the resample module.
'
' -by SKP 4/2010
'
'********************************************************************************************
Sub Main
'Declares VoxlerApp as an object
Dim VoxlerApp As Object
'Creates an instance of the Voxler application object
'and assigns it to the variable named "VoxlerApp"
Set VoxlerApp = CreateObject("Voxler.Application")
'Make Voxler visible
VoxlerApp.Visible = True
'Access CommandApi
Set CommandApi = VoxlerApp.CommandApi
'Create a new Voxler document
CommandApi.Construct ("New")
CommandApi.DoOnce()
'Create a function lattice
CommandApi.Construct ("CreateModule")
CommandApi.Option("Type", "FunctionLattice")
CommandApi.Option ("AutoConnect", "False")
CommandApi.Do()
'Add a merge module to the function lattice
CommandApi.Construct ("CreateModule")
CommandApi.Option ("Type", "Resample")
CommandApi.Option ("AutoConnect", "True")
CommandApi.Option ("SourceModule", "FunctionLattice")
CommandApi.Do()
'Turn on/off the "Calculate from Inputs" option
CommandApi.Construct ("ModifyModule")
CommandApi.Option ("Module", "Resample")
CommandApi.Option ("LatticeResampleAuto", "False")
CommandApi.Do()
'Set the X Axis minimum value
CommandApi.Option ("LatticeResampleXMin", "0.2")
CommandApi.Do()
'Set the X Axis maximum value
CommandApi.Option ("LatticeResampleXMax", "0.6")
CommandApi.Do()
'Set the Y Axis minimum value
CommandApi.Option ("LatticeResampleYMin", "0.2")
CommandApi.Do()
'Set the Y Axis maximum value
CommandApi.Option ("LatticeResampleYMax", "0.6")
CommandApi.Do()
'Set the Z Axis minimum value
CommandApi.Option ("LatticeResampleZMin", "0.2")
CommandApi.Do()
'Set the Z Axis maximum value
CommandApi.Option ("LatticeResampleZMax", "0.6")
CommandApi.Do()
'Set the number of nodes in the X direction
CommandApi.Option ("LatticeResampleXNum", "30")
CommandApi.Do()
'Set the number of nodes in the Y direction
CommandApi.Option ("LatticeResampleYNum", "30")
CommandApi.Do()
'Set the number of nodes in the Z direction
CommandApi.Option ("LatticeResampleZNum", "30")
CommandApi.Do()
'Set the resample method
'Value is 0 or 1 for Nearest Neighbor or Trilinear
CommandApi.Option ("LatticeResampleMethod", "1")
CommandApi.Do()
End Sub
See Also