Properties |
Methods |
Represents a contour for integrating, tabulating and x-y plotting.
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 |
|
Adds a line (segment or arc) to the contour.
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. |
Turn the contour direction. |
Information Properties |
|
Parent property as FieldWindow
|
Returns the FieldWindow possessing the contour. |
StartPoint property as Point
|
Returns the starting point. |
Returns the ending point. |
|
Lenght property as Double
|
Returns the contour length. |
Square property as Double
|
Returns the square of closed contour, otherwise zero. |
Closed property as Boolean
|
Returns True if the contour is closed, i.e. its starting point coincides with the ending point. |
Connectivity property as Integer
|
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.
The first contour consists of all the blocks represents the left sides of the pole winding. They are labeled as "Winding+". This contour is used to calculate the magnetic flux of the pole.
The second contour is a circle consisting of two semicircular arcs in the air gap between the rotor and stator. It is used for the mechanical torque calculation.
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