MoveModule

 

The Construct method tells Voxler which command to create. The Construct method is accessed from the CommandApi object The MoveModule type allows the Voxler program to move an existing module 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(“MoveModule”)

 

Construct Type

MoveModule

 

Parameter

Type

Description

Module

string

Name of the module to be moved

ModuleID

unsigned

Numeric ID of the module to be moved

UseOriginalPosition

Boolean

If true, use XOriginalPosition and YOriginalPosition location for undo. If false, use current position for undo.

XPosition

Integer

The new numeric X location of the module in the Network Manager. In Pixels.

YPosition

Integer

The new numeric Y location of the module in the Network Manager. In Pixels.

XOriginalPosition

Integer

The original numeric X location of the module in the Network Manager. In Pixels.

YOriginalPosition

Integer

The original numeric Y location of the module in the Network Manager. In Pixels.

 

XPosition, YPosition, XOriginalPosition, and YOriginalPosition are in pixels. A position of 0, 0 places the module at the top left corner of the Network Manager.

 

Example

This example opens the Helens (ContourMap) example file. It moves the HeightField module from the current location in the Network Manager to a new location. It then undoes the change.

 

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()

 

 'Open an existing file

  CommandApi.Construct ("Open")

  CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\Helens (ContourMap).voxb")

  CommandApi.DoOnce()

 

 'Move the module to a new location, remembering its current location

  CommandApi.Construct("MoveModule")

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

  CommandApi.Option ("UseOriginalPosition", "False")

  CommandApi.Option ("XPosition", 100)

  CommandApi.Option ("YPosition", 150)

  CommandApi.Do()

 

 'Wait 4 seconds

  Wait(4)

 

 'Undo the move

  CommandApi.Undo()

 

End Sub

 

Used by: CommandApi object

 

 

See Also

Automation Model

Construct Method