Automation Example - BoundingBox

 

This is an example for BoundingBox.

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

' BoundingBoxModule.bas

' This script loads an existing VOXB file and adds a bounding box.

' It then changes all the properties of the bounding box.

'

'                                    -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

 

 'Open an existing file

  CommandApi.Construct ("Open")

  CommandApi.Option ("Path", VoxlerApp.Path+"\Samples\Vortex (VectorPlot).voxb")

  CommandApi.DoOnce()

 

 'Add a clip plane

  CommandApi.Construct ("CreateModule")

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

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

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

  CommandApi.Do()

 

 'Change the bounding box color to blue

  CommandApi.Construct ("ModifyModule")

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

  CommandApi.Option ("BoundingBoxColor", "Blue")

  CommandApi.Do()

 

 'Change the bounding box line width to 2

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

  CommandApi.Do()

 

 'Show labels on the bounding box

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

  CommandApi.Do()

 

 'Change the bounding box label font to Times New Roman

  CommandApi.Option ("BoundingBoxFont", "Times New Roman")

  CommandApi.Do()

 

 'Change the bounding box label size

  CommandApi.Option ("BoundingBoxLabelSize", "12")

  CommandApi.Do()

 

 'Change the bounding box label color to red

  CommandApi.Option ("BoundingBoxLabelColor", "Red")

  CommandApi.Do()

 

End Sub

 

See Also

Automation Model

BoundingBox