add_link#
- NetworkObject.add_link(node1, node2, value, name=None)#
Create links in the network object.
- Parameters:
- node1
str
orint
String containing one of the node names that the link is connecting or an integer containing the ID of the face. If an ID is used and the node associated with the corresponding face is not created yet, it is added automatically.
- node2
str
orint
String containing one of the node names that the link is connecting or an integer containing the ID of the face. If an ID is used and the node associated with the corresponding face is not created yet, it is added atuomatically.
- value
str
orfloat
String containing the value and unit of the connection. If a float is passed, an R-Link is added to the network and the
"cel_per_w"
unit is used.- name
str
,optional
Name of the link. The default is
None
, in which case a name is automatically generated.
- node1
- Returns:
- bool
True
when successful,False
when failed.
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] >>> connection = {"Name": "LinkTest", "Connection": [faces_ids[1], faces_ids[0]], "Value": "1cel_per_w"} >>> network.add_links_from_dictionaries(connection)