create_cylinder#

Modeler3D.create_cylinder(orientation, origin, radius, height, num_sides=0, name=None, material=None, **kwargs)[source]#

Create a cylinder.

Parameters:
orientationint or str

Axis of rotation of the starting point around the center point. ansys.aedt.core.constants.AXIS Enumerator can be used as input.

originlist

Center point of the cylinder in a list of (x, y, z) coordinates.

radiusfloat

Radius of the cylinder.

heightfloat

Height of the cylinder.

num_sidesint, optional

Number of sides. The default is 0, which is correct for a cylinder.

namestr, optional

Name of the cylinder. The default is None, in which case the default name is assigned.

materialstr, optional

Name of the material. The default is None, in which case the default material is assigned.

Returns:
bool, ansys.aedt.core.modeler.cad.object_3d.Object3d

3D object or False if it fails.

References

>>> oEditor.CreateCylinder

Examples

This example shows how to create a cylinder in HFSS. The required parameters are cs_axis, position, radius, and height. The cs_axis parameter provides the direction axis of the cylinder. The position 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 parameter name 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")