The Spline object represents the curve function, which describes some field dependent
parameters. With magnetostatic problems, the Spline object represents the magnetization
curve (B-H curve) of the media. With heat transfer problems Spline can be used to
describe the thermal conductivity as a function of temperature, or a volume power density as a
function of temperature.
You create a new Spline object or get an existing one using the appropriate property of
the LabelBlockMS or LabelBlockHT
object. The Spline object itself is a collection of Point
objects, where X-Property of each point contains an argument
value and the Y-Property is equal to a function value. Points in
the Spline are ordered by increasing the argument value.
Like any collection, it provides a Count property returning
the number of Points in the collection, the Item method that
returns the Point object by its number (position in the collection). The Find method returns the index of a node nearest to the given
argument value. The Add and Remove
methods are used for adding a new point to the Spline or removing an existing one. The Modify method allows you to change a function value for an
existing spline point. There is no way to change the argument value for a spline point. If you
need that you have to remove the node and add another one.
The following table contains all the methods and properties of the Spline object
The ValueAt method returns the approximated function value by
the arbitrary argument value.
Checks the function defined by the Spline from a physical point of view. The
error code is generated if the curve does not have a physical sense.
The following example creates a new label "ALNICO magnet1" for a magnetostatic
problem, sets the coercive force value of the magnet first, then creates a new spline, fills it
with points and assign the spline to the label content, and then assigns the whole content to
the label.
Dim lb As QuickField.Label
Dim lbMS As QuickField.LabelBlockMS
Set lb = prb.Labels(qfBlock).Add
lb.Name = "ALNICO magnet1"
Set lbMS = lb.Content
With lbMS
.Polar = False
.Coercive = QF.PointRA(44000, 0)
Dim curve As Spline
Set curve = .CreateBHCurve ' Create a new spline
' We do not need to add the
first point (0, -44000) -
' it will be inserted automatically
curve.Add QF.PointXY(0.121905, -39206)
curve.Add QF.PointXY(0.21943, -35370)
curve.Add QF.PointXY(0.266805, -33453.1)
curve.Add QF.PointXY(0.348365, -29091.2)
curve.Add QF.PointXY(0.408495, -24729.2)
curve.Add QF.PointXY(0.456152, -20367.2)
curve.Add QF.PointXY(0.495103, -16005.2)
curve.Add QF.PointXY(0.527358, -11643.3)
curve.Add QF.PointXY(0.557411, -7281.3)
curve.Add QF.PointXY(0.584952, -2572.67)
curve.Add QF.PointXY(0.6, 0)
End With
On Error GoTo BadSpline
curve.CheckSpline ' Check
the spline
lbMS.Spline = curve ' Assign the
created spline to a Label content
lb.Content = lbMS