Automation Example - Axes

 

This is an example for Axes.

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

' AxesModule.bas

' This script loads an existing VOXB file and adds axes.

' It then changes all the properties of the axes.

'

'                                    -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", "Axes")

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

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

  CommandApi.Do()

 

 'Show X Axis

  CommandApi.Construct ("ModifyModule")

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

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

  CommandApi.Do()

 

  'Change the X Axis properties

 

 'Change the X Axis color

  CommandApi.Option ("AxesXAxisColor", "light green")

  CommandApi.Do()

 

 'Change the X Axis start value

  CommandApi.Option ("AxesXAxisBeg", "20")

  CommandApi.Do()

 

 'Change the X Axis ending value

  CommandApi.Option ("AxesXAxisEnd", "110")

  CommandApi.Do()

 

 'Change the value that the X Axis crosses the Y axis

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

  CommandApi.Do()

 

 'Change the value that the X Axis crosses the Z axis

  CommandApi.Option ("AxesXAxisCross2", "50")

  CommandApi.Do()

 

 'Change the angle where the axis labels are located

  CommandApi.Option ("AxesXAxisPlane", "45")

  CommandApi.Do()

 

 'Assign a title to the X Axis

  CommandApi.Option ("AxesXAxisTitle", "X Axis Title")

  CommandApi.Do()

 

 'Show the X Axis labels

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

  CommandApi.Do()

 

 'Flip the X Axis labels in the horizontal direction

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

  CommandApi.Do()

 

 'Flip the X Axis labels in the vertical direction

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

  CommandApi.Do()

 

 'Change the starting X Axis label

  CommandApi.Option ("AxesXAxisLabelBeg", "30")

  CommandApi.Do()

 

 'Change the ending X Axis label

  CommandApi.Option ("AxesXAxisLabelEnd", "85")

  CommandApi.Do()

 

 'Change the X axis label increment

  CommandApi.Option ("AxesXAxisLabelInc", "5")

  CommandApi.Do()

 

 'Change the X Axis label angle

  CommandApi.Option ("AxesXAxisLabelAngle", "75")

  CommandApi.Do()

 

 'Change the number of ticks between major ticks

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

  CommandApi.Do()

 

 'Change the label format

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

  CommandApi.Do()

 

   'Change the number of digits

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

  CommandApi.Do()

 

   'Change the label prefix

   CommandApi.Option ("AxesXAxisLabelFormatPrefix", "X-")

   CommandApi.Do()

 

   'Change the label postfix

   CommandApi.Option ("AxesXAxisLabelFormatPostfix", " cm")

   CommandApi.Do()

 

 'Show Y Axis

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

  CommandApi.Do()

 

  'Change the Y Axis properties

 'Change the Y Axis color

  CommandApi.Option ("AxesYAxisColor", "light green")

  CommandApi.Do()

 

 'Change the Y Axis start value

  CommandApi.Option ("AxesYAxisBeg", "20")

  CommandApi.Do()

 

 'Change the Y Axis ending value

  CommandApi.Option ("AxesYAxisEnd", "110")

  CommandApi.Do()

 

 'Change the value that the Y Axis crosses the Z axis

  CommandApi.Option ("AxesYAxisCross1", "50")

  CommandApi.Do()

 

 'Change the value that the Y Axis crosses the X axis

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

  CommandApi.Do()

 

 'Change the angle where the axis labels are located

  CommandApi.Option ("AxesYAxisPlane", "45")

  CommandApi.Do()

 

 'Assign a title to the Y Axis

  CommandApi.Option ("AxesYAxisTitle", "Y Axis Title")

  CommandApi.Do()

 

 'Show the Y Axis labels

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

  CommandApi.Do()

 

 'Flip the Y Axis labels in the horizontal direction

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

  CommandApi.Do()

 

 'Flip the Y Axis labels in the vertical direction

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

  CommandApi.Do()

 

 'Change the starting Y Axis label

  CommandApi.Option ("AxesYAxisLabelBeg", "30")

  CommandApi.Do()

 

 'Change the ending Y Axis label

  CommandApi.Option ("AxesYAxisLabelEnd", "85")

  CommandApi.Do()

 

 'Change the Y Axis label increment

  CommandApi.Option ("AxesYAxisLabelInc", "5")

  CommandApi.Do()

 

 'Change the Y Axis label angle

  CommandApi.Option ("AxesYAxisLabelAngle", "75")

  CommandApi.Do()

 

 'Change the number of ticks between major ticks

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

  CommandApi.Do()

 

 'Change the label format

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

  CommandApi.Do()

 

   'Change the number of digits

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

  CommandApi.Do()

 

   'Change the label prefix

   CommandApi.Option ("AxesYAxisLabelFormatPrefix", "Y-")

   CommandApi.Do()

 

   'Change the label postfix

   CommandApi.Option ("AxesYAxisLabelFormatPostfix", " cm")

   CommandApi.Do()

 

 'Show Z Axis

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

  CommandApi.Do()

 

  'Change the Z Axis properties

 'Change the Z Axis color

  CommandApi.Option ("AxesZAxisColor", "light green")

  CommandApi.Do()

 

 'Change the Z Axis start value

  CommandApi.Option ("AxesZAxisBeg", "50")

  CommandApi.Do()

 

 'Change the Z Axis ending value

  CommandApi.Option ("AxesZAxisEnd", "100")

  CommandApi.Do()

 

 'Change the value that the Z Axis crosses the X axis

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

  CommandApi.Do()

 

 'Change the value that the Z Axis crosses the Y axis

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

  CommandApi.Do()

 

 'Change the angle where the axis labels are located

  CommandApi.Option ("AxesZAxisPlane", "45")

  CommandApi.Do()

 

 'Assign a title to the Z Axis

  CommandApi.Option ("AxesZAxisTitle", "Z Axis Title")

  CommandApi.Do()

 

 'Show the Z Axis labels

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

  CommandApi.Do()

 

 'Flip the Z Axis labels in the horizontal direction

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

  CommandApi.Do()

 

 'Flip the Z Axis labels in the vertical direction

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

  CommandApi.Do()

 

 'Change the starting Z Axis label

  CommandApi.Option ("AxesZAxisLabelBeg", "30")

  CommandApi.Do()

 

 'Change the ending Z Axis label

  CommandApi.Option ("AxesZAxisLabelEnd", "85")

  CommandApi.Do()

 

 'Change the Z Axis label increment

  CommandApi.Option ("AxesZAxisLabelInc", "5")

  CommandApi.Do()

 

 'Change the Z Axis label angle

  CommandApi.Option ("AxesZAxisLabelAngle", "75")

  CommandApi.Do()

 

 'Change the number of ticks between major ticks

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

  CommandApi.Do()

 

 'Change the label format

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

  CommandApi.Do()

 

   'Change the number of digits

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

  CommandApi.Do()

 

   'Change the label prefix

   CommandApi.Option ("AxesZAxisLabelFormatPrefix", "Z-")

   CommandApi.Do()

 

   'Change the label postfix

   CommandApi.Option ("AxesZAxisLabelFormatPostfix", " cm")

   CommandApi.Do()

 

 'Recalculate the automatic scaling

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

  CommandApi.Do()

 

 'Show the X, Y, and Z axis grid lines

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

  CommandApi.Do()

 

 'Set the X, Y, and Z axis grid line color

  CommandApi.Option ("AxesColorGrid", "Pale Yellow")

  CommandApi.Do()

 

 'Set the axes grid line width to 1

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

  CommandApi.Do()

 

 'Set the thickness for the X, Y, and Z axes

 'Ranges from 0 to 15

  CommandApi.Option ("AxesThickness", "2.3")

  CommandApi.Do()

 

 'Turn on display of arrowheads at ends of axes

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

  CommandApi.Do()

 

 'Set the font face for the axes labels and titles

 'Name of font

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

  CommandApi.Do()

 

 'Set the font antialiasing to off for the axes labels and titles

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

  CommandApi.Do()

 

 

 'Set the label height

 'Ranges from 1.192092896e-007 to 10

  CommandApi.Option ("AxesLabelHeight", "0.7")

  CommandApi.Do()

 

 'Set the title height

 'Ranges from 1.192092896e-007 to 10

  CommandApi.Option ("AxesTitleHeight", "0.7")

  CommandApi.Do()

 

End Sub

 

 

See Also

Automation Model

Axes