Creating a Wire Port
Create a wire port by searching and navigating the documentation.
-
Search for wireport in the integrated help.
The results returned in response to the wireport query includes WirePort (object).
- Double-click WirePort (object).
-
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.
- Click the PortCollection hyperlink to navigate to the PortCollection description.
-
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. -
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.
-
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.
-
Click the WirePortLocationEnum hyperlink.
You have the option to specify either the Start, Middle, End or SpecifiedManually. For this example, we will use End.
-
Change to End using the following syntax:
my_port.Location = cf.Enums.WirePortLocationEnum.End