Welcome to Golden Software Support

Commands for Setting Wellrender Options in Scripter

Comments

7 comments

  • Avatar
    tonymak

    Dear Drew, I have solved it with the following changes, thanks.

    '######################################The following does not seem to work 

    'CommandApi.Option ("WellRenderIntDataLog", "Litho")

    'Need something like this..... CommandApi.Option ("WellRenderIntDataLog", "Column E: Litho")

    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()



    '#######################################The following does not seem to work

    'CommandApi.Option ("WellRenderIntDataColorLog", "Litho")

    'Need this.....

    'CommandApi.Option ("WellRenderIntDataColorLog", "Column E: Litho")

    CommandApi.Do()



    'Change the color map

    CommandApi.Option ("WellRenderIntDataColormap", fColorMap)

    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()



    '############################################The following does not seem to work

    ' CommandApi.Option ("WellRenderIntDataSizeLog", "Size")

    'Need this is intead...

    CommandApi.Option ("WellRenderIntDataSizeLog", "Column F: Size")

    CommandApi.Do()
    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi TonyMak,

    Thank you for the update, I'm glad you were able to get the script to work. I will respond via email for the Voxler issue you found working with your script.

    Thanks!

    Drew

    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi tonymac,

    Thank you for posting your question on the Voxler Support forum. If you are running Voxler 4, here are the commands that are relevant:

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

     

    Regarding your questions about setting a customized colormap and loading a CLR file. Neither of these can be accomplished via automation. However, you can permanently add a colormap (CLR) to the application; which can then be reference via automation. Please see this Knowledge Base article for the steps to do so: https://support.goldensoftware.com/hc/en-us/articles/226502267-How-can-I-permanently-put-a-customized-Colormap-in-the-drop-down-menu-in-Voxler-. I have added a vote to our suggestion file for future versions of Voxler to have this type of control via automation.

     

    Thanks,

    Drew

    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi tonymak,

    Thanks for your response. Before we proceed any further, can you please confirm what version of Voxler you are running? If you are running Voxler 3/4, you can use the following snippet to change the background color:

    'Change the Viewer Window background color setting 

    CommandApi.Construct ("ModifyModule")

    CommandApi.Option ("Module", "Viewer Window")

    CommandApi.Option ("EnvironmentBackgroundColor", "20% Black")

    CommandApi.Do()

    Thanks,

    Drew

    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi tonymak,

    Thanks for your response. I think I will need to see a copy of the script and supporting files to determine what's happening when you run the script. Can you please upload copies so I can take look? Upload your files here: https://goldensoftware.sharefile.com/r- ... 9efc64def9.

    Thanks,

    Drew

    0
    Comment actions Permalink
  • Avatar
    tonymak

    Thanks...not quite working. What have I got wrong please? Besides, would be most grateful if you also advise me the command for setting the background color. The following is not working either:

    'Modify background color 

    CommandApi.Construct ("ModifyModule")

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

    CommandApi.Option ("BackgroundColor", "Black")

    CommandApi.Do()
    0
    Comment actions Permalink
  • Avatar
    tonymak

    Thanks Drew. I have Voxler 4.1.509 (64-bit) Dec 8 2015 . I have the following code, which hopefully can be modified to set the Interval Log, Color Log and Size Log. Thanks again.

     

    Sub Main



    'Retrieve running instance of Voxler or create a new instance of Voxler

    Dim VoxlerApp As Object

    Dim fName,fPath,fColorMap As String

    fPath=MacroDir & "\" fName="openAgs.xlsm"

    fColorMap="Rainbow"

    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 the well data from 2 sheets. The first sheet contains the collars, the 'second sheet contains Sample data.

    'Import the Collars table and set the columns

    ___________________________________________________________________

    'Import the Collars table

    CommandApi.Construct ("Import")

    CommandApi.Option ("Path", fPath+fName)

    CommandApi.Option ("Options", "Defaults=1;Sheet=Collars")

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

    CommandApi.Do()



    'Set OutputType for the Collars table to Wells (0 = Points, 1= Wells)

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName+" - Collars")

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

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

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

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

    CommandApi.Do()



    'Set WellSheetType for the Collars table to Collars (0 = All, 1 = Collars, 2 = Dir Survey, 3 = From/To, 4 = Logs/Curves, 5 = XYZ path)

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName+" - Collars")

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

    CommandApi.Do()



    'Set Well ID (WellColID) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Top X column (WellColTopX) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Top Y column (WellColTopY) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Top Z column (WellColTopZ) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Azimuth column (WellColAz) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

    CommandApi.Option ("WellColAz", "4")

    CommandApi.Do()



    'Set Vertical Direction to Dip (WellColVertType) For Collars table (0 = Dip, 1 = Inclination)

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Dip column (WellColVertDip) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

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

    CommandApi.Do()



    'Set Azimuth column (WellColTotalDepth) For Collars table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Collars")

    CommandApi.Option ("WellColTotalDepth", "6")

    CommandApi.Do()



    'Import the Samples table and set the columns

    ___________________________________________________________________ 'Import the Samples table CommandApi.Construct ("Import")

    CommandApi.Option ("Path", fPath+fName)

    CommandApi.Option ("Options", "Defaults=1;Sheet=Samples")

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

    CommandApi.Do()



    'Set OutputType for the Samples table to Wells (0 = Points, 1= Wells)

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

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

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

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

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

    CommandApi.Do()



    'Set WellSheetType for the Samples table to From/To Logs (0 = All, 1 = Collars, 2 = Dir Survey, 3 = From/To, 4 = Logs/Curves, 5 = XYZ path)

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

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

    CommandApi.Do()



    'Set From column (WellColFrom) For Samples table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

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

    CommandApi.Do()



    'Set To column (WellColTo) For Samples table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

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

    CommandApi.Do()



    'Set number of logs (WellColLogCount) For Samples table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

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

    CommandApi.Do()



    'Set the first log column (ColLog-1) For Samples table

    CommandApi.Construct("ModifyModule")

    CommandApi.Option("Module",fName + " - Samples")

    CommandApi.Option ("ColLog-1", "4")

    CommandApi.Option ("ColLog-2", "5")

    CommandApi.Do()



    'Create WellData and WellRender modules and connect them to the data

    ___________________________________________________________________ 'Add a WellData module using the CreateModule Construct command

    CommandApi.Construct ("CreateModule")

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

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

    CommandApi.Option("SourceModule", fName + " - Collars")

    CommandApi.Option("Type","WellData") CommandApi.Do()



    'Connect the Weldata and data modules

    CommandApi.Construct ("ConnectModules")

    CommandApi.Option("SourceModule", fName + " - Collars")

    CommandApi.Option("TargetModule", "WellData")

    CommandApi.Do()



    CommandApi.Construct ("ConnectModules")

    CommandApi.Option("SourceModule", fName + " - Samples")

    CommandApi.Option("TargetModule", "WellData")

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

    CommandApi.Do()



    'Add a WellRender module using the CreateModule Construct command

    CommandApi.Construct ("CreateModule")

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

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

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

    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", "False")

    CommandApi.Do() CommandApi.Option ("WellRenderXOffset", "20")

    CommandApi.Do()



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

    CommandApi.Do()



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

    CommandApi.Do()



    'Modify path properties

    CommandApi.Construct ("ModifyModule")

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

    CommandApi.Option ("WellRenderPathColor", "Yellow")

    CommandApi.Do()



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

    CommandApi.Do()



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

    CommandApi.Do()



    'Show interval data. Logs for interval color, interval size, path color, path size, 'etc., are retrieved by their name.

    CommandApi.Construct ("ModifyModule")

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

    CommandApi.Option ("WellRenderIntDataLog", "Litho")

    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", "Litho")

    CommandApi.Do()



    'Change the color map

    CommandApi.Option ("WellRenderIntDataColormap", fColorMap)

    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", "Size")

    CommandApi.Do()



    'Turn the interval display on

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

    CommandApi.Do()
    0
    Comment actions Permalink

Please sign in to leave a comment.