create_box#

Modeler3D.create_box(origin, sizes, name=None, material=None, **kwargs)#

Create a box.

Parameters:
originlist

Anchor point for the box in Cartesian``[x, y, z]`` coordinates.

sizeslist

Length of the box edges in Cartesian``[x, y, z]`` coordinates.

namestr, optional

Name of the box. 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. If the material name supplied is invalid, the default material is assigned.

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

3D object or False if it fails.

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 and dimensions_list that provide the box sizes. The optional parameter matname allows you to set the material name of the box. The optional parameter name 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")