Tutorial > Creating supercomponents
Naming supercomponent ports
You can define the names of supercomponent ports through the Circuit API.
A supercomponent port can be referred to by its index on a supercomponent, or by a port iterator. Here we will demonstrate how to refer to a port through the port iterator which is the most convenient method.
The following script defines three port names, as shown in the figure below:
RTL_linear_left
RTL_linear_right
RTL_rotary_src
Insert this code in your script:
Copy
# The list of port names can be loaded from an external source of data (Excel, ...)
port_names = ['RTL_linear_left', 'RTL_linear_right', 'RTL_rotary_src']
# Loop over the supercomponent ports (from first to last port)
# to set the name of each of them
for port in AMECreateComponentPortIteration("rot_to_linear_alias"):
AMESetPortName2(port,port_names.pop())
Figure 20: Port names defined
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Circuit_API/xid1124859 · retrieved 2026-07-17