add_links_from_dictionaries#
- NetworkObject.add_links_from_dictionaries(connections)#
Create links in the network object.
- Parameters:
- connections
dictorlistofdict Dictionary or list of dictionaries containing the links between nodes. Each dictionary consists of these elements:
"Link": a three-item list consisting of the two nodes that the link is connecting andthe value with unit of the link. The node of the connection can be referred to with the name (str) or face ID (int). The link type (resistance, heat transfer coefficient, or mass flow) is determined automatically from the unit.
"Name"(optional): a string specifying the name of the link.
- connections
- Returns:
- bool
Trueif successful.
Examples
>>> import ansys.aedt.core >>> app = ansys.aedt.core.Icepak() >>> network = ansys.aedt.core.modules.boundary.Network(app) >>> box = app.modeler.create_box([5, 5, 5], [20, 50, 80]) >>> faces_ids = [face.id for face in box.faces] >>> [network.add_face_node(faces_ids[i]) for i in range(2)] >>> connection = {"Name": "LinkTest", "Link": [faces_ids[1], faces_ids[0], "1cel_per_w"]} >>> network.add_links_from_dictionaries(connection)