The Construct method tells Voxler which command to create. The Construct method is accessed from the CommandApi object. The ConnectModules type allows the Voxler program to connect two modules in the Network Manager.
The Construct method must be used in combination with the Option method and the Do or DoOnce method to create an object.
Syntax
object.Construct(“ConnectModules”)
Construct Type
ConnectModules
Parameter |
Type |
Description |
SourceModule |
string |
Name of input module |
SourceModuleId |
unsigned |
Numeric ID of the input module |
SourcePort |
unsigned |
The zero-based port index of the source module output port. |
TargetModule |
string |
Name of output module |
TargetModuleId |
unsigned |
Numeric ID of the output module |
TargetPort |
unsigned |
The zero-based port index of the target module output port. |
SourceModule or SourceModuleID is required.
TargetModule or TargetModuleId is required.
Example
This example opens the Gold (ScatterPlot) example file. It adds a Gridder module and connects the Gridder module to the Data module.
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
'Open an existing file
CommandApi.Construct ("Open")
CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\Gold (ScatterPlot).voxb")
CommandApi.DoOnce()
'Add a gridder module using the CreateModule Construct command
CommandApi.Construct ("CreateModule")
CommandApi.Option("AutoConnect","False")
CommandApi.Option("DefaultPosition", "True")
CommandApi.Option("SourceModule", "GoldConcentration.dat")
CommandApi.Option("Type","Gridder")
CommandApi.Do()
'Connect the gridder and data modules
CommandApi.Construct ("ConnectModules")
CommandApi.Option("SourceModule", "GoldConcentration.dat")
CommandApi.Option("TargetModule", "Gridder")
CommandApi.Do()
End Sub
Used by: CommandApi object
See Also