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.


    Figure 1. A snippet of the WirePort object which shows the Parent collection list.
  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.


    Figure 2. A snippet of the PortCollection which shows the :AddWirePort method.
    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.


    Figure 3. A snippet of the PortCollection which shows the .AddWirePort method.
    Note: Use WirePortLocationEnum to set the .Location property.
  2. Click the WirePortLocationEnum hyperlink.


    Figure 4. A snippet of the WirePortLocationEnum.
    You have the option to specify either the Start, Middle, End or SpecifiedManually. For this example, we will use End.
  3. Change to End using the following syntax:
    my_port.Location = cf.Enums.WirePortLocationEnum.End