create_current_source_from_objects#

Hfss.create_current_source_from_objects(assignment, reference, start_direction=0, name=None, source_on_plane=True)#

Create a current source taking the closest edges of two objects.

Parameters:
assignmentstr or int or ansys.aedt.core.modeler.cad.object_3d.Object3d

First object connected to the current source.

referencestr or int or ansys.aedt.core.modeler.cad.object_3d.Object3d

Second object connected to the current source.

start_directionint or ansys.aedt.core.application.analysis.Analysis.AxisDir, optional

Start direction for the port location. It should be one of the values for Application.AxisDir, which are: XNeg, YNeg, ZNeg, XPos, YPos, and ZPos. The default is Application.AxisDir.XNeg.

namestr, optional

Name of the source. The default is None.

source_on_planebool, optional

Whether to create the source on the plane orthogonal to the start direction. The default is True.

Returns:
ansys.aedt.core.modules.boundary.common.BoundaryObject

Boundary object.

References

>>> oModule.AssignCurrent

Examples

Create two boxes for creating a current source named 'CurrentSource'.

>>> box1 = hfss.modeler.create_box([30, 0, 20], [40, 10, 5], "BoxCurrent1", "copper")
>>> box2 = hfss.modeler.create_box([30, 0, 30], [40, 10, 5], "BoxCurrent2", "copper")
>>> i1 = hfss.create_current_source_from_objects(
...     "BoxCurrent1", "BoxCurrent2", hfss.AxisDir.XPos, "CurrentSource"
... )
PyAEDT INFO: Connection created 'CurrentSource' correctly.