Profile Object

The Profile object contains the properties and methods for a profile created in Surfer with the Profiles method, Add.

Derived from: Shape object (All methods and properties of Shape apply to this object.)

The following table includes the properties of the Profile object.

Property

Description

Axes

returns the Axes collection

Fill

returns the FillFormat object

Line

returns the LineFormat object

MapPoints

returns or sets the points used for the profile line

MissingDataMethod

specifies the method for handling missing data

MissingDataValue

returns or sets the custom missing data value

TitleFont

returns the FontFormat object for the title

TitleText

returns or sets the title text

xLength

returns or sets the X scale length

xMapPerPU

returns or sets the X scale factor in map units per page units

yLength

returns or sets the Y scale length

yMapPerPU

returns or sets the Y scale factor in map units per page units

The following table includes the methods of the Profile object

Method

Description

SaveDataFile

saves the profile data to a file

Example

The following example demonstrates the use of the methods and properties of the Profile object and its use in reference to the MapFrame object.

 

Sub Main

Dim SurferApp As Object

Set SurferApp = CreateObject("Surfer.Application")

SurferApp.Visible = True

Dim Plot As Object

Set Plot = SurferApp.Documents.Add

 

'Creates a color relief map and assigns the map frame to the variable "MapFrame"

Set MapFrame = Plot.Shapes.AddColorReliefMap(SurferApp.Path+"\samples\conifer.grd")

Dim ColorReliefLayer As Object

Set ColorReliefLayer = MapFrame.Overlays(1)

 

'Create 3 Points for Profile Line (in map units)

Dim pts(5) As Double

pts(0) = 468780 : pts(1) = 4373744

pts(2) = 474916 : pts(3) = 4375855

pts(4) = 474635 : pts(5) = 4384074

 

'Create 5 Points for Profile line (in map units)

Dim otherPts(9) As Double

otherPts(0) = 468595 : otherPts(1) = 437470

otherPts(2) = 468600 : otherPts(3) = 437400

otherPts(4) = 468550 : otherPts(5) = 437330

otherPts(6) = 468470 : otherPts(7) = 437320

otherPts(8) = 474400 : otherPts(9) = 438400

 

'Create Profile object

Set Profile = MapFrame.Profiles.Add(pts)

 

'Edit Axis properties. All properties of Axis object apply.

Profile.Axes.Item("X Axis").Title = "Distance Along Section"

 

'Plot Title, uses properties of FontFormat object

Profile.TitleText = "Profile Across Conifer"

Profile.TitleFont.Bold = True

Profile.TitleFont.Italic = True

Profile.TitleFont.Size = 22

 

'MapPoints

Profile.MapPoints = otherPts

 

'Missing Data

Profile.MissingDataMethod = srfProfileMissingDataCustVal

Profile.MissingDataValue = 10.7

 

'Line Properties, uses properties of LineFormat object

Profile.Line.ForeColorRGBA.Color = srfColorRed

Profile.Line.Width = 0.03

Profile.Line.Style = ".1 in. Dash"

 

'Fill Properties, uses properties of FillFormat object

Profile.Fill.Pattern = "Horizontal"

Profile.Fill.ForeColorRGBA.Color = srfColorBlue

Profile.Fill.BackColorRGBA.Color = srfColorCyan

 

'Export Profile Data

Profile.SaveDataFile(Filename:="C:\Temp\Profile.dat")

 

'Scale

Profile.xLength = 8

xscale = Profile.xMapPerPU

Profile.yMapPerPU = xscale

 

End Sub