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:
assignmentstr or int or pyaedt.modeler.cad.object3d.Object3d

First object connected to the voltage source.

referencestr or int or pyaedt.modeler.cad.object3d.Object3d

Second object connected to the voltage source.

start_directionint or pyaedt.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 AxisDir. The default is True.

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