This is an example for HeightField.
'********************************************************************************************
' HeightfieldModule.bas
' This script loads a test lattice and adds a heightfield module.
' It then changes all the properties of the heightfield.
'
' -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
'Create a new Voxler document
CommandApi.Construct ("New")
CommandApi.DoOnce()
'Create the test lattice
CommandApi.Construct("CreateModule")
CommandApi.Option("AutoConnect", "False")
CommandApi.Option ("DefaultPosition", "True")
CommandApi.Option ("Type", "TestLattice")
CommandApi.Do()
'Add a heightfield module
CommandApi.Construct("CreateModule")
CommandApi.Option ("AutoConnect", "True")
CommandApi.Option ("SourceModule", "TestLattice")
CommandApi.Option ("Type", "HeightField")
CommandApi.Do()
'Change the component being shown by the heightfield
'Only available if more than one component exists in the lattice
CommandApi.Construct("ModifyModule")
CommandApi.Option("Module","HeightField")
CommandApi.Option("HeightFieldComponent", "1")
CommandApi.Do()
'Change the height field drawing style
'this is 0, 1, or 2 for shaded, lines, or points
CommandApi.Option("HeightFieldDrawStyle", "1")
CommandApi.Do()
'Change the height field orientation
'this is 0, 1, or 2 for XY Plane (Axial), XZ Plane (Coronal), or YZ Plane (Sagittal)
'this is only available when more than one grid node exists in each direction
CommandApi.Option("HeightFieldOrientation", "1")
CommandApi.Do()
'Change the height field slice number
'this is a number from 1 to the maximum grid row in the orientation direction
'this is only available when more than one grid node exists in each direction
CommandApi.Option("HeightFieldSlice", "18")
CommandApi.Do()
'Change the height field opacity
'this is a number from 0 to 1
CommandApi.Option("HeightFieldOpacity", "0.4")
CommandApi.Do()
'Change the height field color map
CommandApi.Option("HeightFieldColormap", "Rainbow")
CommandApi.Do()
'Change the height field scale
CommandApi.Option("HeightFieldScale", "0.6")
CommandApi.Do()
'Display the height field legend
CommandApi.Option ("HeightFieldLegendEnable", "True")
CommandApi.Do()
'Change the legend orientation
'0 is for horizontal, 1 is for vertical
CommandApi.Option ("HeightFieldLegendOrientation", "0")
CommandApi.Do()
'Change the legend X position
'Ranges from 0-1
CommandApi.Option ("HeightFieldLegendXPos", "0.3")
CommandApi.Do()
'Change the legend Y position
'Ranges from 0-1
CommandApi.Option ("HeightFieldLegendYPos", "0.9")
CommandApi.Do()
'Change the legend width
'Ranges from 0-200
CommandApi.Option ("HeightFieldLegendWidth", "20")
CommandApi.Do()
'Change the legend length
'Ranges from 0-1024
CommandApi.Option ("HeightFieldLegendLength", "400")
CommandApi.Do()
'Change the legend title
CommandApi.Option ("HeightFieldLegendTitle", "Legend Title")
CommandApi.Do()
'Change the legend title font size
'Ranges from 4-72
CommandApi.Option ("HeightFieldLegendTitleHeight", "20")
CommandApi.Do()
'Change the number of labels displayed in a legend
CommandApi.Option ("HeightFieldLegendNumLabels", "3")
CommandApi.Do()
'Change the legend to use custom labels
CommandApi.Option ("HeightFieldLegendUseCustomLabels", "True")
CommandApi.Do()
'Set the custom labels for the legend
CommandApi.Option ("HeightFieldLegendCustomLabels", "1.7:low, 2.1:medium, 2.9:intermediate, 3.2:elevated, 3.7:high")
CommandApi.Do()
'Set the height for the legend labels
CommandApi.Option ("HeightFieldLegendLabelHeight", "8")
CommandApi.Do()
'Set the label format type for the legend
CommandApi.Option ("HeightFieldLabelFormatType", "0")
CommandApi.Do()
'Set the number of digits to display on the labels
CommandApi.Option ("HeightFieldLabelFormatNumDigits", "2")
CommandApi.Do()
'Set the legend label prefix
CommandApi.Option ("HeightFieldLabelFormatPrefix", "pre-")
CommandApi.Do()
'Set the legend label postfix
CommandApi.Option ("HeightFieldLabelFormatPostfix", "-post")
CommandApi.Do()
'Set the legend font
CommandApi.Option ("HeightFieldLegendFont", "Arial")
CommandApi.Do()
'Turn on or off antialiasing for the legend
CommandApi.Option ("HeightFieldLegendAntialias", "True")
CommandApi.Do()
'Set the line and text color for the legend
CommandApi.Option ("HeightFieldLegendFGColor", "Blue")
CommandApi.Do()
'Set the background color for the legend
CommandApi.Option ("HeightFieldLegendBGColor", "10% Gray")
CommandApi.Do()
'Turn on or off the display of the legend background
CommandApi.Option ("HeightFieldLegendShowBackground", "True")
CommandApi.Do()
End Sub
See Also