create_cylinder#
- Modeler3D.create_cylinder(orientation, origin, radius, height, num_sides=0, name=None, material=None, **kwargs)#
Create a cylinder.
- Parameters:
- orientation
intorstr Axis of rotation of the starting point around the center point.
ansys.aedt.core.constants.AxisEnumerator can be used as input.- origin
list Center point of the cylinder in a list of
(x, y, z)coordinates.- radius
float Radius of the cylinder.
- height
float Height of the cylinder.
- num_sides
int,optional Number of sides. The default is
0, which is correct for a cylinder.- name
str,optional Name of the cylinder. The default is
None, in which case the default name is assigned.- material
str,optional Name of the material. The default is
None, in which case the default material is assigned.
- orientation
- Returns:
ansys.aedt.core.modeler.cad.object_3d.Object3dor bool3D object or
Falseif it fails.
References
>>> oEditor.CreateCylinder
Examples
This example shows how to create a cylinder in HFSS. The required parameters are
cs_axis,position,radius, andheight. Thecs_axisparameter provides the direction axis of the cylinder. Thepositionparameter provides the origin of the cylinder. The other two parameters provide the radius and height of the cylinder.The optional parameter
matnameallows you to set the material name of the cylinder. The optional parameternameallows to assign a name to the cylinder.This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and Mechanical.
>>> from ansys.aedt.core import Hfss >>> aedtapp = Hfss() >>> cylinder_object = aedtapp.modeler.create_cylinder( ... orientation="Z", origin=[0, 0, 0], radius=2, height=3, name="mycyl", material="vacuum" ... )