Automation Example - ClipPlane

 

This is an example for ClipPlane.

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

' ClipPlaneModule.bas

' This script loads an existing VOXB file and adds clip plane.

' It then changes all the properties of the clip plane.

'

'                                    -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\Gold (ScatterPlot).voxb")

  CommandApi.DoOnce()

 

 'Add a clip plane

  CommandApi.Construct ("CreateModule")

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

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

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

  CommandApi.Do()

 

 'Alter the axis that the clip plane is showing - clip along X

  CommandApi.Construct ("ModifyModule")

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

  CommandApi.Option ("ClipPlaneOrientation", "0")

  CommandApi.Do()

 

  Wait (2)

 

 'Alter the axis that the clip plane is showing - clip along Y

  CommandApi.Option ("ClipPlaneOrientation", "1")

  CommandApi.Do()

 

  Wait (2)

 

 'Alter the axis that the clip plane is showing - clip along Z

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

  CommandApi.Do()

 

  Wait (2)

 

 'Alter the axis that the clip plane is showing - clip Custom angle

  CommandApi.Option ("ClipPlaneOrientation", "3")

  CommandApi.Do()

 

 'Set the custom clip orientation

    CommandApi.Option ("ClipPlaneXDir", "1")

    CommandApi.Do()

    CommandApi.Option ("ClipPlaneYDir", "1")

    CommandApi.Do()

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

    CommandApi.Do()

 

 'Swap the clip plane direction

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

  CommandApi.Do()

 

 'Change the clip plane distance so it is not at the center of the map

  CommandApi.Option ("ClipPlaneDistance", "10")

  CommandApi.Do()

 

 'Show the clip plane dragger

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

  CommandApi.Do()

 

End Sub

 

 

See Also

Automation Model

ClipPlane