create_box#
- Modeler3D.create_box(position, dimensions_list, name=None, matname=None, **kwargs)[source]#
Create a box.
- Parameters:
- position
list
Anchor point for the box in Cartesian``[x, y, z]`` coordinates.
- dimensions_list
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.- matname
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.
- position
- Returns:
- bool,
pyaedt.modeler.cad.object3d.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 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")