# Creating a Wire Port

Create a wire port by searching and navigating the documentation.

1. Search for wireport in the integrated help.
The results returned in response to the wireport query includes WirePort (object).
2. Double-click WirePort (object).
3. View the WirePort (object).
Note: Since there can be multiple wire ports in the model, the wire port object is part of the a collection.
4. Click the PortCollection hyperlink to navigate to the PortCollection description.
5. View the method list and click :AddWirePort(wire) hyperlink to navigate to a short description.
Tip: If you add a wire port in the CADFEKO GUI, you would specify the edge where the wire port is placed. Using an automation script, you do not know the label of the edge.

Use indexing to gain access to the wire or edge in the details tree.
6. Create the wire port using the following syntax.
my_port = my_project.Ports:AddWirePort(myUnion.Wires[1])
Note: Indexing is done either by number or a string. In the above code snippet the label must be Wires[1] since there is only a single wire in the Wires collection for Union1.

Specify the location for the wire port.

1. Click the WirePort hyperlink in integrated help and navigate to the .Location property in the integrated help.
Note: Use WirePortLocationEnum to set the .Location property.
my_port.Location = cf.Enums.WirePortLocationEnum.End