This is an example for FunctionLattice.
'********************************************************************************************
' FunctionLatticeModule.bas
' This script creates a function lattice and changes the properties of the function lattice.
'
' -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()
'Change the X minimum value for the function lattice
CommandApi.Construct ("ModifyModule")
CommandApi.Option ("Module", "FunctionLattice")
CommandApi.Option ("FunctionLatticeXMin", "1")
CommandApi.Do()
'Change the X maximum value for the function lattice
CommandApi.Option ("FunctionLatticeXMax", "10")
CommandApi.Do()
'Change the Y minimum value for the function lattice
CommandApi.Option ("FunctionLatticeYMin", "-5")
CommandApi.Do()
'Change the Y maximum value for the function lattice
CommandApi.Option ("FunctionLatticeYMax", "5")
CommandApi.Do()
'Change the Z minimum value for the function lattice
CommandApi.Option ("FunctionLatticeZMin", "-.5")
CommandApi.Do()
'Change the Z maximum value for the function lattice
CommandApi.Option ("FunctionLatticeZMax", "0.5")
CommandApi.Do()
'Change the number of nodes in the X direction for the function lattice
CommandApi.Option ("FunctionLatticeXNum", "30")
CommandApi.Do()
'Change the number of nodes in the Y direction for the function lattice
CommandApi.Option ("FunctionLatticeYNum", "40")
CommandApi.Do()
'Change the number of nodes in the Z direction for the function lattice
CommandApi.Option ("FunctionLatticeZNum", "10")
CommandApi.Do()
'Change the type of values stored in the function lattice
'Value is 0, 1, 2, 3, 4, 5, 6, 7, 8 for
'Signed 8 bits, Unsigned 8 bits, Signed 16 bits, Unsigned 16 bits, Signed 32 bits,
'Unsigned 32 bits, Signed 64 bits, Float (32 bits), Double (64 bits)
CommandApi.Option ("FunctionLatticeOutType", "7")
CommandApi.Do()
'Change the number of components in the function lattice
CommandApi.Option ("FunctionLatticeOutComps", "20")
CommandApi.Do()
'Change the component function the function lattice
CommandApi.Option ("FunctionLatticeExprComp1", "(x-.5)*(x-.5) + (y-.5)*(y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 2 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp2", "(x-.5) + (y-.5)*(y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 3 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp3", "(x-.5) + (y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 4 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp4", "(x-.5) + (y-.5) + (z-.5)")
CommandApi.Do()
'Change the component 5 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp5", "(x+.5)*(x+.5) + (y+.5)*(y+.5) + (z+.5)*(z+.5)")
CommandApi.Do()
'Change the component 6 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp6", "(x+.5) + (y+.5)*(y+.5) + (z+.5)*(z+.5)")
CommandApi.Do()
'Change the component 7 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp7", "(x+.5) + (y+.5) + (z+.5)")
CommandApi.Do()
'Change the component 8 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp8", "(x+.5)*(x-.5) + (y+.5)*(y-.5) + (z+.5)*(z-.5)")
CommandApi.Do()
'Change the component 9 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp9", "x*(x+.5)*(x-.5) + (y+.5)*(y-.5) + (z+.5)*(z-.5)")
CommandApi.Do()
'Change the component 10 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp10", "x*(x-.5)*(x-.5) + y*(y-.5)*(y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 11 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp11", "x*(x-.5)*(x-.5) + y*(y-.5)*(y-.5) + z*(z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 12 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp12", "y*(x-.5)*(x-.5) + (y-.5)*(y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 13 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp13", "(x-.5)*(x-.5) + x*(y-.5)*(y-.5) + (z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 14 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp14", "(x-.5)*(x-.5) + (y-.5)*(y-.5) + x*y*(z-.5)*(z-.5)")
CommandApi.Do()
'Change the component 15 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp15", "(x + y + z)")
CommandApi.Do()
'Change the component 16 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp16", "(x*x) + (y*y) + (z*z)")
CommandApi.Do()
'Change the component 17 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp17", "(x*2) + (2*y) + (2*z)")
CommandApi.Do()
'Change the component 18 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp18", "(x*2) + (2*y) + (2*z)")
CommandApi.Do()
'Change the component 19 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp19", "(x-2) + (2-y) + (2-z)")
CommandApi.Do()
'Change the component 20 function the function lattice
CommandApi.Option ("FunctionLatticeExprComp20", "(x+2) + (2*y) + (2+z)")
CommandApi.Do()
End Sub
See Also