Welcome to Golden Software Support

Comments

3 comments

  • Avatar
    Drew Dudley

    Hello Carlos,

    Thank you for posting your question. Can you please clarify what you would like to do? Are you trying to extract the Z values from a grid file where the vector lines (from the BLN) intersect the grid? If not, please clarify what you would like to do. 

    Thanks,

    Drew

    0
    Comment actions Permalink
  • Avatar
    Carlos Wendell Soares Dias

    Hello Drew,

    Exactly! I would like to use the bln.'s limites  
    to extract the z values (all values into bln. file)
    of a grid file.

    Thanks,

     Carlos.

    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi Carlos, 

    Thanks for the updated information. We have a sample script named GridInterpolate.bas that will return the Z values from a grid file at the locations specified in a data file (worksheet file). You can find this script located at C:\Program Files\Golden Software\Surfer 14\Samples\Scripts\GridInterpolate.bas.

    If you are using BLN files, you will need to convert them to data files by removing row 1 and saving to DAT, CSV, TXT, oo one of the Excel formats prior to using them in the script. If you are using vector files, these will also need to be converted into a data file prior to using them in a script. You can do this in Surfer by creating a Base map from the vector file, turning the axes off in the Contents window, and exporting to a supported worksheet format.  

    Please see this Knowledge Base article for additional information. 

    The above works if you are trying to extract grid values along a polyline. If you are trying to extract all of the Z values within a BLN file. You will need to blank or assign the grid NoData values outside of the BLN file. You can then convert the grid to a data file. The resulting data file would include all of the grid node values inside the polygon boundary.

    So, in your script, you would need to use GridBlank, something like this:

    SurferApp.GridBlank(InGrid:= SurferApp.Path+"\Samples\demogrid.grd", BlankFile:= SurferApp.Path+"\Samples\demogrid.bln", OutGrid:= SurferApp.Path+"\Samples\dgrid1.grd", OutFmt:=srfGridFmtS7)

    You would then need to use GridCovert, something like this:

    SurferApp.GridConvert(InGrid:=SurferApp.Path+"\Samples\demogrid.grd", OutGrid:=SurferApp.Path+"\Samples\dgrid1", OutFmt:=srfGridFmtXYZ)


    Thanks!
    Drew

    0
    Comment actions Permalink

Please sign in to leave a comment.