Follow

How can I display well paths in Voxler via automation?

This article contains a sample script for creating a WellRender module and modifying some of its properties.

To run this script:

  1. Copy the script below, or click here to download the BAS file: WellRenderModule.bas.
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Voxler 4\Scripter.
  3. Double click on Scripter.exe to launch Scripter.
  4. Press Ctrl+A to select all of the existing lines then press Delete.
  5. If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
  6. Click Script | Run to run the script.
     

*********

'********************************************************************************************
' WellRenderModule.bas
' This creates a WellRender module and modifies some of its properties.
'********************************************************************************************

' If Voxler is running, retrieve the current instance of Voxler.  Otherwise,
' create a new instance of Voxler.
Function VoxlerApplication()
   On Error Resume Next
   Set VoxlerApplication = GetObject(, "Voxler.Application")
   If Err.Number <> 0 Then
      Set VoxlerApplication = CreateObject("Voxler.Application")
   End If
   On Error GoTo 0
End Function

Sub Main
 'Retrieve running instance of Voxler or create a new instance of Voxler
  Dim VoxlerApp As Object
  Set VoxlerApp = VoxlerApplication()

 'Make Voxler visible
  VoxlerApp.Visible = True

 'Access CommandApi
  Set CommandApi = VoxlerApp.CommandApi

 'Create a new Voxler document
  CommandApi.Construct ("New")
  CommandApi.DoOnce()

  'Load an existing well dataset
  CommandApi.Construct ("Import")
  CommandApi.Option ("Path", VoxlerApp.Path + "Samples\SampleWellData.vdat")
  CommandApi.Do()

  'Add an Axes node for reference
  CommandApi.Construct ("CreateModule")
  CommandApi.Option ("Type", "Axes")
  CommandApi.Option ("AutoConnect", "True")
  CommandApi.Option ("SourceModule", "SampleWellData.vdat")
  CommandApi.Do()

   'Add a WellRender node
  CommandApi.Option ("Type", "WellRender")
  CommandApi.Do()

  'Label the wells by their name and modify some label properties
 CommandApi.Construct ("ModifyModule")
 CommandApi.Option ("Module", "WellRender")
 CommandApi.Option ("WellRenderShowLabels", "True")
 CommandApi.Do()
 CommandApi.Option ("WellRenderXOffset", "20")
 CommandApi.Do()
 CommandApi.Option ("WellRenderYOffset", "30")
 CommandApi.Do()
 CommandApi.Option ("WellRenderShowLeaderLines", "True")
 CommandApi.Do()

 'Modify path properties
 CommandApi.Option ("WellRenderPathColor", "Yellow")
 CommandApi.Do()
 CommandApi.Option ("WellRenderPathSize", "3")
 CommandApi.Do()

 Wait(5)

 'Show interval data.  Logs for interval color, interval size, path color, path size,
 'etc., are retrieved by their name.
 CommandApi.Option ("WellRenderIntDataLog", "MnO")
 CommandApi.Do()

 'Set the color method and log, use 0 for fixed color or 1 for color by log value
 CommandApi.Option ("WellRenderIntDataColorMethod", "1")
 CommandApi.Do()
 CommandApi.Option ("WellRenderIntDataColorLog", "MnO")
 CommandApi.Do()

 'Change the color map
 CommandApi.Option ("WellRenderIntDataColormap", "Rainbow")
 CommandApi.Do()

 'Set the size method and log, use 0 for fixed size or 1 for size by log value
 CommandApi.Option ("WellRenderIntDataSizeMethod", "1")
 CommandApi.Do()
 CommandApi.Option ("WellRenderIntDataSizeLog", "TiO2")
 CommandApi.Do()

 'Turn the interval display on
 CommandApi.Option ("WellRenderShowIntData", "True")
 CommandApi.Do()

 Wait(5)

 'Turn two wells off.  Note the use of the optional parameter on CommandApi.Option
 'to identify the well.
 CommandApi.Option ("WellRenderShowWell", "False", "Well=MW-5")
 CommandApi.Do()
 CommandApi.Option ("WellRenderShowWell", "False", "Well=MW-2")
 CommandApi.Do()

End Sub

 

Updated November 3, 2016

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.