create_box#
- Modeler3D.create_box(origin, sizes, name=None, material=None, **kwargs)[source]#
Create a box.
- Parameters:
- origin
list
Anchor point for the box in Cartesian``[x, y, z]`` coordinates.
- sizes
list
Length of the box edges in Cartesian``[x, y, z]`` coordinates.
- name
str
,optional
Name of the box. 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. If the material name supplied is invalid, 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.CreateBox
Examples
This example shows how to create a box in HFSS. The required parameters are
position
that provides the origin of the box anddimensions_list
that provide the box sizes. The optional parametermatname
allows you to set the material name of the box. The optional parametername
allows you to assign a name to the box.This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and Mechanical.
>>> from ansys.aedt.core import hfss >>> hfss = Hfss() >>> origin = [0,0,0] >>> dimensions = [10,5,20] >>> box_object = hfss.modeler.create_box(origin=origin,sizes=dimensions,name="mybox",material="copper")