create_cylinder#
- Modeler3D.create_cylinder(orientation, origin, radius, height, num_sides=0, name=None, material=None, **kwargs)[source]#
Create a cylinder.
- Parameters:
- orientation
int
orstr
Axis of rotation of the starting point around the center point.
ansys.aedt.core.constants.AXIS
Enumerator 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:
- bool,
ansys.aedt.core.modeler.cad.object_3d.Object3d
3D object or
False
if it fails.
- bool,
References
>>> oEditor.CreateCylinder
Examples
This example shows how to create a cylinder in HFSS. The required parameters are
cs_axis
,position
,radius
, andheight
. Thecs_axis
parameter provides the direction axis of the cylinder. Theposition
parameter provides the origin of the cylinder. The other two parameters provide the radius and height of the cylinder.The optional parameter
matname
allows you to set the material name of the cylinder. The optional parametername
allows 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")