ActiveField - QuickField API help

QuickField Student Edition free download     Contacts

ActiveField Technology

Objects Overview

Hierarchy Chart

How to Start: Application Object

How to work with Problems

How to work with Model

How to work with Data

How to Analyze Results

Objects

Properties

Methods

Contour Object

Properties

Methods

Summary

Represents a contour for integrating, tabulating and x-y plotting.

Details

The Contour object represents a contour in a field picture window that is used for calculating integrals, drawing XY-plots and viewing field values tabulated along the it. Each FieldWindow owns exactly one Contour. When the FieldWindow is first created the Contour is empty. You access the Contour by the Contour property of the FieldWindow object.

The Contour object provides some methods for adding and deleting lines, edges or blocks to the contour. They are almost similar to the corresponding commands in the QuickField graphic user interface. In addition a Contour objects provides some read-only properties to get information about the contour: starting and ending point, contour length and square, number of contour parts and others.

Methods for Contour Editing

AddLineTo (p as Point, angle as Double)

Adds a line (segment or arc) to the contour.
p parameter is an ending point of the created line. If p is omitted, the line is drawing to the contour starting point, so the contour becomes closed.
angle denotes the central angle of an arc in radians. Zero value of angle means a straight line segment. The angle parameter if omitted is defaulted as zero.

If the contour is empty, the first call of the AddLineTo method does nothing but remembering p as a starting point of the contour. The line will be created by the next call of AddLineTo.

AddEdge (labelName as String, near as Point)

AddEdge1 (labelName as String)

Adds a model edge to the contour. The same rules as with interactive editing are applied to the edge adding. The desired edge might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable edge is used.

AddEdge1 method is equivalent to the AddEdge called without the second parameter. It provides convenience for simplified scripting languages where call with the incomplete set of parameters may cause syntax problems.

AddBlock (labelName as String, near as Point)

AddBlock1 (labelName as String)

Adds a model block to the contour. The same rules as with interactive editing are applied to the block adding. The desired block might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable block is used

Unlike the interactive editing, adding the block that is already included to contour does nothing. To exclude a block from the contour a special method DeleteBlock should be used.

AddBlock1 method is equivalent to the AddBlock called without the second parameter. It provides convenience for simplified scripting languages where call with the incomplete set of parameters may cause syntax problems.

DeleteBlock (labelName As String, near as Point)

DeleteBlock1 (labelName As String)

Deleted a model block from the contour. The desired block might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable block is used

DeleteBlock1 method is equivalent to the DeleteBlock called without the second parameter. It provides convenience for simplified scripting languages where call with the incomplete set of parameters may cause syntax problems.

Delete (EntireContour As Boolean)

If the EntireContour is False or omitted, the last added line/edge/block is deleted. Otherwise, the entire contour becomes empty.

ChangeDirection ()

Turn the contour direction.

Information Properties

Parent property as FieldWindow
(read-only)

Returns the FieldWindow possessing the contour.

StartPoint property as Point
(read-only)

Returns the starting point.

EndPoint property as Point
(read-only)

Returns the ending point.

Lenght property as Double
(read-only)

Returns the contour length.

Square property as Double
(read-only)

Returns the square of closed contour, otherwise zero.

Closed property as Boolean
(read-only)

Returns True if the contour is closed, i.e. its starting point coincides with the ending point.

Connectivity property as Integer
(read-only)

Returns the number of connectivity component of the contour, considered as a graph. An empty contour has Connectivity = 0. Connectivity can be great than one only if the contour is built by adding some several non-adjacent blocks.

The example below builds two contours for the model, representing a synchronous electric motor.

Dim Wnd As QuickField.FieldWindow 'Result field window object
' Get FieldWindow object

Set Wnd = Res.Windows(1)
' Get new Contour object
Dim Cnt as QuickField.Contour
Set Cnt = Wnd.Contour

Cnt.Delete True    ' Delete an old contour (if any)
Cnt.AddBlock "Winding+"
Dim Flux as Double
Flux = Res.GetIntegral(qfInt_FluxLinkage, Cnt).Abs


Const PI as Double = 3.1415926 ' The PI constant
Dim Ra As Double    ' Air Gap Diameter
Ra = 74.5
Cnt.Delete True    ' Delete an old contour
Cnt.AddLineTo PointXY(Ra, 0), 0
Cnt.AddLineTo PointXY(-Ra, 0), 3.1415926
Cnt.AddLineTo PointXY(Ra, 0), 3.1415926
Dim Torque as Double
Torque = Res.GetIntegral(qfInt_MaxwellTorque, Cnt).Abs