create_voltage_source_from_objects#

Hfss.create_voltage_source_from_objects(assignment: str | int | Object3d, reference: str | int | Object3d, start_direction: int | Gravity | None = 0, name: str | None = None, source_on_plane: bool | None = True) BoundaryObject#

Create a voltage 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 voltage source.

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

Second object connected to the voltage source.

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

Start direction for the port location. It should be one of the values for Application.axis_directions, which are: XNeg, YNeg, ZNeg, XPos, YPos, and ZPos. The default is Application.axis_directions.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 axis_directions. The default is True.

Returns:
ansys.aedt.core.modules.boundary.common.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.axis_directions.XNeg, "VoltageSource"
... )
PyAEDT INFO: Connection Correctly created