Tutorial
Adding components to the system
We will now add components to the sketch using the AMEAddComponent
AMEAddComponent
API AMEAddComponent function. We could add the components to the sketch without giving them any geometrical details, but since we will open the created sketch in Simcenter Amesim, we do not want to create an ugly sketch so we will provide the component positions and rotation details.
Components are AMERotateComponent
API AMERotateComponent rotated using AMERotateComponent
Components are AMEMoveComponent
API AMEMoveComponent moved using AMEMoveComponent.
Insert the following lines after the command that creates the circuit and before the command that closes the circuit:
Copy
# Add components
# Add "mass_friction1port" component
AMEAddComponent('mass_friction1port', 'mass_friction1port',
(40, 99))
# Add "springdamper01" component
AMEAddComponent('springdamper01', 'springdamper01')
# Rotate and flip the component
AMERotateComponent('springdamper01')
AMEMoveComponent('springdamper01', (89, 99))
# Add "simple_crank" component
AMEAddComponent('simple_crank', 'simple_crank')
# Rotate and flip the component
AMERotateComponent('simple_crank')
AMEFlipComponent('simple_crank')
AMEMoveComponent('simple_crank', (138, 103))
# Add "rconnector" component
AMEAddComponent('rconnector', 'rconnector')
# Rotate and flip the component
AMERotateComponent('rconnector', 2)
AMEMoveComponent('rconnector', (176, 149))
# Add "simple_crank_2" component
AMEAddComponent('simple_crank', 'simple_crank_2')
# Rotate and flip the component
AMERotateComponent('simple_crank_2')
AMEMoveComponent('simple_crank_2', (229, 103))
# Add "springdamper01_2" component
AMEAddComponent('springdamper01',
'springdamper01_2')
# Rotate and flip the component
AMERotateComponent('springdamper01_2')
AMEMoveComponent('springdamper01_2', (287, 99))
# Add "rload01" component
AMEAddComponent('rload01', 'rload01')
# Rotate and flip the component
AMERotateComponent('rload01')
AMEMoveComponent('rload01', (187, 174))
# Add "mass_friction1port_2" component
AMEAddComponent('mass_friction1port',
'mass_friction1port_2')
# Rotate and flip the component
AMERotateComponent('mass_friction1port_2', 2)
AMEMoveComponent('mass_friction1port_2', (336,
99))
Here, the first argument of AMEAddComponent is the component icon name.
Copy
# Add "mass_friction1port" component
AMEAddComponent('mass_friction1port','mass_friction1port', (40, 99))
You can obtain component names as follows:
Procedure
Locate the component you require.
Right-click the component and select Help.
Figure 8: Obtaining a component name
The icon is named mass_friction1port. The submodel it is compatible with is MAS003.
Note also that when adding a component to a circuit, we must give it a name (the second argument in the function) that is unique in the entire circuit. If you try to use the same name twice, you will get an error. This name identifies the component.
Launch your script. It produces the FlatTwin.ame system, now containing the components specified.
Open the system in Simcenter Amesim again:
Figure 9: The updated system in Simcenter Amesim
All the components are in reverse video as their submodels have not been set, and they therefore cannot be connected.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Circuit_API/Adding_components_to_the_system · retrieved 2026-07-17