PortCollection

A collection of ports.

Example

local application = cf.Application.getInstance()
local project = application:NewProject()

    -- Construct a port and add it to the collection

line = project.Contents.Geometry:AddLine(cf.Point(0, 0, 0), cf.Point(1, 1, 1))
port = project.Contents.Ports:AddWirePort(line.Wires[1])

    -- Obtain a handle to the 'PortCollection'

ports = project.Contents.Ports

    -- Print the number of ports in the collection

print("Number of ports in the collection is: " .. ports.Count)

Inheritance

The PortCollection object is derived from the Object object.

Usage locations

The PortCollection object can be accessed from the following locations:

Property List

Count
The number of Port items in the collection. (Read only number)
Label
The object label. (Read/Write string)
Type
The object type string. (Read only string)
Visible
Specifies whether the geometry must be shown or hidden. (Read/Write boolean)

Method List

AddCablePort (harness CableHarness)
Add a cable port to the specified cable harness. (Returns a CablePort object.)
AddCablePort (harness CableHarness, terminal1 Terminal, terminal2 Terminal)
Add a cable port to the cable harness schematic, connecting it to the specified terminals. (Returns a CablePort object.)
AddCablePort (table table)
Create a cable port from a creation table. (Returns a CablePort object.)
AddEdgeMeshPort (table table)
Create an edge mesh port from a creation table. (Returns a EdgeMeshPort object.)
AddEdgeMeshPort (positivefaces List of AbstractMeshTriangleFace, negativefaces List of AbstractMeshTriangleFace)
Create a port on an edge between mesh faces. (Returns a EdgeMeshPort object.)
AddEdgeMeshPortConnectedToGround (faces List of AbstractMeshTriangleFace, groundconnection EdgePortGroundConnectionEnum)
Create a port on an edge between mesh faces. (Returns a EdgeMeshPort object.)
AddEdgePort (table table)
Create a port on an edge between faces. (Returns a EdgePort object.)
AddEdgePort (positivefaces List of Face, negativefaces List of Face)
Create a port on an edge between faces. (Returns a EdgePort object.)
AddEdgePortConnectedToGround (faces List of Face, groundconnection EdgePortGroundConnectionEnum)
Create a port on an edge between faces. (Returns a EdgePort object.)
AddFEMLineMeshPort (table table)
Create a FEM line mesh port from a creation table. (Returns a FEMLineMeshPort object.)
AddFEMLineMeshPort (startvertex MeshVertexReference, endvertex MeshVertexReference)
Create a FEM line port between two mesh vertices. (Returns a FEMLineMeshPort object.)
AddFEMLineMeshPortBetweenPoints (start Point, end Point)
Create a FEM line mesh port between two points. (Returns a FEMLineMeshPort object.)
AddFEMLinePort (edges table)
Create a FEM line port along a list of edges. (Returns a FEMLinePort object.)
AddFEMLinePort (edges List of Edge)
Create a FEM line port along a list of edges. (Returns a FEMLinePort object.)
AddFEMLinePortBetweenPoints (start Point, end Point)
Create a FEM line port between two points. (Returns a FEMLinePort object.)
AddFEMModalMeshPort (table table)
Create a FEM model mesh port from a creation table. (Returns a FEMModalMeshPort object.)
AddFEMModalMeshPort (vertex1 MeshVertexReference, vertex2 MeshVertexReference, vertex3 MeshVertexReference)
Create a FEM modal port by specifying three mesh vertices. (Returns a FEMModalMeshPort object.)
AddFEMModalMeshPortFromPoints (corner1 Point, corner2 Point, corner3 Point)
Create a FEM modal mesh port by specifying three points. (Returns a FEMModalMeshPort object.)
AddFEMModalPort (table table)
Create a FEM model port from a creation table. (Returns a FEMModalPort object.)
AddFEMModalPort (faces List of Face)
Create a FEM modal port on a list of faces. (Returns a FEMModalPort object.)
AddFEMModalPortFromPoints (corner1 Point, corner2 Point, corner3 Point)
Create a FEM modal port by specifying three points. (Returns a FEMModalPort object.)
AddMicrostripMeshPort (table table)
Create a microstrip mesh port from a creation table. (Returns a MicrostripMeshPort object.)
AddMicrostripMeshPort (startvertex MeshVertexReference, endvertex MeshVertexReference)
Create a microstrip port between two mesh vertices. (Returns a MicrostripMeshPort object.)
AddMicrostripPort (table table)
Create a microstrip port from a creation table. (Returns a MicrostripPort object.)
AddMicrostripPort (edges List of Edge)
Create a microstrip port along a list of edges. (Returns a MicrostripPort object.)
AddWaveguideMeshPort (table table)
Create a waveguide mesh port from a creation table. (Returns a WaveguideMeshPort object.)
AddWaveguideMeshPort (face MeshTriangleFace, referencevector Point)
Create a waveguide port on a mesh face. (Returns a WaveguideMeshPort object.)
AddWaveguidePort (table table)
Create a waveguide port from a creation table. (Returns a WaveguidePort object.)
AddWaveguidePort (face Face)
Create a waveguide port on a face. (Returns a WaveguidePort object.)
AddWireMeshPort (table table)
Create a wire mesh port from a creation table. (Returns a WireMeshPort object.)
AddWireMeshPort (segment MeshSegmentReference)
Create a wire port on a mesh segment. (Returns a WireMeshPort object.)
AddWireMeshPortOnVertex (vertex MeshVertexReference)
Create a wire port on a mesh vertex. (Returns a WireMeshPort object.)
AddWirePort (table table)
Create a wire port from a creation table. (Returns a WirePort object.)
AddWirePort (wire Edge)
Create a port which is a point on a free wire. (Returns a WirePort object.)
Delete ()
Deletes the entity.
DeleteEntities ( List of Object)
Delete the given list of entities from the collection.
Duplicate ()
Duplicates the entity. (Returns a Object object.)
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table object.)
Item (index number)
Returns the Port for the given index in the collection. (Returns a Port object.)
Item (label string)
Returns the Port for the given label in the collection. (Returns a Port object.)
Items ()
Returns a table of Port items. (Returns a UnsupportedType(List of Port) object.)
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.

Static Function List

GetDefaultProperties ()
Creates a table containing the default settings to create an object. (Returns a table object.)

Property Details

Count
The number of Port items in the collection.
Type
number
Access
Read only
Label
The object label.
Type
string
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only
Visible
Specifies whether the geometry must be shown or hidden.
Type
boolean
Access
Read/Write

Method Details

AddCablePort (harness CableHarness)
Add a cable port to the specified cable harness.
Input Parameters
harness(CableHarness)
The cable harness to add the port to.
Return
CablePort
The cable port.
AddCablePort (harness CableHarness, terminal1 Terminal, terminal2 Terminal)
Add a cable port to the cable harness schematic, connecting it to the specified terminals.
Input Parameters
harness(CableHarness)
The cable harness to add the port to.
terminal1(Terminal)
The terminal that the components first terminal should be connected to. Can be nil.
terminal2(Terminal)
The terminal that the components second terminal should be connected to. Can be nil.
Return
CablePort
The cable port.
AddCablePort (table table)
Create a cable port from a creation table.
Input Parameters
table(table)
The creation table.
Return
CablePort
The cable port.
AddEdgeMeshPort (table table)
Create an edge mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
EdgeMeshPort
The edge mesh port.
AddEdgeMeshPort (positivefaces List of AbstractMeshTriangleFace, negativefaces List of AbstractMeshTriangleFace)
Create a port on an edge between mesh faces.
Input Parameters
positivefaces(List of AbstractMeshTriangleFace)
The list of faces on the positive side of the port.
negativefaces(List of AbstractMeshTriangleFace)
The list of faces on the negative side of the port.
Return
EdgeMeshPort
The edge mesh port.
AddEdgeMeshPortConnectedToGround (faces List of AbstractMeshTriangleFace, groundconnection EdgePortGroundConnectionEnum)
Create a port on an edge between mesh faces.
Input Parameters
faces(List of AbstractMeshTriangleFace)
The list of mesh faces connecting the non-ground side of the port.
groundconnection(EdgePortGroundConnectionEnum)
Definition of whether the positive or negative terminal should be connected to ground.
Return
EdgeMeshPort
The edge mesh port.
AddEdgePort (table table)
Create a port on an edge between faces.
Input Parameters
table(table)
The creation table.
Return
EdgePort
The edge port.
AddEdgePort (positivefaces List of Face, negativefaces List of Face)
Create a port on an edge between faces.
Input Parameters
positivefaces(List of Face)
The list of faces on the positive side of the port.
negativefaces(List of Face)
The list of faces on the negative side of the port.
Return
EdgePort
The edge port.
AddEdgePortConnectedToGround (faces List of Face, groundconnection EdgePortGroundConnectionEnum)
Create a port on an edge between faces.
Input Parameters
faces(List of Face)
The list of faces connecting the non-ground side of the port.
groundconnection(EdgePortGroundConnectionEnum)
Definition of whether the positive or negative terminal should be connected to ground.
Return
EdgePort
The edge port.
AddFEMLineMeshPort (table table)
Create a FEM line mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
FEMLineMeshPort
The FEM line mesh port.
AddFEMLineMeshPort (startvertex MeshVertexReference, endvertex MeshVertexReference)
Create a FEM line port between two mesh vertices.
Input Parameters
startvertex(MeshVertexReference)
The mesh vertex for the port start position.
endvertex(MeshVertexReference)
The mesh vertex for the port end position.
Return
FEMLineMeshPort
The FEM line mesh port.
AddFEMLineMeshPortBetweenPoints (start Point, end Point)
Create a FEM line mesh port between two points.
Input Parameters
start(Point)
The start point of the port.
end(Point)
The end point of the port.
Return
FEMLineMeshPort
The FEM line mesh port.
AddFEMLinePort (edges table)
Create a FEM line port along a list of edges.
Input Parameters
edges(table)
The edges on which the FEM line port is located.
Return
FEMLinePort
The FEM line port.
AddFEMLinePort (edges List of Edge)
Create a FEM line port along a list of edges.
Input Parameters
edges(List of Edge)
The edges on which the FEM line port is located.
Return
FEMLinePort
The FEM line port.
AddFEMLinePortBetweenPoints (start Point, end Point)
Create a FEM line port between two points.
Input Parameters
start(Point)
The start point of the port.
end(Point)
The end point of the port.
Return
FEMLinePort
The FEM line port.
AddFEMModalMeshPort (table table)
Create a FEM model mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
FEMModalMeshPort
The FEM modal mesh port.
AddFEMModalMeshPort (vertex1 MeshVertexReference, vertex2 MeshVertexReference, vertex3 MeshVertexReference)
Create a FEM modal port by specifying three mesh vertices.
Input Parameters
vertex1(MeshVertexReference)
The first mesh vertex of the port.
vertex2(MeshVertexReference)
The second mesh vertex of the port.
vertex3(MeshVertexReference)
The third mesh vertex of the port.
Return
FEMModalMeshPort
The FEM modal mesh port.
AddFEMModalMeshPortFromPoints (corner1 Point, corner2 Point, corner3 Point)
Create a FEM modal mesh port by specifying three points.
Input Parameters
corner1(Point)
The first corner point of the port.
corner2(Point)
The second corner point of the port.
corner3(Point)
The third corner point of the port.
Return
FEMModalMeshPort
The FEM modal mesh port.
AddFEMModalPort (table table)
Create a FEM model port from a creation table.
Input Parameters
table(table)
The creation table.
Return
FEMModalPort
The FEM modal port.
AddFEMModalPort (faces List of Face)
Create a FEM modal port on a list of faces.
Input Parameters
faces(List of Face)
The faces on which the FEM modal port is located.
Return
FEMModalPort
The FEM modal port.
AddFEMModalPortFromPoints (corner1 Point, corner2 Point, corner3 Point)
Create a FEM modal port by specifying three points.
Input Parameters
corner1(Point)
The first corner point of the port.
corner2(Point)
The second corner point of the port.
corner3(Point)
The third corner point of the port.
Return
FEMModalPort
The FEM modal port.
AddMicrostripMeshPort (table table)
Create a microstrip mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
MicrostripMeshPort
The microstrip mesh port.
AddMicrostripMeshPort (startvertex MeshVertexReference, endvertex MeshVertexReference)
Create a microstrip port between two mesh vertices.
Input Parameters
startvertex(MeshVertexReference)
The mesh vertex for the port start position.
endvertex(MeshVertexReference)
The mesh vertex for the port end position.
Return
MicrostripMeshPort
The microstrip mesh port.
AddMicrostripPort (table table)
Create a microstrip port from a creation table.
Input Parameters
table(table)
The creation table.
Return
MicrostripPort
The microstrip port.
AddMicrostripPort (edges List of Edge)
Create a microstrip port along a list of edges.
Input Parameters
edges(List of Edge)
The edges on which the microstrip port is located.
Return
MicrostripPort
The microstrip port.
AddWaveguideMeshPort (table table)
Create a waveguide mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
WaveguideMeshPort
The waveguide mesh port.
AddWaveguideMeshPort (face MeshTriangleFace, referencevector Point)
Create a waveguide port on a mesh face.
Input Parameters
face(MeshTriangleFace)
The mesh face on which the waveguide port is located.
referencevector(Point)
The waveguide reference direction.
Return
WaveguideMeshPort
The waveguide mesh port.
AddWaveguidePort (table table)
Create a waveguide port from a creation table.
Input Parameters
table(table)
The creation table.
Return
WaveguidePort
The waveguide port.
AddWaveguidePort (face Face)
Create a waveguide port on a face.
Input Parameters
face(Face)
The face on which the waveguide port is located.
Return
WaveguidePort
The waveguide port.
AddWireMeshPort (table table)
Create a wire mesh port from a creation table.
Input Parameters
table(table)
The creation table.
Return
WireMeshPort
The wire mesh port.
AddWireMeshPort (segment MeshSegmentReference)
Create a wire port on a mesh segment.
Input Parameters
segment(MeshSegmentReference)
The mesh segment the port is located on.
Return
WireMeshPort
The wire mesh port.
AddWireMeshPortOnVertex (vertex MeshVertexReference)
Create a wire port on a mesh vertex.
Input Parameters
vertex(MeshVertexReference)
The mesh vertex the port is located on.
Return
WireMeshPort
The wire mesh port.
AddWirePort (table table)
Create a wire port from a creation table.
Input Parameters
table(table)
The creation table.
Return
WirePort
The wire port.
AddWirePort (wire Edge)
Create a port which is a point on a free wire.
Input Parameters
wire(Edge)
The wire the port is located on.
Return
WirePort
The wire port.
Delete ()
Deletes the entity.
DeleteEntities ( List of Object)
Delete the given list of entities from the collection.
Input Parameters
(List of Object)
Duplicate ()
Duplicates the entity.
Return
Object
The new (duplicated) entity.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A table defining the properties.
Item (index number)
Returns the Port for the given index in the collection.
Input Parameters
index(number)
The index of the Port.
Return
Port
The item in the collection
Item (label string)
Returns the Port for the given label in the collection.
Input Parameters
label(string)
The label of the Port.
Return
Port
The item in the collection
Items ()
Returns a table of Port items.
Return
UnsupportedType(List of Port)
The list of items in the collection
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(Object)
A table of properties defining the new state of the object.

Static Function Details

GetDefaultProperties ()
Creates a table containing the default settings to create an object.
Return
table
A table containing the default properties.