create_current_source_from_objects

Hfss.create_current_source_from_objects(startobj, endobject, axisdir=0, sourcename=None, source_on_plane=True)[source]

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

Parameters
startobj

First (starting) object for the integration line.

endobject

Second (ending) object for the integration line.

axisdirint or pyaedt.application.Analysis.Analysis.AxisDir, optional

Position of the port. 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.

sourcenamestr, optional

Name of the source. The default is None.

source_on_planebool, optional

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

Returns
pyaedt.modules.Boundary.BoundaryObject

Boundary object.

References

>>> oModule.AssignCurrent

Examples

Create two boxes that will be used to create a current source named 'CurrentSource'.

>>> box1 = hfss.modeler.primitives.create_box([30, 0, 20], [40, 10, 5],
...                                           "BoxCurrent1", "copper")
>>> box2 = hfss.modeler.primitives.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.