add_3d_component_array_from_json#

Hfss.add_3d_component_array_from_json(json_file, array_name=None)[source]#

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

Parameters:
json_filestr, dict

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

array_namestr, optional

Name of the boundary to create or edit.

Returns:
bool

True when successful, False when failed.

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 pyaedt import Hfss
>>> from pyaedt.generic.DataHandlers import json_to_dict
>>> hfss_app = Hfss()
>>> dict_in = json_to_dict(path o\json_file)
>>> hfss_app.add_3d_component_array_from_json(dict_in)