create_voltage_source_from_objects#
- Hfss.create_voltage_source_from_objects(assignment, reference, start_direction=0, name=None, source_on_plane=True)[source]#
Create a voltage source taking the closest edges of two objects.
- Parameters:
- assignment
str
orint
orpyaedt.modeler.cad.object3d.Object3d
First object connected to the voltage source.
- reference
str
orint
orpyaedt.modeler.cad.object3d.Object3d
Second object connected to the voltage source.
- start_direction
int
orpyaedt.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
, andZPos
. The default isApplication.AxisDir.XNeg
.- name
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
.
- assignment
- Returns:
pyaedt.modules.Boundary.BoundaryObject
Boundary object.
References
>>> oModule.AssignVoltage
Examples
Create two boxes for creating a voltage source named
'VoltageSource'
.>>> box1 = hfss.modeler.create_box([30, 0, 0],[40, 10, 5],"BoxVolt1","copper") >>> box2 = hfss.modeler.create_box([30, 0, 10],[40, 10, 5],"BoxVolt2","copper") >>> v1 = hfss.create_voltage_source_from_objects("BoxVolt1","BoxVolt2",hfss.AxisDir.XNeg,"VoltageSource") PyAEDT INFO: Connection Correctly created