create_box#

Modeler3D.create_box(position, dimensions_list, name=None, matname=None, **kwargs)[source]#

Create a box.

Parameters:
positionlist

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

dimensions_listlist

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.

matnamestr, 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, pyaedt.modeler.cad.object3d.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 pyaedt import hfss
>>> hfss = Hfss()
>>> origin = [0,0,0]
>>> dimensions = [10,5,20]
>>> box_object = hfss.modeler.create_box(position=origin,
...                                      dimensions_list=dimensions,
...                                      name="mybox",
...                                      matname="copper")