Applies to |
Returns the value calculated in the given point or by integration over given contour
FieldQuantity.Calculate ( [at As Point], [over As Contour] ) As Quantity
The Calculate method of the FieldQuantity object calculates the physical quantity value. Use FieldQuantity. Exists to verify that QuickField can calculate the value defined by this FieldQuantity object.
Any physical quantity is either local, or global, or integral. Local quantities define the field at the specified point. Integral quantities should be calculated by integration over the curve, surface or volume defined by the specified contour. To define what kind of quantity are you dealing with, use its classifying properties IsIntegral, Islocal and IsGlobal.
To calculate the local quantity value at a point use FieldQuantity.Calculate method specifying the required Point object as its at argument. For example:
Dim val As double
Dim q As QuickField.FieldQuantity
Dim probePoint As QuickField.Point
val = q.Calculate(at:=probePoint).Abs
To calculate the integral quantity value use FieldQuantity.Calculate method specifying the required Contour object as its over argument. For example:
Dim val As double
Dim q As QuickField.FieldQuantity
Dim resWin As FieldWindow
Dim cont As QuickField.Contour
Set cont = resWin.Contour
val = q.Calculate(over:=cont).Abs
‘ another variant
val = q.Calculate(, cont).Abs
This method returns the QuickField.Quantity object encapsulating the physical quantity itself. Use its Abs property to obtain the Double value.