# Creating the Wire Port

Define a wire port at the end of Feedline with label Port1.

myPort = myProject.Contents.Ports:AddWirePort(myUnion.Wires[1])
myPort.Label = "Port1"
1. A port is a object and since there may be multiple objects in the model, it is part of the PortCollection.
2. Search for PortCollection in the Help1.
3. In the Help, under PortCollection > Method List, search for methods that are applicable to geometry wire ports:
• AddWirePort (table table)
• AddWirePort (wire Edge)
To create a wire port, we will use the method:
AddWirePort(wire Edge)
4. Add the wire where wire port will be placed.
AddWirePort(myUnion.Wires[1])
Note: Use indexing to access a face, wire, edge or region in the details tree.
5. Determine the syntax to prepend to AddWirePort:
1. Since AddWirePort is a method, it is indicated by prepending a “:” (colon).
:AddWirePort(myUnion.Wires[1])
2. In the Help, under PortCollection > Usage locations, note the following:
ModelContents object has collection Ports.2
3. Click ModelContents.
4. In the Help, under ModelContents > Usage locations, note the following:
Model object has property Contents3
Since we know that Model is the one of the top levels in the model tree, the result is then:
Contents.Ports:AddWirePort(myUnion.Wires[1])
5. Since the project is the highest level, we prepend our reference to the project:
myProject.Contents.Ports:AddWirePort(myUnion.Wires[1])
6. Add a reference to the newly created wire port:
myPort = myProject.Contents.Ports:AddWirePort(myUnion.Wires[1])
7. Set the wire port label to Port1:
myPort.Label = "Port1"
Tip: View the WirePort (object) in the Help for a short example.
1 The API is available in the Feko Scripting and API Reference Guide (PDF) or Feko WebHelp.
2 The part that is prepended to the method, maps to the CADFEKO model tree structure.
3 The part that is prepended to the method, maps to the CADFEKO model tree structure.