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
Starting object for the integration line.
- endobject
Ending object for the integration line.
- axisdir
int
orpyaedt.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
, andZPos
. The default isApplication.AxisDir.XNeg
.- sourcename
str
,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 isTrue
.
- Returns:
pyaedt.modules.Boundary.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.