assign_torque#
- Maxwell2d.assign_torque(assignment, coordinate_system='Global', is_positive=True, is_virtual=True, axis='Z', torque_name=None)#
Assign a torque to one or more objects.
Torque assignment can be calculated based upon the solver type. For 3D solvers the available solution types are:
Magnetostatic,Electrostatic,Eddy Current,TransientandElectric Transient. For 2D solvers the available solution types are:Magnetostatic,Electrostatic,Eddy CurrentandTransient.- Parameters:
- assignment
strorlist One or more objects to assign the torque to.
- coordinate_system
str,optional Name of the reference coordinate system. The default is
"Global".- is_positivebool,
optional Whether the torque is positive. The default is
True.- is_virtualbool,
optional Whether the torque is virtual. The default is
True.- axis
str,optional Axis to apply the torque to. The default is
"Z".- torque_name
str,optional Name of the torque. The default is
None, in which case the default name is used.
- assignment
- Returns:
- bool
Truewhen successful,Falsewhen failed.
References
>>> oModule.AssignTorque
Examples
Assign virtual torque to an object:
>>> from ansys.aedt.core import Maxwell3d >>> m3d = Maxwell3d(solution_type="Transient") >>> cylinder = m3d.modeler.create_cylinder(origin=[0, 0, 0], orientation="Z", radius=3, height=21) >>> m3d.assign_torque(assignment=cylinder.name, axis="Z", is_virtual=True, torque_name="torque") >>> m3d.desktop_class.close_desktop()