Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. SPDX-License-Identifier: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bowtie antenna synthesis#

This example demonstrates how to synthesize a bowtie antenna using the BowTieRounded class. It initiates AEDT through PyAEDT, sets up an empty HFSS design, and proceeds to create the antenna.

Perform required imports#

Import the antenna toolkit class and PyAEDT.

[1]:
import tempfile
[2]:
import ansys.aedt.core
[3]:
from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieRounded

Set AEDT version#

Set AEDT version.

[4]:
aedt_version = "2026.1"

Set non-graphical mode#

Set non-graphical mode.

[5]:
non_graphical = True

Create temporary directory#

[6]:
temp_dir = tempfile.TemporaryDirectory(suffix="_ansys")
project_name = ansys.aedt.core.generate_unique_project_name(root_name=temp_dir.name, project_name="bowtie_example")

Create antenna object only for synthesis#

Create antenna object.

[7]:
oantenna1 = BowTieRounded(None)
print(
    "Arm length: {}{} at {}{}".format(
        str(oantenna1.synthesis_parameters.arm_length.value),
        oantenna1.length_unit,
        oantenna1.frequency,
        oantenna1.frequency_unit,
    )
)
Arm length: 3.7mm at 10.0GHz

Change synthesis frequency#

Modify resonance frequency and modify parameters.

[8]:
oantenna1.frequency = 12.0
print(
    "Arm length: {}{} at {}{}".format(
        str(oantenna1.synthesis_parameters.arm_length.value),
        oantenna1.length_unit,
        oantenna1.frequency,
        oantenna1.frequency_unit,
    )
)
Arm length: 3.03mm at 12.0GHz

Create an empty HFSS design#

Create an empty HFSS design.

[9]:
app = ansys.aedt.core.Hfss(project=project_name, version=aedt_version, non_graphical=non_graphical)
PyAEDT INFO: Python version 3.14.5 (tags/v3.14.5:5607950, May 10 2026, 10:43:50) [MSC v.1944 64 bit (AMD64)].
PyAEDT INFO: PyAEDT version 1.0.1.
PyAEDT INFO: Initializing Desktop session.
PyAEDT INFO: AEDT version 2026.1.
PyAEDT INFO: New AEDT session is starting on gRPC port 52376.
PyAEDT INFO: Starting new AEDT gRPC session on port 52376.
PyAEDT INFO: Launching AEDT server with gRPC transport mode: TransportMode.WNUA
PyAEDT INFO: Electronics Desktop started on gRPC port 52376 after 9.8 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v261\AnsysEM
PyAEDT INFO: Connected to AEDT gRPC session on port 52376.
PyAEDT INFO: Non-graphical mode detected. Disabling Desktop logs.
PyAEDT INFO: Project bowtie_example has been created.
PyAEDT INFO: No design is present. Inserting a new design.
PyAEDT INFO: Added design 'HFSS_4QX' of type HFSS.
PyAEDT INFO: AEDT objects correctly read

Create antenna in HFSS#

Create antenna object, change frequency synthesis, create antenna, and set up in HFSS.

[10]:
oantenna1 = BowTieRounded(app)
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Materials class has been initialized! Elapsed time: 0m 0sec
[11]:
# Create antenna in HFSS.
oantenna1.model_hfss()
PyAEDT INFO: Parsing design objects. This operation can take time
PyAEDT INFO: Refreshing bodies from Object Info
PyAEDT INFO: Bodies Info Refreshed Elapsed time: 0m 0sec
PyAEDT INFO: 3D Modeler objects parsed. Elapsed time: 0m 0sec
PyAEDT INFO: Union of 2 objects has been executed.
[11]:
True

Create antenna setup.

[12]:
oantenna1.setup_hfss()
PyAEDT INFO: Boundary Perfect E PerfE_8MT0TQ has been created.
PyAEDT INFO: Boundary Perfect E PerfE_3F212J has been created.
PyAEDT INFO: Boundary AutoIdentify port_Patch_2SLTRO_1 has been created.
[12]:
True

Change default name.

[13]:
oantenna1.name = "MyAmazingAntenna"

Create antenna in HFSS#

Create antenna object, change origin parameter in the antenna definition, create antenna, and set up in HFSS.

[14]:
oantenna2 = BowTieRounded(app, origin=[20, 5, 0], name="MyAntenna")
oantenna2.model_hfss()
oantenna2.setup_hfss()
PyAEDT INFO: Parsing design objects. This operation can take time
PyAEDT INFO: Refreshing bodies from Object Info
PyAEDT INFO: Bodies Info Refreshed Elapsed time: 0m 0sec
PyAEDT INFO: 3D Modeler objects parsed. Elapsed time: 0m 0sec
PyAEDT INFO: Union of 2 objects has been executed.
PyAEDT INFO: Boundary Perfect E PerfE_XKECMM has been created.
PyAEDT INFO: Boundary Perfect E PerfE_3BMM7F has been created.
PyAEDT INFO: Boundary AutoIdentify port_MyAntenna_1 has been created.
[14]:
True

Plot HFSS model#

Plot geometry with PyVista.

[15]:
model = app.plot(show=True)
PyAEDT INFO: Parsing C:\Users\ansys\AppData\Local\Temp\tmpixi8wkld_ansys\pyaedt_prj_CPO\bowtie_example.aedt.
PyAEDT INFO: File C:\Users\ansys\AppData\Local\Temp\tmpixi8wkld_ansys\pyaedt_prj_CPO\bowtie_example.aedt correctly loaded. Elapsed time: 0m 0sec
PyAEDT INFO: aedt file load time 0.018250226974487305
PyAEDT INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Post class has been initialized! Elapsed time: 0m 0sec
C:\actions-runner\_work\pyaedt-toolkits-antenna\pyaedt-toolkits-antenna\.venv\Lib\site-packages\ansys\aedt\core\visualization\plot\pyvista.py:1184: PyVistaDeprecationWarning: ``Plotter.button_widgets`` is deprecated; use ``Plotter.widgets.button_widgets`` instead.
  while len(self.plot.button_widgets) > 1:

Release AEDT#

Release AEDT.

[16]:
app.release_desktop(True, True)
PyAEDT INFO: Desktop has been released and closed.
[16]:
True

Clean temporary directory#

[17]:
temp_dir.cleanup()