The LatticeMerge module is created with the CreateModule command by setting the Type to Merge. The properties of the LatticeMerge are altered with the ModifyModule command. This is similar to the Network | Computational | Merge command.
Module Type
Merge
Syntax
object.Construct(“CreateModule”)
object.Option(“Type”, “Merge”)
object.Do() or object.DoOnce()
object.Construct(“ModifyModule”)
object.Option(“Module”, “Merge”)
object.Option(“Option_Name”, “OptionValue”)
object.Do() or object.DoOnce()
Option Name
Example
This example shows how to create a merge module attached to two lattices.
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 function lattice
CommandApi.Construct ("CreateModule")
CommandApi.Option ("Type", "FunctionLattice")
CommandApi.Option ("AutoConnect", "False")
CommandApi.Do()
'Set the function lattice 2 equation
CommandApi.Construct ("ModifyModule")
CommandApi.Option ("Module", "FunctionLattice2")
CommandApi.Option ("FunctionLatticeExprComp1", "2*x+y+0.5*z")
CommandApi.Do()
'Add a merge module to the function lattice
CommandApi.Construct ("CreateModule")
CommandApi.Option ("Type", "Merge")
CommandApi.Option ("AutoConnect", "True")
CommandApi.Option ("SourceModule", "FunctionLattice")
CommandApi.Do()
'Connect the merge module to the second function lattice
CommandApi.Construct ("ConnectModules")
CommandApi.Option ("SourceModule", "FunctionLattice 2")
CommandApi.Option ("TargetModule", "Merge")
CommandApi.Option ("TargetPort", "1")
CommandApi.Do()
End Sub
Used by: CreateModule, ModifyModule
See Also