Automation Example - LatticeGradient

 

This is an example for LatticeGradient.

'********************************************************************************************

' lattice gradient.BAS

' This script creates a function lattice.

' It adds a gradient and changes the properties of the gradient.

'

'                                    -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 second component to the function lattice

  CommandApi.Construct ("ModifyModule")

  CommandApi.Option ("Module", "FunctionLattice")

  CommandApi.Option ("FunctionLatticeOutComps", "2")

  CommandApi.Do()

 

 'Add a gradient to the function lattice

  CommandApi.Construct ("CreateModule")

  CommandApi.Option ("Type", "Gradient")

  CommandApi.Option ("AutoConnect", "True")

  CommandApi.Option ("SourceModule", "FunctionLattice")

  CommandApi.Do()

 

 'Set the component to apply to the lattice gradient

  CommandApi.Construct ("ModifyModule")

  CommandApi.Option ("Module", "Gradient")

  CommandApi.Option ("LatticeGradientComponent", "2")

  CommandApi.Do()

End Sub

 

 

See Also

Automation Model

LatticeGradient