create_sphere#
- Modeler3D.create_sphere(origin, radius, name=None, material=None, **kwargs)[source]#
Create a sphere.
- Parameters:
- origin
list
List of
[x, y, z]
coordinates for the center position of the sphere.- radius
float
Radius of the sphere.
- name
str
,optional
Name of the sphere. 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.
- origin
- Returns:
- bool,
ansys.aedt.core.modeler.cad.object_3d.Object3d
3D object or
False
if it fails.
- bool,
References
>>> oEditor.CreateSphere
Examples
This example shows how to create a sphere in HFSS. The required parameters are
position
, which provides the center of the sphere, andradius
, which is the radius of the sphere. The optional parametermatname
allows you to set the material name of the sphere. The optional parametername
allows to assign a name to the sphere.This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and Mechanical.
>>> from ansys.aedt.core import Hfss >>> aedtapp = Hfss() >>> ret_object = aedtapp.modeler.create_sphere(origin=[0,0,0],radius=2,name="mysphere",material="copper")