add_3d_component_array_from_json#

Hfss.add_3d_component_array_from_json(input_data, name=None)[source]#

Add or edit a 3D component array from a JSON file, TOML file, or dictionary. The 3D component is placed in the layout if it is not present.

Parameters:
input_datastr, dict

Full path to either the JSON file, TOML file, or the dictionary containing the array information.

namestr, optional

Name of the boundary to add or edit.

Returns:
class:ansys.aedt.core.modeler.cad.component_array.ComponentArray

Examples

Add a 3D component array from a json file. Below is the content of a json file that will be used in the following code sample.

>>> {
>>> "primarylattice": "MyFirstLattice",
>>> "secondarylattice": "MySecondLattice",
>>> "useairobjects": true,
>>> "rowdimension": 4,
>>> "columndimension": 4,
>>> "visible": true,
>>> "showcellnumber": true,
>>> "paddingcells": 0,
>>> "referencecsid": 1,
>>> "MyFirstCell": "path/to/firstcell.a3dcomp", # optional to insert 3d comp
>>> "MySecondCell": "path/to/secondcell.a3dcomp",# optional to insert 3d comp
>>> "MyThirdCell": "path/to/thirdcell.a3dcomp",  # optional to insert 3d comp
>>> "cells": { "(1,1)": {
>>>            "name" : "MyFirstCell",
>>>            "color" : "(255,0,20)", #optional
>>>            "active" : true, #optional
>>>            "postprocessing" : true #optional
>>>            "rotation" : 0.0  #optional
>>>             },
>>>            "(1,2)": {
>>>            "name" : "MySecondCell",
>>>            "rotation" : 90.0
>>>             }
>>>             # continue
>>> }
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.core.generic.general_methods import read_configuration_file
>>> hfss_app = Hfss()
>>> dict_in = read_configuration_file(r"path\to\json_file")
>>> component_array = hfss_app.add_3d_component_array_from_json(dict_in)