From e61cfced4974e0738962aaa473c3beafc76004d2 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 8 Nov 2024 17:38:55 +0100 Subject: [PATCH 1/8] DOCS: Add PyAEDT cheat sheet --- .github/workflows/ci_cd.yml | 1 + doc/source/cheatsheet/.gitignore | 4 ++ doc/source/cheatsheet/cheat_sheet.qmd | 56 +++++++++++++++++++++++++++ doc/source/conf.py | 4 ++ pyproject.toml | 1 + 5 files changed, 66 insertions(+) create mode 100644 doc/source/cheatsheet/.gitignore create mode 100644 doc/source/cheatsheet/cheat_sheet.qmd diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index db85ca4f814..4b283155552 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -57,6 +57,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} sphinxopts: '-j auto --color -w build_errors.txt' check-links: false + needs-quarto: true smoke-tests: name: Build wheelhouse and smoke tests diff --git a/doc/source/cheatsheet/.gitignore b/doc/source/cheatsheet/.gitignore new file mode 100644 index 00000000000..4f7dc5def00 --- /dev/null +++ b/doc/source/cheatsheet/.gitignore @@ -0,0 +1,4 @@ +* +!cheat_sheet.qmd +!.gitignore +/.quarto/ \ No newline at end of file diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd new file mode 100644 index 00000000000..add51075ad5 --- /dev/null +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -0,0 +1,56 @@ +--- +title: PyAEDT cheat sheet +format: cheat_sheet-pdf +params: + version: main +footer: PyAEDT +footerlinks: + - urls: 'https://aedt.docs.pyansys.com/version/stable/' + text: Documentation + - urls: 'https://aedt.docs.pyansys.com/version/stable/Getting_started/index.html' + text: Getting started + - urls: 'https://examples.aedt.docs.pyansys.com/' + text: Examples + - urls: 'https://aedt.docs.pyansys.com/version/stable/User_guide/index.html' + text: User guide + - urls: 'https://aedt.docs.pyansys.com/version/stable/API/index.html' + text: API reference +execute: + # output: false + eval: false + +latex-clean: true +jupyter: + jupytext: + text_representation: + extension: .qmd + format_name: quarto + format_version: '1.0' + jupytext_version: 1.16.1 + kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 +--- + +# Launch PyAEDT + +## Launch an HFSS instance locally +```{python} +#| eval: false +from ansys.aedt.core import Hfss +hfss = Hfss( + version='2024.2', + new_desktop=True, + close_on_exit=True, + non_graphical=False, + project="project_name", + design="design_name" +) +``` + +## Exit your local instance: +```{python} +#| eval: false +hfss.release_desktop() +``` diff --git a/doc/source/conf.py b/doc/source/conf.py index 0d6225a46d2..d8e601b5423 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -297,6 +297,10 @@ def setup(app): "limite": 10, "ignoreLocation": True, }, + "cheatsheet": { + "file": "cheatsheet/cheat_sheet.qmd", + "title": "PyAEDT cheat sheet", + }, } # # Add button to download PDF diff --git a/pyproject.toml b/pyproject.toml index 7da3b829daa..6455162fd8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ dotnet = [ ] doc = [ "ansys-sphinx-theme>=1.0.0,<1.3", + "jupyter", "numpydoc>=1.5.0,<1.9", "recommonmark", "Sphinx>=7.1.0,<8.2", From 82829d8bfc45bb3702f661c421c75a105fd655ed Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 15 Nov 2024 10:31:06 +0100 Subject: [PATCH 2/8] TBR: Temporary files removal --- doc/source/API/Application.rst | 70 ----- doc/source/API/Boundaries.rst | 77 ----- doc/source/API/CableModeling.rst | 132 --------- doc/source/API/Configuration.rst | 52 ---- doc/source/API/Constants.rst | 21 -- doc/source/API/DesktopMessenger.rst | 13 - doc/source/API/MaterialManagement.rst | 56 ---- doc/source/API/Mesh.rst | 48 ---- doc/source/API/MultiPartComponent.rst | 23 -- doc/source/API/Optimetrics.rst | 34 --- doc/source/API/Primitive_Objects.rst | 143 ---------- doc/source/API/Primitives2D.rst | 51 ---- doc/source/API/Primitives3D.rst | 74 ----- doc/source/API/Primitives3DLayout.rst | 81 ------ doc/source/API/PrimitivesCircuit.rst | 174 ------------ doc/source/API/Setup.rst | 62 ---- doc/source/API/SetupTemplates.rst | 32 --- doc/source/API/SetupTemplates3DLayout.rst | 22 -- doc/source/API/SetupTemplatesCircuit.rst | 26 -- doc/source/API/SetupTemplatesHFSS.rst | 25 -- doc/source/API/SetupTemplatesIcepak.rst | 24 -- doc/source/API/SetupTemplatesMaxwell.rst | 23 -- doc/source/API/SetupTemplatesMechanical.rst | 23 -- doc/source/API/SetupTemplatesQ3D.rst | 24 -- doc/source/API/SetupTemplatesRmxprt.rst | 33 --- doc/source/API/SetupTemplatesTwinBuilder.rst | 21 -- doc/source/API/Stackup3D.rst | 22 -- doc/source/API/Variables.rst | 31 -- doc/source/API/Visualization.rst | 73 ----- doc/source/API/index.rst | 104 ------- doc/source/API/visualization/advanced.rst | 150 ---------- doc/source/API/visualization/plot.rst | 79 ------ doc/source/API/visualization/post.rst | 266 ------------------ doc/source/API/visualization/report.rst | 81 ------ doc/source/Getting_started/About.rst | 86 ------ doc/source/Getting_started/ClientServer.rst | 93 ------ doc/source/Getting_started/Contributing.rst | 206 -------------- doc/source/Getting_started/Installation.rst | 197 ------------- .../Getting_started/Troubleshooting.rst | 201 ------------- doc/source/Getting_started/index.rst | 132 --------- doc/source/Getting_started/versioning.rst | 78 ----- doc/source/index.rst | 22 -- 42 files changed, 3185 deletions(-) delete mode 100644 doc/source/API/Application.rst delete mode 100644 doc/source/API/Boundaries.rst delete mode 100644 doc/source/API/CableModeling.rst delete mode 100644 doc/source/API/Configuration.rst delete mode 100644 doc/source/API/Constants.rst delete mode 100644 doc/source/API/DesktopMessenger.rst delete mode 100644 doc/source/API/MaterialManagement.rst delete mode 100644 doc/source/API/Mesh.rst delete mode 100644 doc/source/API/MultiPartComponent.rst delete mode 100644 doc/source/API/Optimetrics.rst delete mode 100644 doc/source/API/Primitive_Objects.rst delete mode 100644 doc/source/API/Primitives2D.rst delete mode 100644 doc/source/API/Primitives3D.rst delete mode 100644 doc/source/API/Primitives3DLayout.rst delete mode 100644 doc/source/API/PrimitivesCircuit.rst delete mode 100644 doc/source/API/Setup.rst delete mode 100644 doc/source/API/SetupTemplates.rst delete mode 100644 doc/source/API/SetupTemplates3DLayout.rst delete mode 100644 doc/source/API/SetupTemplatesCircuit.rst delete mode 100644 doc/source/API/SetupTemplatesHFSS.rst delete mode 100644 doc/source/API/SetupTemplatesIcepak.rst delete mode 100644 doc/source/API/SetupTemplatesMaxwell.rst delete mode 100644 doc/source/API/SetupTemplatesMechanical.rst delete mode 100644 doc/source/API/SetupTemplatesQ3D.rst delete mode 100644 doc/source/API/SetupTemplatesRmxprt.rst delete mode 100644 doc/source/API/SetupTemplatesTwinBuilder.rst delete mode 100644 doc/source/API/Stackup3D.rst delete mode 100644 doc/source/API/Variables.rst delete mode 100644 doc/source/API/Visualization.rst delete mode 100644 doc/source/API/index.rst delete mode 100644 doc/source/API/visualization/advanced.rst delete mode 100644 doc/source/API/visualization/plot.rst delete mode 100644 doc/source/API/visualization/post.rst delete mode 100644 doc/source/API/visualization/report.rst delete mode 100644 doc/source/Getting_started/About.rst delete mode 100644 doc/source/Getting_started/ClientServer.rst delete mode 100644 doc/source/Getting_started/Contributing.rst delete mode 100644 doc/source/Getting_started/Installation.rst delete mode 100644 doc/source/Getting_started/Troubleshooting.rst delete mode 100644 doc/source/Getting_started/index.rst delete mode 100644 doc/source/Getting_started/versioning.rst diff --git a/doc/source/API/Application.rst b/doc/source/API/Application.rst deleted file mode 100644 index d7ad0ed6724..00000000000 --- a/doc/source/API/Application.rst +++ /dev/null @@ -1,70 +0,0 @@ -Application and solvers -======================= -The PyAEDT API includes classes for different applications available in Ansys Electronics Desktop (AEDT). -You must initialize AEDT to get access to all PyAEDT modules and methods. - -.. image:: ../Resources/aedt_2.png - :width: 800 - :alt: Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. - - -Available PyAEDT apps are: - -.. autosummary:: - :toctree: _autosummary - - ansys.aedt.core.desktop.Desktop - ansys.aedt.core.hfss.Hfss - ansys.aedt.core.q3d.Q3d - ansys.aedt.core.q3d.Q2d - ansys.aedt.core.maxwell.Maxwell2d - ansys.aedt.core.maxwell.Maxwell3d - ansys.aedt.core.icepak.Icepak - ansys.aedt.core.hfss3dlayout.Hfss3dLayout - ansys.aedt.core.mechanical.Mechanical - ansys.aedt.core.rmxprt.Rmxprt - ansys.aedt.core.circuit.Circuit - ansys.aedt.core.maxwellcircuit.MaxwellCircuit - ansys.aedt.core.emit.Emit - ansys.aedt.core.twinbuilder.TwinBuilder - ansys.aedt.core.filtersolutions.FilterSolutions - - -All other classes and methods are inherited into the app class. -AEDT, which is also referred to as the desktop app, is implicitly launched in any PyAEDT app. -Before accessing a PyAEDT app, the desktop app must be launched and initialized. -The desktop app can be explicitly or implicitly initialized as in the following examples. - -Example with ``Desktop`` class explicit initialization: - -.. code:: python - - from ansys.aedt.core import launch_desktop, Circuit - d = launch_desktop(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here will be caught by Desktop. - ... - d.release_desktop() - -Example with ``Desktop`` class implicit initialization: - -.. code:: python - - from ansys.aedt.core import Circuit - circuit = Circuit(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here will be caught by Desktop. - ... - circuit.release_desktop() - - diff --git a/doc/source/API/Boundaries.rst b/doc/source/API/Boundaries.rst deleted file mode 100644 index b09d5924cfd..00000000000 --- a/doc/source/API/Boundaries.rst +++ /dev/null @@ -1,77 +0,0 @@ -Boundary objects -================ -This section lists classes for creating and editing -boundaries in the 3D tools. These objects are returned by -app methods and can be used to edit or delete a boundary condition. - - -.. currentmodule:: ansys.aedt.core.modules.boundary - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - BoundaryObject - BoundaryObject3dLayout - NetworkObject - FarFieldSetup - Matrix - BoundaryObject3dLayout - Sources - Excitations - -Native components ------------------ - -When native components object are created, the ``NativeComponentObject`` class is returned. For PCB components, ``NativeComponentPCB`` is returned. - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - NativeComponentObject - NativeComponentPCB - -``Native Component Object`` example: - -.. code:: python - - from ansys.aedt.core import Icepak - ipk = Icepak() - component_name = "RadioBoard1" - pcb_comp = self.aedtapp.create_ipk_3dcomponent_pcb( - component_name, link_data, solution_freq, resolution, custom_x_resolution=400, custom_y_resolution=500 - ) - # pcb_comp is a NativeComponentPCB - ... - ipk.release_desktop() - -Icepak transient assignments ----------------------------- -To facilitate transient assignment handling in Icepak, it is possible to use one of the following classes: - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - LinearDictionary - PowerLawDictionary - ExponentialDictionary - SinusoidalDictionary - SquareWaveDictionary - PieceWiseLinearDictionary - -It is possible to initialize the class manually or through a method: - -.. code:: python - - bc_transient = ipk.create_sinusoidal_transient_assignment(vertical_offset="1W", vertical_scaling="3", - period="2", period_offset="0.5s") - # bc_transient will be SinusoidalDictionary type - ipk.assign_solid_block("Cylinder1", bc_transient) - - #or - - bc_transient = SinusoidalDictionary(vertical_offset="1W", vertical_scaling="3", - period="2", period_offset="0.5s") - ipk.assign_solid_block("Cylinder1", bc_transient) \ No newline at end of file diff --git a/doc/source/API/CableModeling.rst b/doc/source/API/CableModeling.rst deleted file mode 100644 index b152c2c4043..00000000000 --- a/doc/source/API/CableModeling.rst +++ /dev/null @@ -1,132 +0,0 @@ -Cable modeling -============== -The ``Cable Modeling`` module includes several methods to work -with the Cable Modeling HFSS Beta feature: - - -* ``create_cable`` to create all available types of cables: bundle, straight wire and twisted pair. -* ``update_cable_properties`` to update all cables properties for all cable types. -* ``update_shielding`` to update only the shielding jacket type for bundle cable. -* ``remove_cables`` to remove cables. -* ``add_cable_to_bundle`` to add a cable or a list of cables to a bundle. -* ``create_clock_source`` to create a clock source. -* ``update_clock_source`` to update a clock source. -* ``remove_source`` to remove a source. -* ``remove_all_sources`` to remove all sources. -* ``create_pwl_source`` to create a pwl source. -* ``create_pwl_source_from_file`` to create a pwl source from file. -* ``update_pwl_source`` to update a pwl source. -* ``create_cable_harness`` to create a cable harness. - -They are accessible through: - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cable_modeling.Cable - -Cable bundle creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the cable properties - cable_props["Add_Cable"] = "True" - cable_props["Cable_prop"]["CableType"] = "bundle" - cable_props["Cable_prop"]["IsJacketTypeInsulation"] = "True" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "InsThickness" - ] = "3.66mm" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "JacketMaterial" - ] = "pec" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "InnerDiameter" - ] = "2.88mm" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleAttribs"]["Name"] = "Bundle_Cable_Insulation" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the cable bundle - cable.create_cable() - -Clock source creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the clock source properties - cable_props["Add_Cable"] = "False" - cable_props["Update_Cable"] = "False" - cable_props["Add_CablesToBundle"] = "False" - cable_props["Remove_Cable"] = "False" - cable_props["Add_Source"] = "True" - cable_props["Source_prop"]["AddClockSource"] = "True" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Period"] = "40us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["LowPulseVal"] = "0.1V" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["HighPulseVal"] = "2V" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Risetime"] = "5us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Falltime"] = "10us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["PulseWidth"] = "23us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["TDSourceAttribs"]["Name"] = "clock_test_1" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the clock source - cable.create_clock_source() - -Cable harness creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the cable harness properties - cable_props["Add_Cable"] = "False" - cable_props["Update_Cable"] = "False" - cable_props["Add_CablesToBundle"] = "False" - cable_props["Remove_Cable"] = "False" - cable_props["Add_Source"] = "False" - cable_props["Update_Source"] = "False" - cable_props["Remove_Source"] = "False" - cable_props["Add_CableHarness"] = "True" - cable_props["CableHarness_prop"]["Name"] = "cable_harness_test" - cable_props["CableHarness_prop"]["Bundle"] = "New_updated_name_cable_bundle_insulation" - cable_props["CableHarness_prop"]["TwistAngleAlongRoute"] = "20deg" - cable_props["CableHarness_prop"]["Polyline"] = "Polyline1" - cable_props["CableHarness_prop"]["AutoOrient"] = "False" - cable_props["CableHarness_prop"]["XAxis"] = "Undefined" - cable_props["CableHarness_prop"]["XAxisOrigin"] = ["0mm", "0mm", "0mm"] - cable_props["CableHarness_prop"]["XAxisEnd"] = ["0mm", "0mm", "0mm"] - cable_props["CableHarness_prop"]["ReverseYAxisDirection"] = "True" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][0]["CableName"] = "straight_wire_cable" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][1]["CableName"] = "straight_wire_cable1" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][2]["CableName"] = "straight_wire_cable2" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the cable harness - cable.create_cable_harness() \ No newline at end of file diff --git a/doc/source/API/Configuration.rst b/doc/source/API/Configuration.rst deleted file mode 100644 index c81b35eb20d..00000000000 --- a/doc/source/API/Configuration.rst +++ /dev/null @@ -1,52 +0,0 @@ -Configuration files -~~~~~~~~~~~~~~~~~~~ -This module contains all methods to export project settings to a JSON file -and import and apply settings to a new design. Currently the configuration -cover the following apps: -* HFSS -* Q2D and Q3D Extractor -* Maxwell -* Icepak -* Mechanical - -The sections covered are: - -* Variables -* Mesh operations -* Setup and optimetrics -* Material properties -* Object properties -* Boundaries and excitations - -When a boundary is attached to a face, the tool tries to match it with a -FaceByPosition on the same object name on the target design. If, for any -reason, this face position has changed or the object name in the target design has changed, -the boundary fails to apply. - - -.. currentmodule:: ansys.aedt.core.generic.configurations - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Configurations - ConfigurationsOptions - ImportResults - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(project_name="original_project", specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - conf_file = self.aedtapp.configurations.export_config() - - app2 = Hfss(projec_name='newproject') - app2.modeler.import_3d_cad(file_path) - out = app2.configurations.import_config(conf_file) - app2.configurations.results.global_import_success - - ... diff --git a/doc/source/API/Constants.rst b/doc/source/API/Constants.rst deleted file mode 100644 index 70b4bce618f..00000000000 --- a/doc/source/API/Constants.rst +++ /dev/null @@ -1,21 +0,0 @@ -Constants -========== -This section lists constants that are commonly used in PyAEDT. - - -Example of constants usage: - -.. code:: python - - from ansys.aedt.core import constants - ipk = Icepak() - # Use of AXIS Constant - cylinder = ipk.modeler.create_cylinder(constants.AXIS.X, [0,0,0],10,3) - # Use of PLANE Constant - ipk.modeler.split(cylinder, constants.PLANE.YZ, sides="Both") - ... - ipk.release_desktop() - - -.. automodule:: ansys.aedt.core.generic.constants - :members: diff --git a/doc/source/API/DesktopMessenger.rst b/doc/source/API/DesktopMessenger.rst deleted file mode 100644 index 3b6077d85d5..00000000000 --- a/doc/source/API/DesktopMessenger.rst +++ /dev/null @@ -1,13 +0,0 @@ -Logger -~~~~~~ -This section lists modules for creating and editing -PyAEDT log files. - -.. currentmodule:: ansys.aedt.core.aedt_logger - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - AedtLogger - AppFilter diff --git a/doc/source/API/MaterialManagement.rst b/doc/source/API/MaterialManagement.rst deleted file mode 100644 index bf672ae8afd..00000000000 --- a/doc/source/API/MaterialManagement.rst +++ /dev/null @@ -1,56 +0,0 @@ -Material and stackup -==================== -This section lists material and stackup modules. -These classes cannot be used directly but can be accessed through an app. -Example: - - - -Material management -~~~~~~~~~~~~~~~~~~~ -This section describes all material-related classes and methods. - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - material_lib.Materials - material.Material - material.SurfaceMaterial - material.MatProperties - material.SurfMatProperties - material.MatProperty - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Materials class - my_materials = app.materials - # This call returns the Material class - copper = my_materials["copper"] - # This property is from the MatProperty class - copper.conductivity - ... - - - -Stackup management -~~~~~~~~~~~~~~~~~~ -This section describes all layer-related classes and methods used in HFSS 3D Layout (and indirectly in Circuit). - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - - layer_stackup.Layers - layer_stackup.Layer \ No newline at end of file diff --git a/doc/source/API/Mesh.rst b/doc/source/API/Mesh.rst deleted file mode 100644 index 5ac5adad37d..00000000000 --- a/doc/source/API/Mesh.rst +++ /dev/null @@ -1,48 +0,0 @@ -Mesh operations -=============== -The ``Mesh`` module includes these classes: - -* ``Mesh`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor -* ``IcepakMesh`` for Icepak -* ``Mesh3d`` for HFSS 3D Layout - -They are accessible through the mesh property: - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - mesh.Mesh - mesh_icepak.IcepakMesh - mesh_3d_layout.Mesh3d - -.. code:: python - - from ansys.aedt.core import Maxwell3d - app = Maxwell3d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns the Mesh class - my_mesh = app.mesh - # This call executes a ``Mesh`` method and creates an object to control the mesh operation - mesh_operation_object = my_mesh.assign_surface_mesh("MyBox", 2) - ... - -Icepak mesh -~~~~~~~~~~~~~~~ - -These objects are relevant objects while using the ``MeshIcepak`` class: - -.. currentmodule:: ansys.aedt.core.modules.mesh_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - - Region - SubRegion - MeshRegion - GlobalMeshRegion \ No newline at end of file diff --git a/doc/source/API/MultiPartComponent.rst b/doc/source/API/MultiPartComponent.rst deleted file mode 100644 index 2c55c82bcb1..00000000000 --- a/doc/source/API/MultiPartComponent.rst +++ /dev/null @@ -1,23 +0,0 @@ -Multi-part components -===================== -This section lists classes for creating and editing multi-part components in the 3D tools. -This consists of a set of one or more 3D component objects, linked together and parametrized -to allow movements. - - - -.. currentmodule:: ansys.aedt.core.modeler.advanced_cad - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - actors.Person - actors.Vehicle - actors.Bird - actors.Radar - parts.Part - parts.Antenna - multiparts.MultiPartComponent - multiparts.Environment - multiparts.Actor diff --git a/doc/source/API/Optimetrics.rst b/doc/source/API/Optimetrics.rst deleted file mode 100644 index 5f02473f306..00000000000 --- a/doc/source/API/Optimetrics.rst +++ /dev/null @@ -1,34 +0,0 @@ -Optimetrics -=========== -This module contains all properties and methods needed to create -optimetrics setups. - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # returns the ParametericsSetups Class - app.parametrics - - # returns the OptimizationSetups Class - app.optimizations - - # adds an optimization and returns Setup class with all settings and methods - sweep3 = hfss.opti_optimization.add_optimization(calculation="dB(S(1,1))", calculation_value="2.5GHz") - - ... - -.. currentmodule:: ansys.aedt.core.modules.design_xploration - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ParametricSetups - OptimizationSetups - SetupParam - SetupOpti - diff --git a/doc/source/API/Primitive_Objects.rst b/doc/source/API/Primitive_Objects.rst deleted file mode 100644 index ac3a3fcbfd7..00000000000 --- a/doc/source/API/Primitive_Objects.rst +++ /dev/null @@ -1,143 +0,0 @@ -Primitives -========== - -This section lists the core AEDT Modeler primitives that are supported both in 2D and 3D solvers (HFSS, Maxwell, -Icepak, Q3D, and Mechanical): - -* Primitives -* Objects - -They are accessible through the ``modeler.objects`` property: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call return an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - my_box = primitives.objects[my_box.id] - - # This call return a FacePrimitive object list - my_box.faces - # This call returns an EdgePrimitive object list - my_box.edges - my_box.faces[0].edges - - # This call returns a VertexPrimitive object list - my_box.vertices - my_box.faces[0].vertices - my_box.faces[0].edges[0].vertices - - ... - - - -Objects -~~~~~~~ - -The following classes define objects properties for 3D and 2D Solvers (excluding HFSS 3D Layout). -They contain all getters and setters to simplify object manipulation. - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cad.object_3d.Object3d - cad.elements_3d.FacePrimitive - cad.elements_3d.EdgePrimitive - cad.elements_3d.VertexPrimitive - cad.polylines.PolylineSegment - cad.polylines.Polyline - cad.component_array.ComponentArray - cad.components_3d.UserDefinedComponent - cad.elements_3d.Point - cad.elements_3d.Plane - cad.elements_3d.HistoryProps - cad.elements_3d.BinaryTreeNode - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call returns an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - - # Getter and setter - my_box.material_name - my_box.material_name = "copper" - - my_box.faces[0].center - - ... - - -Coordinate systems and geometry operators -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This module contains all properties and methods needed to edit a -coordinate system and a set of useful geometry operators. -The ``CoordinateSystem`` class is accessible through the ``create_coordinate_system`` -method or the ``coordinate_systems`` list. The ``GeometryOperators`` class can be -imported and used because it is made by static methods. - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cad.modeler.CoordinateSystem - geometry_operators.GeometryOperators - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the CoordinateSystem object list - cs = app.modeler.coordinate_systems - - # This call returns a CoordinateSystem object - new_cs = app.modeler.create_coordinate_system() - - ... - - -Advanced modeler operations -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -PyAEDT includes some advanced modeler tools like ``MultiPartComponent`` for 3D component -management and ``Stackup3D`` for parametric creation of 3D modeler stackups. - -.. toctree:: - :maxdepth: 2 - - MultiPartComponent - Stackup3D \ No newline at end of file diff --git a/doc/source/API/Primitives2D.rst b/doc/source/API/Primitives2D.rst deleted file mode 100644 index 13273427673..00000000000 --- a/doc/source/API/Primitives2D.rst +++ /dev/null @@ -1,51 +0,0 @@ -2D modeler -=========== - -This section lists the core AEDT Modeler modules for 2D and 3D solvers (Maxwell 2D, 2D Extractor). - - -They are accessible through the ``modeler`` property: - -.. code:: python - - from ansys.aedt.core import Maxwell2d - app = Maxwell2d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler2D class - modeler = app.modeler - - - ... - - - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_2d.Modeler2D - - - -.. code:: python - - from ansys.aedt.core import Maxwell2d - app = Maxwell2d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the NexximComponents class - origin = [0,0,0] - dimensions = [10,5,20] - #Material and name are not mandatory fields - box_object = app.modeler.primivites.create_rectangle([15, 20, 0], [5, 5], material="aluminum") - - ... diff --git a/doc/source/API/Primitives3D.rst b/doc/source/API/Primitives3D.rst deleted file mode 100644 index 4d55ad3fc86..00000000000 --- a/doc/source/API/Primitives3D.rst +++ /dev/null @@ -1,74 +0,0 @@ -3D modeler -========== - -This section lists the core AEDT Modeler modules with 3D solvers (HFSS, Maxwell, -Icepak, Q3D, and Mechanical): - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` property: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call return an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - my_box = primitives.objects[my_box.id] - - # This call return a FacePrimitive object list - my_box.faces - # This call returns an EdgePrimitive object list - my_box.edges - my_box.faces[0].edges - - # This call returns a VertexPrimitive object list - my_box.vertices - my_box.faces[0].vertices - my_box.faces[0].edges[0].vertices - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties for HFSS, Maxwell 3D, Q3D Extractor, and Icepak: - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_3d.Modeler3D - - -.. code:: python - - from ansys.aedt.core import Circuit - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the NexximComponents class - origin = [0,0,0] - sizes = [10,5,20] - #Material and name are not mandatory fields - box_object = app.modeler.primivites.create_box(origin, sizes, name="mybox", material="copper") - - ... diff --git a/doc/source/API/Primitives3DLayout.rst b/doc/source/API/Primitives3DLayout.rst deleted file mode 100644 index 263443209a2..00000000000 --- a/doc/source/API/Primitives3DLayout.rst +++ /dev/null @@ -1,81 +0,0 @@ -Modeler in HFSS 3D Layout -========================== - -This section lists the core AEDT Modeler modules available in HFSS 3D Layout: - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` module and ``modeler.objects`` property: - -.. code:: python - - from ansys.aedt.core import Hfss3dLayout - hfss = Hfss3dLayout() - my_modeler = hfss.modeler - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - - -* ``Modeler3DLayout`` for HFSS 3D Layout - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_pcb.Modeler3DLayout - - -Objects in HFSS 3D Layout -~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for HFSS 3D Layout. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.pcb - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - object_3d_layout.Components3DLayout - object_3d_layout.Nets3DLayout - object_3d_layout.Pins3DLayout - object_3d_layout.Line3dLayout - object_3d_layout.Polygons3DLayout - object_3d_layout.Circle3dLayout - object_3d_layout.Rect3dLayout - object_3d_layout.Points3dLayout - object_3d_layout.Padstack - -.. code:: python - - from ansys.aedt.core import Hfss3dLayout - app = Hfss3dLayout(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler3DLayout class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call returns an Object3d object - my_rect = primitives.create_rectangle([0,0,0],[10,10]) - - # Getter and setter - my_rect.material_name - - ... diff --git a/doc/source/API/PrimitivesCircuit.rst b/doc/source/API/PrimitivesCircuit.rst deleted file mode 100644 index a9b8444712c..00000000000 --- a/doc/source/API/PrimitivesCircuit.rst +++ /dev/null @@ -1,174 +0,0 @@ -Modeler and components Circuit -============================== - -This section lists the core AEDT Modeler modules: - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` module and ``modeler.objects`` property: - -.. code:: python - - - from ansys.aedt.core import TwinBuilder - app = TwinBuilder(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - -* ``ModelerNexxim`` for Circuit -* ``ModelerTwinBuilder`` for Twin Builder -* ``ModelerEmit`` for EMIT - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - schematic.ModelerNexxim - schematic.ModelerTwinBuilder - schematic.ModelerEmit - schematic.ModelerMaxwellCircuit - - -Schematic in Circuit -~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Circuit components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_nexxim - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - NexximComponents - -.. code:: python - - from ansys.aedt.core import Circuit - app = Circuit(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - -Objects in Circuit -~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Circuit. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - object_3d_circuit.CircuitComponent - object_3d_circuit.CircuitPins - object_3d_circuit.Wire - -.. code:: python - - from ansys.aedt.core import Circuit - app = Circuit(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - # Getter and setter - my_res.location - my_res.parameters["R"]=100 - - ... - -Schematic in EMIT -~~~~~~~~~~~~~~~~~ -The following classes define the object properties for EMIT components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_emit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - EmitComponents - - -Schematic in Twin Builder -~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Twin Builder components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_twin_builder - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - TwinBuilderComponents - -.. code:: python - - from ansys.aedt.core import TwinBuilder - app = TwinBuilder(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - # Getter and setter - my_res.location - my_res.parameters["R"]=100 - - ... - - -Schematic in Maxwell Circuit -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Maxwell Circuit components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_maxwell_circuit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - MaxwellCircuitComponents diff --git a/doc/source/API/Setup.rst b/doc/source/API/Setup.rst deleted file mode 100644 index 3b2774a64d5..00000000000 --- a/doc/source/API/Setup.rst +++ /dev/null @@ -1,62 +0,0 @@ -Setup -===== -This section lists setup modules: - -* ``Setup`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor -* ``Setup3DLayout`` for HFSS 3D Layout -* ``SetupCircuit`` for Circuit and Twin Builder - -The ``Setup`` object is accessible through the ``create_setup`` method and ``setups`` object list. - -.. currentmodule:: ansys.aedt.core.modules.solve_setup - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SetupHFSS - SetupHFSSAuto - SetupSBR - SetupQ3D - SetupMaxwell - Setup - Setup3DLayout - SetupCircuit - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Setup class - my_setup = app.setups[0] - - - # This call returns a Setup object - setup = app.create_setup("MySetup") - - ... - - -Sweep classes -============= -This section lists sweep classes and their default values: - -* ``SweepHFSS`` for HFSS -* ``SweepHFSS3DLayout`` for HFSS 3D Layout -* ``SweepMatrix`` for Q3D and 2D Extractor - -The ``Setup`` object is accessible through the methods available for sweep creation. - - -.. currentmodule:: ansys.aedt.core.modules.solve_sweeps - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SweepHFSS - SweepHFSS3DLayout - SweepMatrix diff --git a/doc/source/API/SetupTemplates.rst b/doc/source/API/SetupTemplates.rst deleted file mode 100644 index 89a80c540c9..00000000000 --- a/doc/source/API/SetupTemplates.rst +++ /dev/null @@ -1,32 +0,0 @@ -Setup templates -=============== - -This section lists all setup templates with their default values and keys. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - Launch AEDT 2023 R1 in non-graphical mode - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - -.. toctree:: - :maxdepth: 2 - - SetupTemplatesHFSS - SetupTemplates3DLayout - SetupTemplatesMaxwell - SetupTemplatesQ3D - SetupTemplatesIcepak - SetupTemplatesMechanical - SetupTemplatesCircuit - SetupTemplatesTwinBuilder - SetupTemplatesRmxprt diff --git a/doc/source/API/SetupTemplates3DLayout.rst b/doc/source/API/SetupTemplates3DLayout.rst deleted file mode 100644 index 20007619039..00000000000 --- a/doc/source/API/SetupTemplates3DLayout.rst +++ /dev/null @@ -1,22 +0,0 @@ -HFSS 3D Layout and arguments -============================ - -This section lists all setup templates with their default values and keys available in HFSS 3D Layout. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - Launch AEDT 2023 R1 in non-graphical mode - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSS3DLayout diff --git a/doc/source/API/SetupTemplatesCircuit.rst b/doc/source/API/SetupTemplatesCircuit.rst deleted file mode 100644 index 32c3b59025b..00000000000 --- a/doc/source/API/SetupTemplatesCircuit.rst +++ /dev/null @@ -1,26 +0,0 @@ -Circuit templates and arguments -================================ - -This section lists all setup templates with their default values and keys available in Circuit. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximLNA -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximDC -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximQuickEye -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximVerifEye -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximAMI - diff --git a/doc/source/API/SetupTemplatesHFSS.rst b/doc/source/API/SetupTemplatesHFSS.rst deleted file mode 100644 index e3e09901dc6..00000000000 --- a/doc/source/API/SetupTemplatesHFSS.rst +++ /dev/null @@ -1,25 +0,0 @@ -HFSS templates and arguments -============================ - -This section lists all setup templates with their default values and keys available in HFSS. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenAuto -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSSBR - diff --git a/doc/source/API/SetupTemplatesIcepak.rst b/doc/source/API/SetupTemplatesIcepak.rst deleted file mode 100644 index 30d623930e1..00000000000 --- a/doc/source/API/SetupTemplatesIcepak.rst +++ /dev/null @@ -1,24 +0,0 @@ -Icepak templates and arguments -=============================== - -This section lists all setup templates with their default values and keys available in Icepak. -Note that Icepak parameters contain spaces. To use them as arguments of the ``"create_setup"`` method, these -same parameters have to be used without spaces. -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Icepak - - app = Icepak() - # Any property of this setup can be found on this page. - setup = app.create_setup(MaxIterations=5) - -Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``. - -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientFlowOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureAndFlow -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyFlowOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureAndFlow diff --git a/doc/source/API/SetupTemplatesMaxwell.rst b/doc/source/API/SetupTemplatesMaxwell.rst deleted file mode 100644 index 5ac02dcc9dc..00000000000 --- a/doc/source/API/SetupTemplatesMaxwell.rst +++ /dev/null @@ -1,23 +0,0 @@ -Maxwell templates and arguments -=============================== - - -This section lists all setup templates with their default values and keys available in Maxwell 2D and 3D. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Maxwell3d - - Maxwell3d = Maxwell3d () - # Any property of this setup can be found on this page. - setup = Maxwell3d.create_setup () - setup.props["MaximumPasses"] = 5 - setup.update () - -.. pprint:: ansys.aedt.core.modules.setup_templates.MaxwellTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.Magnetostatic -.. pprint:: ansys.aedt.core.modules.setup_templates.Electrostatic -.. pprint:: ansys.aedt.core.modules.setup_templates.EddyCurrent -.. pprint:: ansys.aedt.core.modules.setup_templates.ElectricTransient diff --git a/doc/source/API/SetupTemplatesMechanical.rst b/doc/source/API/SetupTemplatesMechanical.rst deleted file mode 100644 index 09b9adc824f..00000000000 --- a/doc/source/API/SetupTemplatesMechanical.rst +++ /dev/null @@ -1,23 +0,0 @@ -Mechanical templates and arguments -================================== - -This section lists all setup templates with their default values and keys available in Mechanical. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - - from ansys.aedt.core import Mechanical - - app = Mechanical() - # Any property of this setup can be found on this page. - setup = app.create_setup(MaxModes=6) - - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.MechTerm -.. pprint:: ansys.aedt.core.modules.setup_templates.MechModal -.. pprint:: ansys.aedt.core.modules.setup_templates.MechStructural - diff --git a/doc/source/API/SetupTemplatesQ3D.rst b/doc/source/API/SetupTemplatesQ3D.rst deleted file mode 100644 index 838e2cd68b7..00000000000 --- a/doc/source/API/SetupTemplatesQ3D.rst +++ /dev/null @@ -1,24 +0,0 @@ -Q3D templates and arguments -=========================== - - -This section lists all setup templates with their default values and keys available in Q3D and 2D Extractor. -Note that to use nested parameters, you can set a parameter using the "__" separator as shown in the following example. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - - from ansys.aedt.core import Q3d - - app = Q3d() - # Any property of this setup can be found on this page. - setup = app.create_setup(AC__MaxPasses=6) - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.Matrix -.. pprint:: ansys.aedt.core.modules.setup_templates.Close -.. pprint:: ansys.aedt.core.modules.setup_templates.Open - diff --git a/doc/source/API/SetupTemplatesRmxprt.rst b/doc/source/API/SetupTemplatesRmxprt.rst deleted file mode 100644 index 57fb82b99af..00000000000 --- a/doc/source/API/SetupTemplatesRmxprt.rst +++ /dev/null @@ -1,33 +0,0 @@ -RMXprt templates and arguments -============================== - -This section lists all setup templates with their default values and keys available in RMXprt. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.GRM -.. pprint:: ansys.aedt.core.modules.setup_templates.DFIG -.. pprint:: ansys.aedt.core.modules.setup_templates.TPIM -.. pprint:: ansys.aedt.core.modules.setup_templates.TPSM -.. pprint:: ansys.aedt.core.modules.setup_templates.BLDC -.. pprint:: ansys.aedt.core.modules.setup_templates.ASSM -.. pprint:: ansys.aedt.core.modules.setup_templates.PMDC -.. pprint:: ansys.aedt.core.modules.setup_templates.SRM -.. pprint:: ansys.aedt.core.modules.setup_templates.LSSM -.. pprint:: ansys.aedt.core.modules.setup_templates.UNIM -.. pprint:: ansys.aedt.core.modules.setup_templates.DCM -.. pprint:: ansys.aedt.core.modules.setup_templates.CPSM -.. pprint:: ansys.aedt.core.modules.setup_templates.NSSM - diff --git a/doc/source/API/SetupTemplatesTwinBuilder.rst b/doc/source/API/SetupTemplatesTwinBuilder.rst deleted file mode 100644 index 153c99fa365..00000000000 --- a/doc/source/API/SetupTemplatesTwinBuilder.rst +++ /dev/null @@ -1,21 +0,0 @@ -Twin Builder templates and arguments -==================================== - - -This section lists all setup templates with their default values and keys available in Twin Builder. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.TR diff --git a/doc/source/API/Stackup3D.rst b/doc/source/API/Stackup3D.rst deleted file mode 100644 index 439502b773d..00000000000 --- a/doc/source/API/Stackup3D.rst +++ /dev/null @@ -1,22 +0,0 @@ -Stackup 3D components -===================== -This section lists ``stackup_3d`` classes for creating and editing a stackup and objects in the 3D tools. -This consists of a set of one or more parametrized layer objects and placing lines, patches, polygons, -and vias. - - - -.. currentmodule:: ansys.aedt.core.modeler.advanced_cad - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - stackup_3d.Stackup3D - stackup_3d.Layer3D - stackup_3d.Padstack - stackup_3d.PadstackLayer - stackup_3d.Patch - stackup_3d.Trace - stackup_3d.Polygon - stackup_3d.NamedVariable diff --git a/doc/source/API/Variables.rst b/doc/source/API/Variables.rst deleted file mode 100644 index 168bdd55ea9..00000000000 --- a/doc/source/API/Variables.rst +++ /dev/null @@ -1,31 +0,0 @@ -Variable -======== -This module provides all functionalities for creating and editing -design and project variables in the 3D tools. - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the VariableManager class - variable_manager = self.aedtapp._variable_manager - - # Set and get a variable - app["w"] = "10mm" - a = app["w"] - ... - - -.. currentmodule:: ansys.aedt.core.application.variables - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VariableManager - Variable - DataSet - CSVDataset diff --git a/doc/source/API/Visualization.rst b/doc/source/API/Visualization.rst deleted file mode 100644 index dd31524bbb6..00000000000 --- a/doc/source/API/Visualization.rst +++ /dev/null @@ -1,73 +0,0 @@ -Visualization -============= - -This section outlines the available modules for creating and editing data within and outside AEDT. - -PyAEDT offers four primary levels of visualization: - -* **Reports** -* **Post-processing** -* **Graphics** -* **Advanced Visualization** - -Reports -~~~~~~~ - -AEDT provides extensive flexibility for generating reports. -PyAEDT includes dedicated classes to manipulate all report properties, offering full control over report customization. - -.. toctree:: - :maxdepth: 1 - - visualization/report - -.. image:: ../Resources/sparams.jpg - :width: 800 - :alt: S-Parameters - - -Post-processing -~~~~~~~~~~~~~~~ - -AEDT has different post-processing tools. -PyAEDT provides classes to interact with and modify any of these tools, -enhancing data analysis and visualization capabilities. - -.. toctree:: - :maxdepth: 1 - - visualization/post - -.. image:: ../Resources/field_plot.png - :width: 800 - :alt: Postprocessing features - - -Graphics -~~~~~~~~ - -Specialized plotting options. - -.. toctree:: - :maxdepth: 1 - - visualization/plot - -.. image:: ../Resources/pyvista_plot.jpg - :width: 800 - :alt: S-Parameters Matplotlib - - -Advanced Visualization -~~~~~~~~~~~~~~~~~~~~~~ - -High-level visualization tools. - -.. toctree:: - :maxdepth: 1 - - visualization/advanced - -.. image:: ../Resources/farfield.png - :width: 800 - :alt: Farfield pyvista diff --git a/doc/source/API/index.rst b/doc/source/API/index.rst deleted file mode 100644 index 0d7dbde7ad4..00000000000 --- a/doc/source/API/index.rst +++ /dev/null @@ -1,104 +0,0 @@ -============= -API reference -============= - -This section describes PyAEDT core classes, methods, and functions -for AEDT apps and modules. Use the search feature or click links -to view API documentation. -The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. -`AEDT `_ provides access to the Ansys gold-standard -electro-magnetics simulation solutions such as Ansys HFSS, -Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. -In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, -and Mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_2.png - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - -The PyAEDT API includes classes for apps and modules. You must initialize the -PyAEDT app to get access to all modules and methods. Available apps are: - -- `HFSS `_ -- `HFSS 3D Layout `_ -- `Maxwell 3D `_ -- `Maxwell 2D `_ -- `Maxwell Circuit `_ -- `Q3D `_ -- `Q2D Extractor `_ -- `Icepak `_ -- `Mechanical `_ -- RMXprt -- EMIT -- Circuit -- `TwinBuilder `_ -- `FilterSolutions `_ - - -All other classes and methods are inherited into the app class. -The desktop app is implicitly launched in any of the other applications. -Before accessing a PyAEDT app, the desktop app has to be launched and initialized. -The desktop app can be explicitly or implicitly initialized as shown in the following examples. - -Example with ``Desktop`` class explicit initialization: - -.. code:: python - - from ansys.aedt.core import launch_desktop, Circuit - d = launch_desktop(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here should be caught by the desktop app. - ... - d.release_desktop() - -Example with ``Desktop`` class implicit initialization: - -.. code:: python - - from ansys.aedt.core import Circuit - circuit = Circuit(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here should be caught by the desktop app. - ... - circuit.release_desktop() - - -.. toctree:: - :maxdepth: 2 - - Application - MaterialManagement - Primitives3D - Primitives2D - Primitive_Objects - Primitives3DLayout - PrimitivesCircuit - Boundaries - Mesh - Setup - Visualization - DesktopMessenger - Optimetrics - Variables - Constants - Configuration - SetupTemplates - CableModeling - - - - diff --git a/doc/source/API/visualization/advanced.rst b/doc/source/API/visualization/advanced.rst deleted file mode 100644 index 39dbc5fc16b..00000000000 --- a/doc/source/API/visualization/advanced.rst +++ /dev/null @@ -1,150 +0,0 @@ -Advanced -======== - -You can use PyAEDT for postprocessing of AEDT results to display graphics object and plot data. - - -Touchstone -~~~~~~~~~~ - -TouchstoneData class is based on `scikit-rf `_ package and allows advanced -touchstone post-processing. -The following methods allows to read and check touchstone files. - -.. currentmodule:: ansys.aedt.core.visualization.advanced.touchstone_parser - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - TouchstoneData.get_insertion_loss_index - TouchstoneData.plot_insertion_losses - TouchstoneData.plot - TouchstoneData.plot_return_losses - TouchstoneData.get_mixed_mode_touchstone_data - TouchstoneData.get_return_loss_index - TouchstoneData.get_insertion_loss_index_from_prefix - TouchstoneData.get_next_xtalk_index - TouchstoneData.get_fext_xtalk_index_from_prefix - TouchstoneData.plot_next_xtalk_losses - TouchstoneData.plot_fext_xtalk_losses - TouchstoneData.get_worst_curve - read_touchstone - check_touchstone_files - find_touchstone_files - - -Here an example on how to use TouchstoneData class. - -.. code:: python - - from ansys.aedt.core.visualization.advanced.touchstone_parser import TouchstoneData - - ts1 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1234.s8p")) - assert ts1.get_mixed_mode_touchstone_data() - ts2 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1324.s8p")) - assert ts2.get_mixed_mode_touchstone_data(port_ordering="1324") - - assert ts1.plot_insertion_losses(plot=False) - assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False) - - -Farfield -~~~~~~~~ - -PyAEDT offers sophisticated tools for advanced farfield post-processing. -There are two complementary classes: ``FfdSolutionDataExporter`` and ``FfdSolutionData``. - -- FfdSolutionDataExporter: Enables efficient export and manipulation of farfield data. It allows users to convert simulation results into a standard metadata format for further analysis, or reporting. - -- FfdSolutionData: Focuses on the direct access and processing of farfield solution data. It supports a comprehensive set of postprocessing operations, from visualizing radiation patterns to computing key performance metrics. - - -.. currentmodule:: ansys.aedt.core.visualization.advanced.farfield_visualization - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FfdSolutionData - - -This code shows how you can get the farfield data and perform some post-processing: - -.. code:: python - - import ansys.aedt.core - from ansys.aedt.core.generic.farfield_visualization import FfdSolutionDataExporter - app = ansys.aedt.core.Hfss() - ffdata = app.get_antenna_data(frequencies=None, - setup="Setup1 : Sweep", - sphere="3D", - variations=None, - overwrite=False, - link_to_hfss=True, - export_touchstone=True) - incident_power = ffdata.incident_power - ffdata.plot_cut(primary_sweep="Theta", theta=0) - ffdata.plot_contour(polar=True) - ffdata.plot_3d(show_geometry=False) - app.release_desktop(False, False) - -If you exported the farfield data previously, you can directly get the farfield data: - -.. code:: python - - from ansys.aedt.core.generic.farfield_visualization import FfdSolutionData - input_file = r"path_to_ffd\pyaedt_antenna_metadata.json" - ffdata = FfdSolutionData(input_file) - incident_power = ffdata.incident_power - ffdata.plot_cut(primary_sweep="Theta", theta=0) - ffdata.plot_contour(polar=True) - ffdata.plot_3d(show_geometry=False) - app.release_desktop(False, False) - -The following diagram shows both classes work. You can use them independently or from the ``get_antenna_data`` method. - - .. image:: ../../_static/farfield_visualization_pyaedt.png - :width: 800 - :alt: Farfield data with PyAEDT - - -If you have existing farfield data, or you want to export it manually, you can still use FfdSolutionData class. - - .. image:: ../../_static/farfield_visualization_aedt.png - :width: 800 - :alt: Farfield data with AEDT - - -Heterogeneous data message -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Heterogeneous data message (HDM) is the file exported from SBR+ solver containing rays information. -The following methods allows to read and plot rays information. - -.. currentmodule:: ansys.aedt.core.visualization.advanced - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - hdm_plot.HDMPlotter - sbrplus.hdm_parser.Parser - - -Miscellaneous -~~~~~~~~~~~~~ - -PyAEDT has additional advanced post-processing features: - -.. currentmodule:: ansys.aedt.core.visualization.advanced.misc - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - convert_nearfield_data - parse_rdat_file - nastran_to_stl - simplify_stl - diff --git a/doc/source/API/visualization/plot.rst b/doc/source/API/visualization/plot.rst deleted file mode 100644 index a00e71715c3..00000000000 --- a/doc/source/API/visualization/plot.rst +++ /dev/null @@ -1,79 +0,0 @@ -Graphics operations -=================== - -PyAEDT enables powerful post-processing of AEDT results, -allowing you to visualize graphics objects and plot data with ease. - -PyAEDT supports external report capabilities available with installed third-party -packages like `pyvista `_, `matplotlib `_, -`pandas `_, and `numpy `_. - - -There have three main categories: - -* **Three-dimensional visualization** -* **Graph visualization** -* **PDF** - - -Three-dimensional visualization -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -PyAEDT benefits of `pyvista `_ package and allows to generate -models and 3D plots. - -.. currentmodule:: ansys.aedt.core.visualization.plot.pyvista - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ModelPlotter - FieldClass - ObjClass - - -Graph visualization -~~~~~~~~~~~~~~~~~~~ - -PyAEDT benefits of `matplotlib `_ package and allows to generate 2D plots. - - -.. currentmodule:: ansys.aedt.core.visualization.plot.matplotlib - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ReportPlotter - is_notebook - - -PDF -~~~ - -PyAEDT benefits of `fpdf2 `_ package and allows to generate PDF files. - -.. currentmodule:: ansys.aedt.core.visualization.plot.pdf - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - AnsysReport.read_template - AnsysReport.header - AnsysReport.footer - AnsysReport.create - AnsysReport.add_project_info - AnsysReport.add_section - AnsysReport.add_chapter - AnsysReport.add_sub_chapter - AnsysReport.add_image - AnsysReport.add_caption - AnsysReport.add_empty_line - AnsysReport.add_page_break - AnsysReport.add_table - AnsysReport.add_text - AnsysReport.add_toc - AnsysReport.save_pdf - AnsysReport.add_chart diff --git a/doc/source/API/visualization/post.rst b/doc/source/API/visualization/post.rst deleted file mode 100644 index d8490fc6933..00000000000 --- a/doc/source/API/visualization/post.rst +++ /dev/null @@ -1,266 +0,0 @@ -AEDT post-processing -==================== - -AEDT offers a wide range of powerful post-processing tools for advanced data analysis and visualization. -PyAEDT provides dedicated classes that allow you to seamlessly interact with and modify these tools, expanding the scope of your data insights - - -.. note:: - Some functionalities are available only when AEDT is running - in graphical mode. - - -Core -~~~~ - -The following classes grant access to the core post-processing functionalities of AEDT: - -* **PostProcessor3D**: This class is utilized across all 3D applications, including HFSS, HFSS 3D Layout, Maxwell 3D and 2D, Q3D Extractor, and Mechanical AEDT. - -* **PostProcessorIcepak**: A specialized class for Icepak, which extends the ``PostProcessor3D`` class by adding features tailored to thermal analysis. - -* **PostProcessorCircuit**: This class handles schematic post-processing, supporting Circuit and Twin Builder applications. - - -.. currentmodule:: ansys.aedt.core.visualization.post.post_common_3d - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessor3D - -.. currentmodule:: ansys.aedt.core.visualization.post.post_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessorIcepak - -.. currentmodule:: ansys.aedt.core.visualization.post.post_circuit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessorCircuit - - -You can access these classes directly from the design object: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the PostProcessor class - post = app.post - - # This call returns a FieldPlot object - plotf = post.create_fieldplot_volume(objects, quantity_name, setup_name, intrinsics) - - # This call returns a SolutionData object - my_data = post.get_solution_data(expressions=trace_names) - - # This call returns a new standard report object and creates one or multiple reports from it. - standard_report = post.reports_by_category.standard("db(S(1,1))") - report_standard.create() - sols = report_standard.get_solution_data() - - -User can get the properties of the default reports using the following class: - -.. currentmodule:: ansys.aedt.core.visualization.post.common - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Reports - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.visualization.post.common import Reports - app = Hfss(specified_version="2024.2", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - reports = Reports(app.post, app.design_type) - app.release_desktop(False, False) - - -AEDT data is returned in a structured format, providing organized and detailed results. -For a comprehensive overview of the data structure and its capabilities, refer to the class definition below: - - -.. currentmodule:: ansys.aedt.core.visualization.post.solution_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SolutionData - - -Field -~~~~~ - -AEDT offers additional specialized post-processing features for enhanced 3D field visualization and control. - - -The following classes manage all aspects of AEDT 3D post-processing and are utilized by the ``PostProcessor3D`` class: - -.. currentmodule:: ansys.aedt.core.visualization.post.field_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldPlot - -.. code:: python - - from ansys.aedt.core import Hfss - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = app.post.create_fieldplot_line(quantity="Mag_E", assignment=p1.name) - report.create() - app.release_desktop(False, False) - - -Additionally, the following classes control field overlay settings, -enabling precise adjustments to visualization parameters: - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ColorMapSettings - AutoScale - MinMaxScale - Scale3DSettings - NumberFormat - MarkerSettings - ArrowSettings - FolderPlotSettings - -The ``fields_calculator`` module includes the ``FieldsCalculator`` class. -It provides methods to interact with AEDT Fields Calculator by adding, loading and deleting custom expressions. - -.. currentmodule:: ansys.aedt.core.visualization.post.fields_calculator - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldsCalculator - - -HFSS -~~~~ - -For HFSS solutions, there are two additionally features: virtual ray tracing and farfield exporter. - -To define and control virtual ray tracing (VRT) you can use: - -.. currentmodule:: ansys.aedt.core.visualization.post.vrt_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VRTFieldPlot - - -If you need to export HFSS far field data, then you can use the following feature to obtain the antenna metadata: - -.. currentmodule:: ansys.aedt.core.visualization.post.farfield_exporter - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FfdSolutionDataExporter - -.. code:: python - - from ansys.aedt.core import Hfss - - app = Hfss() - - antenna_data = app.post.get_antenna_data() - app.release_desktop(False, False) - - -Icepak -~~~~~~ - -The ``monitor_icepak`` module includes the classes listed below to add, modify, and manage monitors during simulations. -Retrieve monitor values for post-processing and analysis to gain insights into key simulation metrics. -Methods and properties are accessible through the ``monitor`` property of the ``Icepak`` class. - -.. currentmodule:: ansys.aedt.core.visualization.post.monitor_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Monitor - - -The ``field_summary`` module includes the classes listed below to the ``Icepak`` field summary. - -.. currentmodule:: ansys.aedt.core.visualization.post.field_summary - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldSummary - - -Additional tools -~~~~~~~~~~~~~~~~ - -Finally, users can use additional AEDT postprocessing tools like SPiSim: - -.. currentmodule:: ansys.aedt.core.visualization.post.spisim - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SpiSim - - -.. currentmodule:: ansys.aedt.core.visualization.post.spisim_com_configuration_files.com_parameters - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - COMParameters - COMParametersVer3p4 - - -If you are looking for Virtual Compliance post processing, you should use this set of features: - -.. currentmodule:: ansys.aedt.core.visualization.post.compliance - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VirtualComplianceGenerator - VirtualCompliance \ No newline at end of file diff --git a/doc/source/API/visualization/report.rst b/doc/source/API/visualization/report.rst deleted file mode 100644 index d922cd08990..00000000000 --- a/doc/source/API/visualization/report.rst +++ /dev/null @@ -1,81 +0,0 @@ -Report management -================= - -AEDT provides extensive flexibility for generating reports. - - -PyAEDT includes dedicated classes to manipulate all report properties, -offering full control over report customization. - -.. note:: - Some functionalities are available only when AEDT is running - in graphical mode. - - -.. currentmodule:: ansys.aedt.core.visualization.report - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - standard.Standard - standard.Spectral - field.AntennaParameters - field.Fields - field.NearField - field.FarField - field.Emission - eye.EyeDiagram - eye.AMIConturEyeDiagram - eye.AMIEyeDiagram - emi.EMIReceiver - - -The following code shows how to use report modules in standalone mode. - -.. code:: python - - # Create `Mag_E` report in a polyline - - from ansys.aedt.core import Hfss - from ansys.aedt.core.visualization.report.field import Fields - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = Fields(app=app, report_category="Fields", - setup_name=setup.name + " : LastAdaptive", - expressions="Mag_E") - report.polyline = p1.name - report.create() - - app.release_desktop(False, False) - - -You can use these classes directly from the application object: - -.. code:: python - - # Create `Mag_E` report in a polyline - - from ansys.aedt.core import Hfss - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = app.post.reports_by_category.fields("Mag_E", setup.name + " : LastAdaptive", p1.name) - report.create() - - app.release_desktop(False, False) diff --git a/doc/source/Getting_started/About.rst b/doc/source/Getting_started/About.rst deleted file mode 100644 index 5f42b245b34..00000000000 --- a/doc/source/Getting_started/About.rst +++ /dev/null @@ -1,86 +0,0 @@ -About PyAnsys and AEDT -====================== - -PyAnsys -------- - -PyAEDT is part of the larger `PyAnsys `_ -effort to facilitate the use of Ansys technologies directly from Python. - -PyAEDT is intended to consolidate and extend all existing -functionalities around scripting for AEDT to allow reuse of existing code, -sharing of best practices, and increased collaboration. - - -About AEDT ----------- - -`AEDT `_ is a platform that enables true -electronics system design. AEDT provides access to the Ansys gold-standard -electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell, -Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. - -In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid, -and mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_collage.jpg - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - - -PyAEDT is licensed under the `MIT License -`_. - -PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products: - -- HFSS and HFSS 3D Layout -- Icepak -- Maxwell 2D, Maxwell 3D, and RMXprt -- 2D Extractor and Q3D Extractor -- Mechanical -- Nexxim -- EDB -- Twin Builder - - -Dependencies ------------- -To run PyAEDT, you must have a local licensed copy of AEDT. -PyAEDT supports AEDT versions 2022 R2 and later. - -Student version ---------------- - -PyAEDT supports AEDT Student versions 2022 R2 and later. For more information, see the -`Ansys Electronics Desktop Student - Free Software Download `_ page on the Ansys website. - - -Why PyAEDT? ------------ -A quick and easy approach for automating a simple operation in the -AEDT UI is to record and reuse a script. However, here are some disadvantages of -this approach: - -- Recorded code is dirty and difficult to read and understand. -- Recorded scripts are difficult to reuse and adapt. -- Complex coding is required by many global users of AEDT. - -Here are the main advantages that PyAEDT provides: - -- Automatic initialization of all AEDT objects, such as desktop - objects like the editor, boundaries, and more -- Error management -- Log management -- Variable management -- Compatibility with IronPython (limited) and CPython -- Simplification of complex API syntax using data objects while - maintaining PEP8 compliance. -- Code reusability across different solvers -- Clear documentation on functions and API -- Unit tests of code to increase quality across different AEDT versions - diff --git a/doc/source/Getting_started/ClientServer.rst b/doc/source/Getting_started/ClientServer.rst deleted file mode 100644 index 712a1bb6cb9..00000000000 --- a/doc/source/Getting_started/ClientServer.rst +++ /dev/null @@ -1,93 +0,0 @@ -Client-server -============= -You can launch PyAEDT on a remote machine if these conditions are met: - -- AEDT and PyAEDT is installed on client and server machines. -- The same Python version is used on the client and server machines. (CPython 3.8+ - is embedded in the AEDT installation.) - -gRPC connection in AEDT 2022 R2 and later -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In AEDT 2022 R2 and later, PyAEDT fully supports the gRPC API (except for EDB): - -.. code:: python - - # Launch the latest installed version of AEDT in graphical mode. - from ansys.aedt.core import Hfss - from ansys.aedt.core import settings - settings.use_grpc_api=True - hfss = Hfss(machine="fullmachinename", port=portnumber) - -If the ``machine`` argument is provided and the machine is a remote machine, AEDT -must be up and running on the remote server listening on the specified port ``portnumber``. - -To start AEDT in listening mode on the remote machine: - -.. code:: - - path/to/ANSYSEM/v222/Win64/ansysedt.exe -grpcsrv portnumber #windows - path/to/ANSYSEM/v222/Lin64/ansysedt -grpcsrv portnumber #linux - -If the connection is local, the ``machine`` argument must be left empty. PyAEDT then -starts the AEDT session automatically. Machine and port arguments are available to -all applications except EDB. - - -PyAEDT remote service manager -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PyAEDT includes a service manager that can be run on the server machine and can be -launched on-demand in AEDT sessions and act as a file manager. -You can make a remote application call on a CPython server -or any Windows client machine in AEDT 2022 R2 and later. - -On a CPython Server run the ``pyaedt_service_manager`` service that listens on port 17878 -for incoming requests of connections from clients. The port is configurable. -Requirements: - -- Python 3.8+ Virtual Environment. -- pyaedt > 0.6.0 - -On Linux, in addition to the preceding requirements, these environments are needed: -- You can use the CPython version in the AEDT installation folder if you first -add the Python library folder to the ``LD_LIBRARY_PATH`` environment variable. -- You can use the Python 3.8 or later version that is installed. -- You can export ``ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64``. -- You can export ``LD_LIBRARY_PATH=$ANSYSEM_ROOT242/common/mono/Linux64/lib:$ANSYSEM_ROOT242/Delcross:$LD_LIBRARY_PATH``. - -On the server, the ``pyaedt_service_manager`` service listen for incoming connections: - -.. code:: python - - # Launch PyAEDT remote server on CPython - from ansys.aedt.core.common_rpc import pyaedt_service_manager - pyaedt_service_manager() - - -On any client machine, the user must establish the connection as shown in following example. -AEDT can be launched directly while creating the session or after the connection is established. - -.. code:: python - - from ansys.aedt.core.common_rpc import create_session - # User can establish the connection and start a new AEDT session - cl1 = create_session("server_name", launch_aedt_on_server=True, aedt_port=17880, non_graphical=True) - - # Optionally AEDT can be launched after the connection is established - cl2 = create_session("server_name", launch_aedt_on_server=False) - cl2.aedt(port=17880, non_graphical=True) - - -Once AEDT is started then user can connect an application to it. - -.. code:: python - - hfss = Hfss(machine=cl1.server_name, port=cl1.aedt_port) - # your code here - -The client can be used also to upload or download files from the server. - -.. code:: python - - cl1.filemanager.upload(local_path, remote_path) - file_content = cl1.open_file(remote_file) - diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst deleted file mode 100644 index b62237fa983..00000000000 --- a/doc/source/Getting_started/Contributing.rst +++ /dev/null @@ -1,206 +0,0 @@ -.. _contributing_aedt: - -========== -Contribute -========== -Overall guidance on contributing to a PyAnsys repository appears in -`Contribute `_ -in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar -with this guide, paying particular attention to `Guidelines and Best Practices -`_, before attempting -to contribute to PyAEDT. - -The following contribution information is specific to PyAEDT. - -Clone the repository --------------------- -To clone and install the latest version of PyAEDT in -development mode, run: - -.. code:: - - git clone https://github.com/ansys/pyaedt - cd pyaedt - python -m pip install --upgrade pip - pip install -e . - -Post issues ------------ -Use the `PyAEDT Issues `_ -page to submit questions, report bugs, and request new features. - -To reach the product support team, email `pyansys.core@ansys.com `_. - -View PyAEDT documentation -------------------------- -Documentation for the latest stable release of PyAEDT is hosted at -`PyAEDT Documentation `_. - -In the upper right corner of the documentation's title bar, there is an option -for switching from viewing the documentation for the latest stable release -to viewing the documentation for the development version or previously -released versions. - -Code style ----------- -PyAEDT complies with the `PyAnsys code style -`_. -`pre-commit `_ is applied within the CI/CD to ensure compliance. -The ``pre-commit`` Python package can be installed -and run as follows: - -.. code:: bash - - pip install pre-commit - pre-commit run --all-files - -You can also install this as a pre-commit hook with: - -.. code:: bash - - pre-commit install - -This way, it's not possible for you to push code that fails the style checks. -For example:: - - $ pre-commit install - $ git commit -am "Add my cool feature." - black....................................................................Passed - isort (python)...........................................................Passed - flake8...................................................................Passed - codespell................................................................Passed - debug statements (python)................................................Passed - trim trailing whitespace.................................................Passed - Validate GitHub Workflows................................................Passed - blacken-docs.............................................................Passed - -Naming conventions -~~~~~~~~~~~~~~~~~~ -Consistency of names helps improve readability and -ease of use. Starting with release 0.8 a concerted effort -has been made to -improve consistency of naming and adherence to -:ref:`PEP-8`_. - -For example, methods used to create or access entities in -AEDT require that a name be passed to the method or function -as an argument. -It is tempting to -include context as part of that variable name. For example, while it is tempting to use -``setupname`` -as an argument to :meth:`Hfss.create_setup`_, -the context "setup" is -explicitly defined by the method name. The variable ``name`` provides -a more compact -description of the variable in this context. - -In previous PyAEDT versions, you can also find both ``setup_name`` and ``setupname`` used -for various methods or classes. -Improving naming consistency improves maintainability and readability. - -The following table illustrates the recommended conventions: - -.. list-table:: Keywords and object names - :widths: 25 25 50 - :header-rows: 1 - - * - Old name - - New name - - Example - * - ``setupname``, ``setup_name``, ``sweepname`` - - ``name`` - - ``Hfss.create_setup()``, ``Hfss.create_linear_step_sweep()`` - * - ``usethickness`` - - ``thickness`` - - ``Hfss.assign_coating()`` - * - ``entities`` - - ``assignment`` - - ``Maxwell.assign_current_density()`` - * - ``entity_list`` - - ``assignment`` - - ``Maxwell.assign_symmetry()`` - -Take care to use descriptive names for -variables and classes that adhere to PEP-8 and are consistent with conventions already -used in PyAEDT. - -Log errors -~~~~~~~~~~ -PyAEDT has an internal logging tool named ``Messenger`` -and a log file that is automatically generated in the project -folder. - -The following examples demonstrate how ``Messenger`` is used to -write both to the internal AEDT message windows and the log file: - -.. code:: python - - self.logger.error("This is an error message.") - self.logger.warning("This is a warning message.") - self.logger.info("This is an info message.") - -These examples demonstrate how to write messages only to the log file: - -.. code:: python - - self.logger.error("This is an error message.") - self.logger.warning("This is a warning message.") - self.logger.info("This is an info message.") - - -Handle exceptions -~~~~~~~~~~~~~~~~~ -PyAEDT uses a specific decorator, ``@pyaedt_function_handler``, -to handle exceptions caused by methods and by the AEDT API. -This exception handler decorator makes PyAEDT fault tolerant -to errors that can occur in any method. - -For example: - -.. code:: python - - @pyaedt_function_handler() - def my_method(self, var): - pass - -Every method can return a value of ``True`` when successful or -``False`` when failed. When a failure occurs, the error -handler returns information about the error in both the console and -log file. - -Here is an example of an error: - -.. code:: - - ---------------------------------------------------------------------------------- - PyAEDT error on method create_box: General or AEDT error. Check again - the arguments provided: - position = [0, 0, 0] - dimensions_list = [0, 10, 10] - name = None - material = None - ---------------------------------------------------------------------------------- - - (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147024381), None) - File "C:\GIT\repos\AnsysAutomation\PyAEDT\Primitives.py", line 1930, in create_box - o.name = self.oeditor.createbox(vArg1, vArg2) - - ************************************************************ - Method Docstring: - - Create a box. - - Parameters - ---------- - ... - - -Hard-coded values -~~~~~~~~~~~~~~~~~~ -Do not write hard-coded values to the registry. Instead, use the Configuration service. - -Maximum line length -~~~~~~~~~~~~~~~~~~~ -Best practice is to keep the length at or below 120 characters for code, -and comments. Lines longer than this might not display properly on some terminals -and tools or might be difficult to follow. diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst deleted file mode 100644 index ff37cae9cc9..00000000000 --- a/doc/source/Getting_started/Installation.rst +++ /dev/null @@ -1,197 +0,0 @@ -Installation -============ -PyAEDT consolidates and extends all existing capital around scripting for AEDT, -allowing re-use of existing code, sharing of best practices, and collaboration. - -This PyAnsys library has been tested on HFSS, Icepak, and Maxwell 3D. It also provides -basic support for EDB and Circuit (Nexxim). - -Requirements -~~~~~~~~~~~~ -In addition to the runtime dependencies listed in the installation information, PyAEDT -requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Version is also supported. - - -Install from PyAEDT installer -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following python script automatically installs PyAEDT from AEDT, -using the CPython interpreter included in the AEDT installation. - -In order to do that you can: - -- Download the following file: :download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>` - -- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. - -- Offline install is also possible using wheelhouses. - -.. note:: - A wheelhouse is a zip containing all needed packages that can be installed offline. - PyAEDT wheelhouse can be found at `Releases `_. - After downloading the wheelhouse zip specific for your distribution and Python release, - run the script from Electronics Desktop using the zip full path as argument. - Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2 - and higher requires the Python 3.10 wheelhouse. - -.. image:: ../Resources/wheelhouse_installation.png - :width: 800 - :alt: PyAEDT run script - -Starting from 2023R2, buttons are available in the Automation Tab as in the example below. - -.. image:: ../Resources/toolkits_ribbon.png - :width: 800 - :alt: PyAEDT toolkit buttons available in AEDT - - -Extension manager -~~~~~~~~~~~~~~~~~ -The user can install or uninstall automated workflows using the extension manager. -There are three options: - -- **Pre-installed extensions** already available in the PyAEDT library. - -- **Open source PyAEDT toolkits** described in the `PyAEDT Common Toolkit documentation `_. - -- **Custom PyAEDT extensions**. - -See `Extension Manager `_ for more information. - -.. image:: ../Resources/toolkit_manager_1.png - :width: 800 - :alt: PyAEDT toolkit manager 1 - -The user can select the AEDT application to install the specific workflow. - -.. image:: ../Resources/toolkit_manager_2.png - :width: 400 - :alt: PyAEDT toolkit manager 2 - -For additional information about AEDT extensions, -see `Extensions `_. - - -Install on CPython from PyPI -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can install PyAEDT on CPython from PyPI: - -.. code:: python - - pip install pyaedt - -You can also install PyAEDT from Conda-Forge: - -.. code:: python - - conda install -c conda-forge pyaedt - -To ensure you have all the necessary dependencies, including optional components, use the following command: - -.. code:: python - - pip install pyaedt[all] - -If you are not utilizing gRPC, you can install the required dotnet dependencies separately: - -.. code:: python - - pip install pyaedt[dotnet] - -If you want to install the PyAEDT panels in the AEDT Automation tab, use the following command: - -.. code:: python - - pip install pyaedt[installer] - -Finally, in the python console, run the following commands: - -.. code:: - - from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt - add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") - -You can also install the PyAEDT panels using the following steps, this is also useful if you have a centralized PyAEDT installation: - -- Download the following file: :download:`PyAEDT panel Installer Python file <../Resources/toolkit_installer_from_aedt.py>` - -- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the python interpreter in which PyAEDT is installed. - -- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. You do not need the previous step if -you pass as an argument the path of the python interpreter. - - -Linux support -~~~~~~~~~~~~~ - -PyAEDT works with CPython 3.8 through 3.12 on Linux in AEDT 2022 R2 and later. -However, you must set up the following environment variables: - -.. code:: - - export ANSYSEM_ROOT222=/path/to/AedtRoot/AnsysEM/v222/Linux64 - export LD_LIBRARY_PATH=$ANSYSEM_ROOT222/common/mono/Linux64/lib64:$ANSYSEM_ROOT222/Delcross:$LD_LIBRARY_PATH - - -Install offline from a wheelhouse -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Using a wheelhouse can be helpful if you work for a company that restricts access to external networks. - -Wheelhouses for CPython 3.8, 3.9, 3.10, 3.11, and 3.12 are available in the releases for both Windows and Linux. -From the `Releases `_ -page in the PyAEDT repository, you can find the wheelhouses for a particular release in its -assets and download the wheelhouse specific to your setup. - -There are two kind of wheelhouses: `all` and `installer`. - -The `all` wheelhouse contains all PyAEDT dependencies. And the `installer` one includes `ipython` and `jupyter lab`. - -You can then install PyAEDT and all of its dependencies from one single entry point that can be shared internally, -which eases the security review of the PyAEDT package content. - -For example, on Windows with Python 3.10, install PyAEDT and all its dependencies from a wheelhouse with code like this: - -.. code:: - - pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[all] - -If you want to add the PyAEDT panels in the AEDT Automation tab, you need first to install the installer dependencies: - -.. code:: - - pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[installer] - -Finally, in the python console, run the following commands: - -.. code:: - - from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt - add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") - - -Install PyAEDT in Conda virtual environment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Create virtual environment - -.. code:: bash - - conda create --name pyaedt_py310 python=3.10 - -Activate virtual environment - -.. code:: bash - - conda activate pyaedt_py310 - -You can also install PyAEDT from Conda-Forge with this command: - -.. code:: bash - - conda install -c conda-forge pyaedt - - -Upgrade PyAEDT to the latest version -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code:: bash - - pip install -U pyaedt diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst deleted file mode 100644 index 1d62085640f..00000000000 --- a/doc/source/Getting_started/Troubleshooting.rst +++ /dev/null @@ -1,201 +0,0 @@ -Troubleshooting -=============== -This section contains common issues and suggestions related to installation and use of PyAEDT. - -Installation -~~~~~~~~~~~~ - -Error installing Python or Conda --------------------------------- -Sometimes companies do not allow installation of a Python interpreter. -In this case, you can use the Python interpreter available in the AEDT installation. - -.. note:: - - Python 3.7 is available in AEDT 2023 R1 and earlier. Python 3.10 is available in AEDT 2023 R2. - -Here is the path to the Python 3.10 interpreter for the 2024 R2 installation: - -.. code:: python - - path\to\AnsysEM\v242\commonfiles\CPython\3_10\winx64\Release\python" - - -Error installing PyAEDT using pip ---------------------------------- -- **Proxy server**: If your company uses a proxy server, you may have to update proxy - settings at the command line. For more information, see the `Using a Proxy - Server `_ in the pip - documentation. -- **Install permission**: Make sure that you have write access to the directory where the - Python interpreter is - installed. The use of a `virtual environment `_ helps - mitigate this issue by placing the Python interpreter and dependencies in a location that is owned - by the user. -- **Firewall**: Some corporate firewalls may block pip. If you face this issue, you'll have to work with your IT - administrator to enable pip. The proxy server settings (described earlier) allow you to explicitly define - the ports used by pip. - -If downloads from `pypi `_ are not allowed, you may use a -`wheelhouse `_. -The wheelhouse file contains all dependencies for PyAEDT and allows full installation without a need to -download additional files. -The wheelhouse for PyAEDT can be found `here `_. -After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and -run the Python command: - -.. code:: python - - >>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyaedt - - -Another option to install PyAEDT from the wheelhouse is to download the following file -:download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>`. -Run this script directly from AEDT and pass the wheelhouse file name as an argument. - - - - -Run PyAEDT -~~~~~~~~~~ - -COM and gRPC ------------- -Prior to the 2022 R2 release, CPython automation in AEDT used -`COM `_ , which -requires all interfaces to be registered in the Windows Registry. -Communication between Python and the AEDT API were translated through an intermediate layer using -`pywin32 `_ and `PythonNET `_. - -`gRPC `_ is a modern open source high performance Remote Procedure Call (RPC) -framework that can run in any environment and supports client/server remote calls. -Starting from 2022R2 the AEDT API has replaced the COM interface with a gRPC interface. - - -.. list-table:: *gRPC Compatibility:* - :widths: 65 65 65 - :header-rows: 1 - - * - < 2022 R2 - - 2022 R2 - - > 2022 R2 - * - Only ``Python.NET`` - - | ``Python.NET``: *Default* - | Enable gRPC: ``ansys.aedt.core.settings.use_grpc_api = True`` - - | gRPC: *Default* - | Enable ``Python.NET``: ``ansys.aedt.core.settings.use_grpc_api = False`` - -The options shown here apply only to the Windows platform. -On Linux, the Python interface to AEDT uses gRPC for all versions. - -.. _GRPC ref: - -Check the AEDT API configuration --------------------------------- -Run the following command to start AEDT as a gRPC server: - -*Windows:* - -.. code:: console - - path\to\AnsysEM\v231\Win64\ansysedt.exe -grpcsrv 50001 - -**On Linux:** - -.. code:: console - - path\to\AnsysEM\v231\Lin64\ansysedt -grpcsrv 50352 - -The server port number is used by AEDT to listen and receive -commands from the PyAEDT client. This configuration -supports multiple sessions of AEDT running on a single server -and listening on the same port. - -Check the gRPC interface ------------------------- -The native Electronics Desktop API can be used to launch -AEDT from the command line. -PyAEDT is not required to verify the setup for the server and ensure that -all environment -variables have been defined correctly. - -.. code:: python - - import sys - sys.path.append(r"ANSYSEM_ROOT231\PythonFiles\DesktopPlugin") - import ScriptEnv - print(dir()) - ScriptEnv.Initialize("", False, "", 50051) - print(dir()) - - - -Failure connecting to the gRPC server -------------------------------------- -On Linux, PyAEDT may fail to initialize a new instance of the gRPC server -or connect to an existing server session. -This may be due to: - -- Firewall -- Proxy -- Permissions -- License -- Scheduler (for example if the gRPC server was started from LSF or Slurm) - -For issues related to use of a proxy server, you may set the following environment variable to -disable the proxy server for the *localhost*. - -.. code:: console - - export no_proxy=localhost,127.0.0.1 - -Run your PyAEDT script. - -If it still fails, you can disable the proxy server: - -.. code:: console - - export http_proxy= - -Run your PyAEDT script. If the errors persist, perform these steps: - -1. Check that AEDT starts correctly from the command line by - starting the :ref:`gRPC server`. -2. Enable debugging. - -.. code:: console - - export ANSOFT_DEBUG_LOG=/tmp/testlogs/logs/lg - export ANSOFT_DEBUG_LOG_SEPARATE=1 - export ANSOFT_DEBUG_LOG_TIMESTAMP=1 - export ANSOFT_DEBUG_LOG_THREAD_ID=1 - export ANSOFT_DEBUG_MODE=3 - - -Enable the gRPC trace on the server: - -.. code:: console - - export GRPC_VERBOSITY=DEBUG - export GRPC_TRACE=all - -Then run ansysedt.exe as a gRPC server and redirect the output. - -.. code:: console - - ansysedt -grpcsrv 50051 > /path/to/file/server.txt - -The preceding command redirects the gRPC trace -to the file ``server.txt``. - -Open another terminal window to trace the -gRPC calls on the client where the Python script is to be run. - -.. code:: console - - export GRPC_VERBOSITY=DEBUG - export GRPC_TRACE=all - -Now run the PyAEDT script, (making sure it connects to the same port as the gRPC server - 50051). -Capture the output in a file. For example *client.txt*. Then send all the logs -to `Ansys Support `_. diff --git a/doc/source/Getting_started/index.rst b/doc/source/Getting_started/index.rst deleted file mode 100644 index a981d1a5f83..00000000000 --- a/doc/source/Getting_started/index.rst +++ /dev/null @@ -1,132 +0,0 @@ -Getting started -=============== - -.. grid:: 2 - - .. grid-item-card:: About PyAnsys and AEDT - :link: About - :link-type: doc - :margin: 2 2 0 0 - - Learn more about PyAnsys and AEDT. - - .. grid-item-card:: Installation - :link: Installation - :link-type: doc - :margin: 2 2 0 0 - - Learn how to install PyAEDT from PyPi or Conda. - - .. grid-item-card:: User guide - :link: ../User_guide/index - :link-type: doc - :margin: 2 2 0 0 - - This section provides in-depth information on PyAEDT key concepts. - - .. grid-item-card:: Client-Server - :link: ClientServer - :link-type: doc - :margin: 2 2 0 0 - - Launch PyAEDT on a client machine and control Electronics Desktop - on a remote server. - - .. grid-item-card:: Versions and interfaces - :link: versioning - :link-type: doc - :margin: 2 2 0 0 - - Discover the compatibility between PyAEDT and Ansys AEDT versions. - - .. grid-item-card:: Troubleshooting - :link: Troubleshooting - :link-type: doc - :margin: 2 2 0 0 - - Any questions? Refer to Q&A before submitting an issue. - - -What is PyAEDT? ---------------- -PyAEDT is a Python library that interacts directly with the API for -Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture -for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, -and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides -support for Circuit tools like Nexxim and system simulation tools like -Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout -tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures -simplify operation while reusing information as much as possible across -the API. - -To run PyAEDT, you must have a licensed copy of Ansys Electronics -Desktop (AEDT) installed. - -The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. -`AEDT `_ provides access to the Ansys gold-standard -electro-magnetics simulation solutions such as Ansys HFSS, -Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. -In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, -and Mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_3.png - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - -For more information, see `Ansys Electronics `_ -on the Ansys website. - -PyAEDT cheat sheets -------------------- - -PyAEDT cheat sheets introduce the basics that you need to use PyAEDT. -These one-page references providing syntax rules and commands -for using PyAEDT API and EDB API: - -**PyAEDT cheat sheet:** `PyAEDT API `_ - -**EDB cheat sheet:** `EDB API `_ - - -Get help --------- - -**Development issues:** For PyAEDT development-related matters, see the -`PyAEDT Issues `_ page. -You can create issues to report bugs and request new features. - -**User questions:** The best way to get help is to post your question on the `PyAEDT Discussions -`_ page or the `Discussions `_ -page on the Ansys Developer portal. You can post questions, share ideas, and get community feedback. - - -License -------- -PyAEDT is licensed under the MIT license. - -PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the -functionality of AEDT by adding a Python interface to AEDT without changing the -core behavior or license of the original software. The use of PyAEDT requires a -legally licensed local copy of AEDT. - -To get a copy of AEDT, see the `Ansys Electronics `_ -page on the Ansys website. - - - -.. toctree:: - :hidden: - :maxdepth: 2 - - Installation - Troubleshooting - ../User_guide/index - ClientServer - versioning - Contributing - About - diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst deleted file mode 100644 index f0c872ffa64..00000000000 --- a/doc/source/Getting_started/versioning.rst +++ /dev/null @@ -1,78 +0,0 @@ -.. _versions_and_interfaces: - -======================= -Versions and interfaces -======================= - -The PyAEDT project attempts to maintain compatibility with legacy -versions of AEDT while allowing for support of faster and better -interfaces with the latest versions of AEDT. - -There are two interfaces PyAEDT can use to connect to AEDT. -You can see a table with the AEDT version and the supported interfaces -in `Table of supported versions `_ - - -gRPC interface -============== - -This is the default and preferred interface to connect to AEDT. -Ansys 2022 R2 and later support the latest gRPC interface, allowing -for remote management of AEDT with rapid streaming of mesh, results, -and files from the AEDT service. - - -Legacy interfaces -================= - -COM interface --------------- - -AnsysEM supports the legacy COM interface, enabled with the settings option. - -This interface works only on Windows and uses .NET COM objects. - - -.. code:: python - - - from ansys.aedt.core import settings - - settings.use_grpc_api = False - - - -Compatibility between AEDT and interfaces -========================================= - -The following table shows the supported versions of Ansys EDT and the recommended interface for each one of them in PyAEDT. - - -**Table of supported versions** - -.. _table_versions: - -+---------------------------+------------------------+-----------------------------------------------+ -| Ansys Version | Recommended interface | Support | -| | +-----------------------+-----------------------+ -| | | gRPC | COM | -+===========================+========================+=======================+=======================+ -| AnsysEM 2024 R1 | gRPC | YES | NO* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R2 | gRPC | YES | YES* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R1 | gRPC | YES | YES* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R2 | gRPC | YES* | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R1 | gRPC | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2021 R2 | gRPC | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ - -Where: - -* YES means that the interface is supported and recommended. -* YES* means that the interface is supported, but not recommended. Their support might be dropped in the future. -* NO means that the interface is not supported. -* NO* means that the interface is still supported but it is deprecated. diff --git a/doc/source/index.rst b/doc/source/index.rst index 32528e3a1a9..746275cd105 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,32 +24,12 @@ enabling straightforward and efficient automation in your workflow. .. grid:: 2 - .. grid-item-card:: Getting started :fa:`person-running` - :link: Getting_started/index - :link-type: doc - - New to PyAEDT? This section provides the information that you need to get started with PyAEDT. - .. grid-item-card:: User guide :fa:`book-open-reader` :link: User_guide/index :link-type: doc This section provides in-depth information on PyAEDT key concepts. -.. grid:: 2 - - .. grid-item-card:: API reference :fa:`book-bookmark` - :link: API/index - :link-type: doc - - This section contains descriptions of the functions and modules included in PyAEDT. - It describes how the methods work and the parameters that can be used. - - .. grid-item-card:: Examples :fa:`scroll` - :link: https://examples.aedt.docs.pyansys.com/ - - Explore examples that show how to use PyAEDT to perform different types of simulations. - .. grid:: 2 .. grid-item-card:: Contribute :fa:`people-group` @@ -63,7 +43,5 @@ enabling straightforward and efficient automation in your workflow. :hidden: - Getting_started/index User_guide/index - API/index Examples From 83ed7c160009730b697a2ed4f3be6933c370e07c Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 15 Nov 2024 10:31:16 +0100 Subject: [PATCH 3/8] Revert "TBR: Temporary files removal" This reverts commit 82829d8bfc45bb3702f661c421c75a105fd655ed. --- doc/source/API/Application.rst | 70 +++++ doc/source/API/Boundaries.rst | 77 +++++ doc/source/API/CableModeling.rst | 132 +++++++++ doc/source/API/Configuration.rst | 52 ++++ doc/source/API/Constants.rst | 21 ++ doc/source/API/DesktopMessenger.rst | 13 + doc/source/API/MaterialManagement.rst | 56 ++++ doc/source/API/Mesh.rst | 48 ++++ doc/source/API/MultiPartComponent.rst | 23 ++ doc/source/API/Optimetrics.rst | 34 +++ doc/source/API/Primitive_Objects.rst | 143 ++++++++++ doc/source/API/Primitives2D.rst | 51 ++++ doc/source/API/Primitives3D.rst | 74 +++++ doc/source/API/Primitives3DLayout.rst | 81 ++++++ doc/source/API/PrimitivesCircuit.rst | 174 ++++++++++++ doc/source/API/Setup.rst | 62 ++++ doc/source/API/SetupTemplates.rst | 32 +++ doc/source/API/SetupTemplates3DLayout.rst | 22 ++ doc/source/API/SetupTemplatesCircuit.rst | 26 ++ doc/source/API/SetupTemplatesHFSS.rst | 25 ++ doc/source/API/SetupTemplatesIcepak.rst | 24 ++ doc/source/API/SetupTemplatesMaxwell.rst | 23 ++ doc/source/API/SetupTemplatesMechanical.rst | 23 ++ doc/source/API/SetupTemplatesQ3D.rst | 24 ++ doc/source/API/SetupTemplatesRmxprt.rst | 33 +++ doc/source/API/SetupTemplatesTwinBuilder.rst | 21 ++ doc/source/API/Stackup3D.rst | 22 ++ doc/source/API/Variables.rst | 31 ++ doc/source/API/Visualization.rst | 73 +++++ doc/source/API/index.rst | 104 +++++++ doc/source/API/visualization/advanced.rst | 150 ++++++++++ doc/source/API/visualization/plot.rst | 79 ++++++ doc/source/API/visualization/post.rst | 266 ++++++++++++++++++ doc/source/API/visualization/report.rst | 81 ++++++ doc/source/Getting_started/About.rst | 86 ++++++ doc/source/Getting_started/ClientServer.rst | 93 ++++++ doc/source/Getting_started/Contributing.rst | 206 ++++++++++++++ doc/source/Getting_started/Installation.rst | 197 +++++++++++++ .../Getting_started/Troubleshooting.rst | 201 +++++++++++++ doc/source/Getting_started/index.rst | 132 +++++++++ doc/source/Getting_started/versioning.rst | 78 +++++ doc/source/index.rst | 22 ++ 42 files changed, 3185 insertions(+) create mode 100644 doc/source/API/Application.rst create mode 100644 doc/source/API/Boundaries.rst create mode 100644 doc/source/API/CableModeling.rst create mode 100644 doc/source/API/Configuration.rst create mode 100644 doc/source/API/Constants.rst create mode 100644 doc/source/API/DesktopMessenger.rst create mode 100644 doc/source/API/MaterialManagement.rst create mode 100644 doc/source/API/Mesh.rst create mode 100644 doc/source/API/MultiPartComponent.rst create mode 100644 doc/source/API/Optimetrics.rst create mode 100644 doc/source/API/Primitive_Objects.rst create mode 100644 doc/source/API/Primitives2D.rst create mode 100644 doc/source/API/Primitives3D.rst create mode 100644 doc/source/API/Primitives3DLayout.rst create mode 100644 doc/source/API/PrimitivesCircuit.rst create mode 100644 doc/source/API/Setup.rst create mode 100644 doc/source/API/SetupTemplates.rst create mode 100644 doc/source/API/SetupTemplates3DLayout.rst create mode 100644 doc/source/API/SetupTemplatesCircuit.rst create mode 100644 doc/source/API/SetupTemplatesHFSS.rst create mode 100644 doc/source/API/SetupTemplatesIcepak.rst create mode 100644 doc/source/API/SetupTemplatesMaxwell.rst create mode 100644 doc/source/API/SetupTemplatesMechanical.rst create mode 100644 doc/source/API/SetupTemplatesQ3D.rst create mode 100644 doc/source/API/SetupTemplatesRmxprt.rst create mode 100644 doc/source/API/SetupTemplatesTwinBuilder.rst create mode 100644 doc/source/API/Stackup3D.rst create mode 100644 doc/source/API/Variables.rst create mode 100644 doc/source/API/Visualization.rst create mode 100644 doc/source/API/index.rst create mode 100644 doc/source/API/visualization/advanced.rst create mode 100644 doc/source/API/visualization/plot.rst create mode 100644 doc/source/API/visualization/post.rst create mode 100644 doc/source/API/visualization/report.rst create mode 100644 doc/source/Getting_started/About.rst create mode 100644 doc/source/Getting_started/ClientServer.rst create mode 100644 doc/source/Getting_started/Contributing.rst create mode 100644 doc/source/Getting_started/Installation.rst create mode 100644 doc/source/Getting_started/Troubleshooting.rst create mode 100644 doc/source/Getting_started/index.rst create mode 100644 doc/source/Getting_started/versioning.rst diff --git a/doc/source/API/Application.rst b/doc/source/API/Application.rst new file mode 100644 index 00000000000..d7ad0ed6724 --- /dev/null +++ b/doc/source/API/Application.rst @@ -0,0 +1,70 @@ +Application and solvers +======================= +The PyAEDT API includes classes for different applications available in Ansys Electronics Desktop (AEDT). +You must initialize AEDT to get access to all PyAEDT modules and methods. + +.. image:: ../Resources/aedt_2.png + :width: 800 + :alt: Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. + + +Available PyAEDT apps are: + +.. autosummary:: + :toctree: _autosummary + + ansys.aedt.core.desktop.Desktop + ansys.aedt.core.hfss.Hfss + ansys.aedt.core.q3d.Q3d + ansys.aedt.core.q3d.Q2d + ansys.aedt.core.maxwell.Maxwell2d + ansys.aedt.core.maxwell.Maxwell3d + ansys.aedt.core.icepak.Icepak + ansys.aedt.core.hfss3dlayout.Hfss3dLayout + ansys.aedt.core.mechanical.Mechanical + ansys.aedt.core.rmxprt.Rmxprt + ansys.aedt.core.circuit.Circuit + ansys.aedt.core.maxwellcircuit.MaxwellCircuit + ansys.aedt.core.emit.Emit + ansys.aedt.core.twinbuilder.TwinBuilder + ansys.aedt.core.filtersolutions.FilterSolutions + + +All other classes and methods are inherited into the app class. +AEDT, which is also referred to as the desktop app, is implicitly launched in any PyAEDT app. +Before accessing a PyAEDT app, the desktop app must be launched and initialized. +The desktop app can be explicitly or implicitly initialized as in the following examples. + +Example with ``Desktop`` class explicit initialization: + +.. code:: python + + from ansys.aedt.core import launch_desktop, Circuit + d = launch_desktop(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here will be caught by Desktop. + ... + d.release_desktop() + +Example with ``Desktop`` class implicit initialization: + +.. code:: python + + from ansys.aedt.core import Circuit + circuit = Circuit(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here will be caught by Desktop. + ... + circuit.release_desktop() + + diff --git a/doc/source/API/Boundaries.rst b/doc/source/API/Boundaries.rst new file mode 100644 index 00000000000..b09d5924cfd --- /dev/null +++ b/doc/source/API/Boundaries.rst @@ -0,0 +1,77 @@ +Boundary objects +================ +This section lists classes for creating and editing +boundaries in the 3D tools. These objects are returned by +app methods and can be used to edit or delete a boundary condition. + + +.. currentmodule:: ansys.aedt.core.modules.boundary + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + BoundaryObject + BoundaryObject3dLayout + NetworkObject + FarFieldSetup + Matrix + BoundaryObject3dLayout + Sources + Excitations + +Native components +----------------- + +When native components object are created, the ``NativeComponentObject`` class is returned. For PCB components, ``NativeComponentPCB`` is returned. + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + NativeComponentObject + NativeComponentPCB + +``Native Component Object`` example: + +.. code:: python + + from ansys.aedt.core import Icepak + ipk = Icepak() + component_name = "RadioBoard1" + pcb_comp = self.aedtapp.create_ipk_3dcomponent_pcb( + component_name, link_data, solution_freq, resolution, custom_x_resolution=400, custom_y_resolution=500 + ) + # pcb_comp is a NativeComponentPCB + ... + ipk.release_desktop() + +Icepak transient assignments +---------------------------- +To facilitate transient assignment handling in Icepak, it is possible to use one of the following classes: + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + LinearDictionary + PowerLawDictionary + ExponentialDictionary + SinusoidalDictionary + SquareWaveDictionary + PieceWiseLinearDictionary + +It is possible to initialize the class manually or through a method: + +.. code:: python + + bc_transient = ipk.create_sinusoidal_transient_assignment(vertical_offset="1W", vertical_scaling="3", + period="2", period_offset="0.5s") + # bc_transient will be SinusoidalDictionary type + ipk.assign_solid_block("Cylinder1", bc_transient) + + #or + + bc_transient = SinusoidalDictionary(vertical_offset="1W", vertical_scaling="3", + period="2", period_offset="0.5s") + ipk.assign_solid_block("Cylinder1", bc_transient) \ No newline at end of file diff --git a/doc/source/API/CableModeling.rst b/doc/source/API/CableModeling.rst new file mode 100644 index 00000000000..b152c2c4043 --- /dev/null +++ b/doc/source/API/CableModeling.rst @@ -0,0 +1,132 @@ +Cable modeling +============== +The ``Cable Modeling`` module includes several methods to work +with the Cable Modeling HFSS Beta feature: + + +* ``create_cable`` to create all available types of cables: bundle, straight wire and twisted pair. +* ``update_cable_properties`` to update all cables properties for all cable types. +* ``update_shielding`` to update only the shielding jacket type for bundle cable. +* ``remove_cables`` to remove cables. +* ``add_cable_to_bundle`` to add a cable or a list of cables to a bundle. +* ``create_clock_source`` to create a clock source. +* ``update_clock_source`` to update a clock source. +* ``remove_source`` to remove a source. +* ``remove_all_sources`` to remove all sources. +* ``create_pwl_source`` to create a pwl source. +* ``create_pwl_source_from_file`` to create a pwl source from file. +* ``update_pwl_source`` to update a pwl source. +* ``create_cable_harness`` to create a cable harness. + +They are accessible through: + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cable_modeling.Cable + +Cable bundle creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the cable properties + cable_props["Add_Cable"] = "True" + cable_props["Cable_prop"]["CableType"] = "bundle" + cable_props["Cable_prop"]["IsJacketTypeInsulation"] = "True" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "InsThickness" + ] = "3.66mm" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "JacketMaterial" + ] = "pec" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "InnerDiameter" + ] = "2.88mm" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleAttribs"]["Name"] = "Bundle_Cable_Insulation" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the cable bundle + cable.create_cable() + +Clock source creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the clock source properties + cable_props["Add_Cable"] = "False" + cable_props["Update_Cable"] = "False" + cable_props["Add_CablesToBundle"] = "False" + cable_props["Remove_Cable"] = "False" + cable_props["Add_Source"] = "True" + cable_props["Source_prop"]["AddClockSource"] = "True" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Period"] = "40us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["LowPulseVal"] = "0.1V" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["HighPulseVal"] = "2V" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Risetime"] = "5us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Falltime"] = "10us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["PulseWidth"] = "23us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["TDSourceAttribs"]["Name"] = "clock_test_1" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the clock source + cable.create_clock_source() + +Cable harness creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the cable harness properties + cable_props["Add_Cable"] = "False" + cable_props["Update_Cable"] = "False" + cable_props["Add_CablesToBundle"] = "False" + cable_props["Remove_Cable"] = "False" + cable_props["Add_Source"] = "False" + cable_props["Update_Source"] = "False" + cable_props["Remove_Source"] = "False" + cable_props["Add_CableHarness"] = "True" + cable_props["CableHarness_prop"]["Name"] = "cable_harness_test" + cable_props["CableHarness_prop"]["Bundle"] = "New_updated_name_cable_bundle_insulation" + cable_props["CableHarness_prop"]["TwistAngleAlongRoute"] = "20deg" + cable_props["CableHarness_prop"]["Polyline"] = "Polyline1" + cable_props["CableHarness_prop"]["AutoOrient"] = "False" + cable_props["CableHarness_prop"]["XAxis"] = "Undefined" + cable_props["CableHarness_prop"]["XAxisOrigin"] = ["0mm", "0mm", "0mm"] + cable_props["CableHarness_prop"]["XAxisEnd"] = ["0mm", "0mm", "0mm"] + cable_props["CableHarness_prop"]["ReverseYAxisDirection"] = "True" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][0]["CableName"] = "straight_wire_cable" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][1]["CableName"] = "straight_wire_cable1" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][2]["CableName"] = "straight_wire_cable2" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the cable harness + cable.create_cable_harness() \ No newline at end of file diff --git a/doc/source/API/Configuration.rst b/doc/source/API/Configuration.rst new file mode 100644 index 00000000000..c81b35eb20d --- /dev/null +++ b/doc/source/API/Configuration.rst @@ -0,0 +1,52 @@ +Configuration files +~~~~~~~~~~~~~~~~~~~ +This module contains all methods to export project settings to a JSON file +and import and apply settings to a new design. Currently the configuration +cover the following apps: +* HFSS +* Q2D and Q3D Extractor +* Maxwell +* Icepak +* Mechanical + +The sections covered are: + +* Variables +* Mesh operations +* Setup and optimetrics +* Material properties +* Object properties +* Boundaries and excitations + +When a boundary is attached to a face, the tool tries to match it with a +FaceByPosition on the same object name on the target design. If, for any +reason, this face position has changed or the object name in the target design has changed, +the boundary fails to apply. + + +.. currentmodule:: ansys.aedt.core.generic.configurations + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Configurations + ConfigurationsOptions + ImportResults + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(project_name="original_project", specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + conf_file = self.aedtapp.configurations.export_config() + + app2 = Hfss(projec_name='newproject') + app2.modeler.import_3d_cad(file_path) + out = app2.configurations.import_config(conf_file) + app2.configurations.results.global_import_success + + ... diff --git a/doc/source/API/Constants.rst b/doc/source/API/Constants.rst new file mode 100644 index 00000000000..70b4bce618f --- /dev/null +++ b/doc/source/API/Constants.rst @@ -0,0 +1,21 @@ +Constants +========== +This section lists constants that are commonly used in PyAEDT. + + +Example of constants usage: + +.. code:: python + + from ansys.aedt.core import constants + ipk = Icepak() + # Use of AXIS Constant + cylinder = ipk.modeler.create_cylinder(constants.AXIS.X, [0,0,0],10,3) + # Use of PLANE Constant + ipk.modeler.split(cylinder, constants.PLANE.YZ, sides="Both") + ... + ipk.release_desktop() + + +.. automodule:: ansys.aedt.core.generic.constants + :members: diff --git a/doc/source/API/DesktopMessenger.rst b/doc/source/API/DesktopMessenger.rst new file mode 100644 index 00000000000..3b6077d85d5 --- /dev/null +++ b/doc/source/API/DesktopMessenger.rst @@ -0,0 +1,13 @@ +Logger +~~~~~~ +This section lists modules for creating and editing +PyAEDT log files. + +.. currentmodule:: ansys.aedt.core.aedt_logger + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + AedtLogger + AppFilter diff --git a/doc/source/API/MaterialManagement.rst b/doc/source/API/MaterialManagement.rst new file mode 100644 index 00000000000..bf672ae8afd --- /dev/null +++ b/doc/source/API/MaterialManagement.rst @@ -0,0 +1,56 @@ +Material and stackup +==================== +This section lists material and stackup modules. +These classes cannot be used directly but can be accessed through an app. +Example: + + + +Material management +~~~~~~~~~~~~~~~~~~~ +This section describes all material-related classes and methods. + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + material_lib.Materials + material.Material + material.SurfaceMaterial + material.MatProperties + material.SurfMatProperties + material.MatProperty + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Materials class + my_materials = app.materials + # This call returns the Material class + copper = my_materials["copper"] + # This property is from the MatProperty class + copper.conductivity + ... + + + +Stackup management +~~~~~~~~~~~~~~~~~~ +This section describes all layer-related classes and methods used in HFSS 3D Layout (and indirectly in Circuit). + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + + layer_stackup.Layers + layer_stackup.Layer \ No newline at end of file diff --git a/doc/source/API/Mesh.rst b/doc/source/API/Mesh.rst new file mode 100644 index 00000000000..5ac5adad37d --- /dev/null +++ b/doc/source/API/Mesh.rst @@ -0,0 +1,48 @@ +Mesh operations +=============== +The ``Mesh`` module includes these classes: + +* ``Mesh`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor +* ``IcepakMesh`` for Icepak +* ``Mesh3d`` for HFSS 3D Layout + +They are accessible through the mesh property: + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + mesh.Mesh + mesh_icepak.IcepakMesh + mesh_3d_layout.Mesh3d + +.. code:: python + + from ansys.aedt.core import Maxwell3d + app = Maxwell3d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns the Mesh class + my_mesh = app.mesh + # This call executes a ``Mesh`` method and creates an object to control the mesh operation + mesh_operation_object = my_mesh.assign_surface_mesh("MyBox", 2) + ... + +Icepak mesh +~~~~~~~~~~~~~~~ + +These objects are relevant objects while using the ``MeshIcepak`` class: + +.. currentmodule:: ansys.aedt.core.modules.mesh_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + + Region + SubRegion + MeshRegion + GlobalMeshRegion \ No newline at end of file diff --git a/doc/source/API/MultiPartComponent.rst b/doc/source/API/MultiPartComponent.rst new file mode 100644 index 00000000000..2c55c82bcb1 --- /dev/null +++ b/doc/source/API/MultiPartComponent.rst @@ -0,0 +1,23 @@ +Multi-part components +===================== +This section lists classes for creating and editing multi-part components in the 3D tools. +This consists of a set of one or more 3D component objects, linked together and parametrized +to allow movements. + + + +.. currentmodule:: ansys.aedt.core.modeler.advanced_cad + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + actors.Person + actors.Vehicle + actors.Bird + actors.Radar + parts.Part + parts.Antenna + multiparts.MultiPartComponent + multiparts.Environment + multiparts.Actor diff --git a/doc/source/API/Optimetrics.rst b/doc/source/API/Optimetrics.rst new file mode 100644 index 00000000000..5f02473f306 --- /dev/null +++ b/doc/source/API/Optimetrics.rst @@ -0,0 +1,34 @@ +Optimetrics +=========== +This module contains all properties and methods needed to create +optimetrics setups. + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # returns the ParametericsSetups Class + app.parametrics + + # returns the OptimizationSetups Class + app.optimizations + + # adds an optimization and returns Setup class with all settings and methods + sweep3 = hfss.opti_optimization.add_optimization(calculation="dB(S(1,1))", calculation_value="2.5GHz") + + ... + +.. currentmodule:: ansys.aedt.core.modules.design_xploration + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ParametricSetups + OptimizationSetups + SetupParam + SetupOpti + diff --git a/doc/source/API/Primitive_Objects.rst b/doc/source/API/Primitive_Objects.rst new file mode 100644 index 00000000000..ac3a3fcbfd7 --- /dev/null +++ b/doc/source/API/Primitive_Objects.rst @@ -0,0 +1,143 @@ +Primitives +========== + +This section lists the core AEDT Modeler primitives that are supported both in 2D and 3D solvers (HFSS, Maxwell, +Icepak, Q3D, and Mechanical): + +* Primitives +* Objects + +They are accessible through the ``modeler.objects`` property: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call return an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + my_box = primitives.objects[my_box.id] + + # This call return a FacePrimitive object list + my_box.faces + # This call returns an EdgePrimitive object list + my_box.edges + my_box.faces[0].edges + + # This call returns a VertexPrimitive object list + my_box.vertices + my_box.faces[0].vertices + my_box.faces[0].edges[0].vertices + + ... + + + +Objects +~~~~~~~ + +The following classes define objects properties for 3D and 2D Solvers (excluding HFSS 3D Layout). +They contain all getters and setters to simplify object manipulation. + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cad.object_3d.Object3d + cad.elements_3d.FacePrimitive + cad.elements_3d.EdgePrimitive + cad.elements_3d.VertexPrimitive + cad.polylines.PolylineSegment + cad.polylines.Polyline + cad.component_array.ComponentArray + cad.components_3d.UserDefinedComponent + cad.elements_3d.Point + cad.elements_3d.Plane + cad.elements_3d.HistoryProps + cad.elements_3d.BinaryTreeNode + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call returns an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + + # Getter and setter + my_box.material_name + my_box.material_name = "copper" + + my_box.faces[0].center + + ... + + +Coordinate systems and geometry operators +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This module contains all properties and methods needed to edit a +coordinate system and a set of useful geometry operators. +The ``CoordinateSystem`` class is accessible through the ``create_coordinate_system`` +method or the ``coordinate_systems`` list. The ``GeometryOperators`` class can be +imported and used because it is made by static methods. + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cad.modeler.CoordinateSystem + geometry_operators.GeometryOperators + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the CoordinateSystem object list + cs = app.modeler.coordinate_systems + + # This call returns a CoordinateSystem object + new_cs = app.modeler.create_coordinate_system() + + ... + + +Advanced modeler operations +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PyAEDT includes some advanced modeler tools like ``MultiPartComponent`` for 3D component +management and ``Stackup3D`` for parametric creation of 3D modeler stackups. + +.. toctree:: + :maxdepth: 2 + + MultiPartComponent + Stackup3D \ No newline at end of file diff --git a/doc/source/API/Primitives2D.rst b/doc/source/API/Primitives2D.rst new file mode 100644 index 00000000000..13273427673 --- /dev/null +++ b/doc/source/API/Primitives2D.rst @@ -0,0 +1,51 @@ +2D modeler +=========== + +This section lists the core AEDT Modeler modules for 2D and 3D solvers (Maxwell 2D, 2D Extractor). + + +They are accessible through the ``modeler`` property: + +.. code:: python + + from ansys.aedt.core import Maxwell2d + app = Maxwell2d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler2D class + modeler = app.modeler + + + ... + + + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_2d.Modeler2D + + + +.. code:: python + + from ansys.aedt.core import Maxwell2d + app = Maxwell2d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the NexximComponents class + origin = [0,0,0] + dimensions = [10,5,20] + #Material and name are not mandatory fields + box_object = app.modeler.primivites.create_rectangle([15, 20, 0], [5, 5], material="aluminum") + + ... diff --git a/doc/source/API/Primitives3D.rst b/doc/source/API/Primitives3D.rst new file mode 100644 index 00000000000..4d55ad3fc86 --- /dev/null +++ b/doc/source/API/Primitives3D.rst @@ -0,0 +1,74 @@ +3D modeler +========== + +This section lists the core AEDT Modeler modules with 3D solvers (HFSS, Maxwell, +Icepak, Q3D, and Mechanical): + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` property: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call return an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + my_box = primitives.objects[my_box.id] + + # This call return a FacePrimitive object list + my_box.faces + # This call returns an EdgePrimitive object list + my_box.edges + my_box.faces[0].edges + + # This call returns a VertexPrimitive object list + my_box.vertices + my_box.faces[0].vertices + my_box.faces[0].edges[0].vertices + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties for HFSS, Maxwell 3D, Q3D Extractor, and Icepak: + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_3d.Modeler3D + + +.. code:: python + + from ansys.aedt.core import Circuit + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the NexximComponents class + origin = [0,0,0] + sizes = [10,5,20] + #Material and name are not mandatory fields + box_object = app.modeler.primivites.create_box(origin, sizes, name="mybox", material="copper") + + ... diff --git a/doc/source/API/Primitives3DLayout.rst b/doc/source/API/Primitives3DLayout.rst new file mode 100644 index 00000000000..263443209a2 --- /dev/null +++ b/doc/source/API/Primitives3DLayout.rst @@ -0,0 +1,81 @@ +Modeler in HFSS 3D Layout +========================== + +This section lists the core AEDT Modeler modules available in HFSS 3D Layout: + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` module and ``modeler.objects`` property: + +.. code:: python + + from ansys.aedt.core import Hfss3dLayout + hfss = Hfss3dLayout() + my_modeler = hfss.modeler + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + + +* ``Modeler3DLayout`` for HFSS 3D Layout + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_pcb.Modeler3DLayout + + +Objects in HFSS 3D Layout +~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for HFSS 3D Layout. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.pcb + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + object_3d_layout.Components3DLayout + object_3d_layout.Nets3DLayout + object_3d_layout.Pins3DLayout + object_3d_layout.Line3dLayout + object_3d_layout.Polygons3DLayout + object_3d_layout.Circle3dLayout + object_3d_layout.Rect3dLayout + object_3d_layout.Points3dLayout + object_3d_layout.Padstack + +.. code:: python + + from ansys.aedt.core import Hfss3dLayout + app = Hfss3dLayout(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler3DLayout class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call returns an Object3d object + my_rect = primitives.create_rectangle([0,0,0],[10,10]) + + # Getter and setter + my_rect.material_name + + ... diff --git a/doc/source/API/PrimitivesCircuit.rst b/doc/source/API/PrimitivesCircuit.rst new file mode 100644 index 00000000000..a9b8444712c --- /dev/null +++ b/doc/source/API/PrimitivesCircuit.rst @@ -0,0 +1,174 @@ +Modeler and components Circuit +============================== + +This section lists the core AEDT Modeler modules: + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` module and ``modeler.objects`` property: + +.. code:: python + + + from ansys.aedt.core import TwinBuilder + app = TwinBuilder(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + +* ``ModelerNexxim`` for Circuit +* ``ModelerTwinBuilder`` for Twin Builder +* ``ModelerEmit`` for EMIT + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + schematic.ModelerNexxim + schematic.ModelerTwinBuilder + schematic.ModelerEmit + schematic.ModelerMaxwellCircuit + + +Schematic in Circuit +~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Circuit components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_nexxim + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + NexximComponents + +.. code:: python + + from ansys.aedt.core import Circuit + app = Circuit(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + +Objects in Circuit +~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Circuit. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + object_3d_circuit.CircuitComponent + object_3d_circuit.CircuitPins + object_3d_circuit.Wire + +.. code:: python + + from ansys.aedt.core import Circuit + app = Circuit(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + # Getter and setter + my_res.location + my_res.parameters["R"]=100 + + ... + +Schematic in EMIT +~~~~~~~~~~~~~~~~~ +The following classes define the object properties for EMIT components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_emit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + EmitComponents + + +Schematic in Twin Builder +~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Twin Builder components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_twin_builder + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + TwinBuilderComponents + +.. code:: python + + from ansys.aedt.core import TwinBuilder + app = TwinBuilder(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + # Getter and setter + my_res.location + my_res.parameters["R"]=100 + + ... + + +Schematic in Maxwell Circuit +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Maxwell Circuit components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_maxwell_circuit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + MaxwellCircuitComponents diff --git a/doc/source/API/Setup.rst b/doc/source/API/Setup.rst new file mode 100644 index 00000000000..3b2774a64d5 --- /dev/null +++ b/doc/source/API/Setup.rst @@ -0,0 +1,62 @@ +Setup +===== +This section lists setup modules: + +* ``Setup`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor +* ``Setup3DLayout`` for HFSS 3D Layout +* ``SetupCircuit`` for Circuit and Twin Builder + +The ``Setup`` object is accessible through the ``create_setup`` method and ``setups`` object list. + +.. currentmodule:: ansys.aedt.core.modules.solve_setup + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SetupHFSS + SetupHFSSAuto + SetupSBR + SetupQ3D + SetupMaxwell + Setup + Setup3DLayout + SetupCircuit + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Setup class + my_setup = app.setups[0] + + + # This call returns a Setup object + setup = app.create_setup("MySetup") + + ... + + +Sweep classes +============= +This section lists sweep classes and their default values: + +* ``SweepHFSS`` for HFSS +* ``SweepHFSS3DLayout`` for HFSS 3D Layout +* ``SweepMatrix`` for Q3D and 2D Extractor + +The ``Setup`` object is accessible through the methods available for sweep creation. + + +.. currentmodule:: ansys.aedt.core.modules.solve_sweeps + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SweepHFSS + SweepHFSS3DLayout + SweepMatrix diff --git a/doc/source/API/SetupTemplates.rst b/doc/source/API/SetupTemplates.rst new file mode 100644 index 00000000000..89a80c540c9 --- /dev/null +++ b/doc/source/API/SetupTemplates.rst @@ -0,0 +1,32 @@ +Setup templates +=============== + +This section lists all setup templates with their default values and keys. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + Launch AEDT 2023 R1 in non-graphical mode + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + +.. toctree:: + :maxdepth: 2 + + SetupTemplatesHFSS + SetupTemplates3DLayout + SetupTemplatesMaxwell + SetupTemplatesQ3D + SetupTemplatesIcepak + SetupTemplatesMechanical + SetupTemplatesCircuit + SetupTemplatesTwinBuilder + SetupTemplatesRmxprt diff --git a/doc/source/API/SetupTemplates3DLayout.rst b/doc/source/API/SetupTemplates3DLayout.rst new file mode 100644 index 00000000000..20007619039 --- /dev/null +++ b/doc/source/API/SetupTemplates3DLayout.rst @@ -0,0 +1,22 @@ +HFSS 3D Layout and arguments +============================ + +This section lists all setup templates with their default values and keys available in HFSS 3D Layout. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + Launch AEDT 2023 R1 in non-graphical mode + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSS3DLayout diff --git a/doc/source/API/SetupTemplatesCircuit.rst b/doc/source/API/SetupTemplatesCircuit.rst new file mode 100644 index 00000000000..32c3b59025b --- /dev/null +++ b/doc/source/API/SetupTemplatesCircuit.rst @@ -0,0 +1,26 @@ +Circuit templates and arguments +================================ + +This section lists all setup templates with their default values and keys available in Circuit. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximLNA +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximDC +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximQuickEye +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximVerifEye +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximAMI + diff --git a/doc/source/API/SetupTemplatesHFSS.rst b/doc/source/API/SetupTemplatesHFSS.rst new file mode 100644 index 00000000000..e3e09901dc6 --- /dev/null +++ b/doc/source/API/SetupTemplatesHFSS.rst @@ -0,0 +1,25 @@ +HFSS templates and arguments +============================ + +This section lists all setup templates with their default values and keys available in HFSS. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenAuto +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSSBR + diff --git a/doc/source/API/SetupTemplatesIcepak.rst b/doc/source/API/SetupTemplatesIcepak.rst new file mode 100644 index 00000000000..30d623930e1 --- /dev/null +++ b/doc/source/API/SetupTemplatesIcepak.rst @@ -0,0 +1,24 @@ +Icepak templates and arguments +=============================== + +This section lists all setup templates with their default values and keys available in Icepak. +Note that Icepak parameters contain spaces. To use them as arguments of the ``"create_setup"`` method, these +same parameters have to be used without spaces. +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Icepak + + app = Icepak() + # Any property of this setup can be found on this page. + setup = app.create_setup(MaxIterations=5) + +Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``. + +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientFlowOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureAndFlow +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyFlowOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureAndFlow diff --git a/doc/source/API/SetupTemplatesMaxwell.rst b/doc/source/API/SetupTemplatesMaxwell.rst new file mode 100644 index 00000000000..5ac02dcc9dc --- /dev/null +++ b/doc/source/API/SetupTemplatesMaxwell.rst @@ -0,0 +1,23 @@ +Maxwell templates and arguments +=============================== + + +This section lists all setup templates with their default values and keys available in Maxwell 2D and 3D. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Maxwell3d + + Maxwell3d = Maxwell3d () + # Any property of this setup can be found on this page. + setup = Maxwell3d.create_setup () + setup.props["MaximumPasses"] = 5 + setup.update () + +.. pprint:: ansys.aedt.core.modules.setup_templates.MaxwellTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.Magnetostatic +.. pprint:: ansys.aedt.core.modules.setup_templates.Electrostatic +.. pprint:: ansys.aedt.core.modules.setup_templates.EddyCurrent +.. pprint:: ansys.aedt.core.modules.setup_templates.ElectricTransient diff --git a/doc/source/API/SetupTemplatesMechanical.rst b/doc/source/API/SetupTemplatesMechanical.rst new file mode 100644 index 00000000000..09b9adc824f --- /dev/null +++ b/doc/source/API/SetupTemplatesMechanical.rst @@ -0,0 +1,23 @@ +Mechanical templates and arguments +================================== + +This section lists all setup templates with their default values and keys available in Mechanical. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + + from ansys.aedt.core import Mechanical + + app = Mechanical() + # Any property of this setup can be found on this page. + setup = app.create_setup(MaxModes=6) + + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.MechTerm +.. pprint:: ansys.aedt.core.modules.setup_templates.MechModal +.. pprint:: ansys.aedt.core.modules.setup_templates.MechStructural + diff --git a/doc/source/API/SetupTemplatesQ3D.rst b/doc/source/API/SetupTemplatesQ3D.rst new file mode 100644 index 00000000000..838e2cd68b7 --- /dev/null +++ b/doc/source/API/SetupTemplatesQ3D.rst @@ -0,0 +1,24 @@ +Q3D templates and arguments +=========================== + + +This section lists all setup templates with their default values and keys available in Q3D and 2D Extractor. +Note that to use nested parameters, you can set a parameter using the "__" separator as shown in the following example. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + + from ansys.aedt.core import Q3d + + app = Q3d() + # Any property of this setup can be found on this page. + setup = app.create_setup(AC__MaxPasses=6) + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.Matrix +.. pprint:: ansys.aedt.core.modules.setup_templates.Close +.. pprint:: ansys.aedt.core.modules.setup_templates.Open + diff --git a/doc/source/API/SetupTemplatesRmxprt.rst b/doc/source/API/SetupTemplatesRmxprt.rst new file mode 100644 index 00000000000..57fb82b99af --- /dev/null +++ b/doc/source/API/SetupTemplatesRmxprt.rst @@ -0,0 +1,33 @@ +RMXprt templates and arguments +============================== + +This section lists all setup templates with their default values and keys available in RMXprt. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.GRM +.. pprint:: ansys.aedt.core.modules.setup_templates.DFIG +.. pprint:: ansys.aedt.core.modules.setup_templates.TPIM +.. pprint:: ansys.aedt.core.modules.setup_templates.TPSM +.. pprint:: ansys.aedt.core.modules.setup_templates.BLDC +.. pprint:: ansys.aedt.core.modules.setup_templates.ASSM +.. pprint:: ansys.aedt.core.modules.setup_templates.PMDC +.. pprint:: ansys.aedt.core.modules.setup_templates.SRM +.. pprint:: ansys.aedt.core.modules.setup_templates.LSSM +.. pprint:: ansys.aedt.core.modules.setup_templates.UNIM +.. pprint:: ansys.aedt.core.modules.setup_templates.DCM +.. pprint:: ansys.aedt.core.modules.setup_templates.CPSM +.. pprint:: ansys.aedt.core.modules.setup_templates.NSSM + diff --git a/doc/source/API/SetupTemplatesTwinBuilder.rst b/doc/source/API/SetupTemplatesTwinBuilder.rst new file mode 100644 index 00000000000..153c99fa365 --- /dev/null +++ b/doc/source/API/SetupTemplatesTwinBuilder.rst @@ -0,0 +1,21 @@ +Twin Builder templates and arguments +==================================== + + +This section lists all setup templates with their default values and keys available in Twin Builder. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.TR diff --git a/doc/source/API/Stackup3D.rst b/doc/source/API/Stackup3D.rst new file mode 100644 index 00000000000..439502b773d --- /dev/null +++ b/doc/source/API/Stackup3D.rst @@ -0,0 +1,22 @@ +Stackup 3D components +===================== +This section lists ``stackup_3d`` classes for creating and editing a stackup and objects in the 3D tools. +This consists of a set of one or more parametrized layer objects and placing lines, patches, polygons, +and vias. + + + +.. currentmodule:: ansys.aedt.core.modeler.advanced_cad + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + stackup_3d.Stackup3D + stackup_3d.Layer3D + stackup_3d.Padstack + stackup_3d.PadstackLayer + stackup_3d.Patch + stackup_3d.Trace + stackup_3d.Polygon + stackup_3d.NamedVariable diff --git a/doc/source/API/Variables.rst b/doc/source/API/Variables.rst new file mode 100644 index 00000000000..168bdd55ea9 --- /dev/null +++ b/doc/source/API/Variables.rst @@ -0,0 +1,31 @@ +Variable +======== +This module provides all functionalities for creating and editing +design and project variables in the 3D tools. + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the VariableManager class + variable_manager = self.aedtapp._variable_manager + + # Set and get a variable + app["w"] = "10mm" + a = app["w"] + ... + + +.. currentmodule:: ansys.aedt.core.application.variables + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VariableManager + Variable + DataSet + CSVDataset diff --git a/doc/source/API/Visualization.rst b/doc/source/API/Visualization.rst new file mode 100644 index 00000000000..dd31524bbb6 --- /dev/null +++ b/doc/source/API/Visualization.rst @@ -0,0 +1,73 @@ +Visualization +============= + +This section outlines the available modules for creating and editing data within and outside AEDT. + +PyAEDT offers four primary levels of visualization: + +* **Reports** +* **Post-processing** +* **Graphics** +* **Advanced Visualization** + +Reports +~~~~~~~ + +AEDT provides extensive flexibility for generating reports. +PyAEDT includes dedicated classes to manipulate all report properties, offering full control over report customization. + +.. toctree:: + :maxdepth: 1 + + visualization/report + +.. image:: ../Resources/sparams.jpg + :width: 800 + :alt: S-Parameters + + +Post-processing +~~~~~~~~~~~~~~~ + +AEDT has different post-processing tools. +PyAEDT provides classes to interact with and modify any of these tools, +enhancing data analysis and visualization capabilities. + +.. toctree:: + :maxdepth: 1 + + visualization/post + +.. image:: ../Resources/field_plot.png + :width: 800 + :alt: Postprocessing features + + +Graphics +~~~~~~~~ + +Specialized plotting options. + +.. toctree:: + :maxdepth: 1 + + visualization/plot + +.. image:: ../Resources/pyvista_plot.jpg + :width: 800 + :alt: S-Parameters Matplotlib + + +Advanced Visualization +~~~~~~~~~~~~~~~~~~~~~~ + +High-level visualization tools. + +.. toctree:: + :maxdepth: 1 + + visualization/advanced + +.. image:: ../Resources/farfield.png + :width: 800 + :alt: Farfield pyvista diff --git a/doc/source/API/index.rst b/doc/source/API/index.rst new file mode 100644 index 00000000000..0d7dbde7ad4 --- /dev/null +++ b/doc/source/API/index.rst @@ -0,0 +1,104 @@ +============= +API reference +============= + +This section describes PyAEDT core classes, methods, and functions +for AEDT apps and modules. Use the search feature or click links +to view API documentation. +The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. +`AEDT `_ provides access to the Ansys gold-standard +electro-magnetics simulation solutions such as Ansys HFSS, +Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. +In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, +and Mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_2.png + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + +The PyAEDT API includes classes for apps and modules. You must initialize the +PyAEDT app to get access to all modules and methods. Available apps are: + +- `HFSS `_ +- `HFSS 3D Layout `_ +- `Maxwell 3D `_ +- `Maxwell 2D `_ +- `Maxwell Circuit `_ +- `Q3D `_ +- `Q2D Extractor `_ +- `Icepak `_ +- `Mechanical `_ +- RMXprt +- EMIT +- Circuit +- `TwinBuilder `_ +- `FilterSolutions `_ + + +All other classes and methods are inherited into the app class. +The desktop app is implicitly launched in any of the other applications. +Before accessing a PyAEDT app, the desktop app has to be launched and initialized. +The desktop app can be explicitly or implicitly initialized as shown in the following examples. + +Example with ``Desktop`` class explicit initialization: + +.. code:: python + + from ansys.aedt.core import launch_desktop, Circuit + d = launch_desktop(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here should be caught by the desktop app. + ... + d.release_desktop() + +Example with ``Desktop`` class implicit initialization: + +.. code:: python + + from ansys.aedt.core import Circuit + circuit = Circuit(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here should be caught by the desktop app. + ... + circuit.release_desktop() + + +.. toctree:: + :maxdepth: 2 + + Application + MaterialManagement + Primitives3D + Primitives2D + Primitive_Objects + Primitives3DLayout + PrimitivesCircuit + Boundaries + Mesh + Setup + Visualization + DesktopMessenger + Optimetrics + Variables + Constants + Configuration + SetupTemplates + CableModeling + + + + diff --git a/doc/source/API/visualization/advanced.rst b/doc/source/API/visualization/advanced.rst new file mode 100644 index 00000000000..39dbc5fc16b --- /dev/null +++ b/doc/source/API/visualization/advanced.rst @@ -0,0 +1,150 @@ +Advanced +======== + +You can use PyAEDT for postprocessing of AEDT results to display graphics object and plot data. + + +Touchstone +~~~~~~~~~~ + +TouchstoneData class is based on `scikit-rf `_ package and allows advanced +touchstone post-processing. +The following methods allows to read and check touchstone files. + +.. currentmodule:: ansys.aedt.core.visualization.advanced.touchstone_parser + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + TouchstoneData.get_insertion_loss_index + TouchstoneData.plot_insertion_losses + TouchstoneData.plot + TouchstoneData.plot_return_losses + TouchstoneData.get_mixed_mode_touchstone_data + TouchstoneData.get_return_loss_index + TouchstoneData.get_insertion_loss_index_from_prefix + TouchstoneData.get_next_xtalk_index + TouchstoneData.get_fext_xtalk_index_from_prefix + TouchstoneData.plot_next_xtalk_losses + TouchstoneData.plot_fext_xtalk_losses + TouchstoneData.get_worst_curve + read_touchstone + check_touchstone_files + find_touchstone_files + + +Here an example on how to use TouchstoneData class. + +.. code:: python + + from ansys.aedt.core.visualization.advanced.touchstone_parser import TouchstoneData + + ts1 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1234.s8p")) + assert ts1.get_mixed_mode_touchstone_data() + ts2 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1324.s8p")) + assert ts2.get_mixed_mode_touchstone_data(port_ordering="1324") + + assert ts1.plot_insertion_losses(plot=False) + assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False) + + +Farfield +~~~~~~~~ + +PyAEDT offers sophisticated tools for advanced farfield post-processing. +There are two complementary classes: ``FfdSolutionDataExporter`` and ``FfdSolutionData``. + +- FfdSolutionDataExporter: Enables efficient export and manipulation of farfield data. It allows users to convert simulation results into a standard metadata format for further analysis, or reporting. + +- FfdSolutionData: Focuses on the direct access and processing of farfield solution data. It supports a comprehensive set of postprocessing operations, from visualizing radiation patterns to computing key performance metrics. + + +.. currentmodule:: ansys.aedt.core.visualization.advanced.farfield_visualization + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FfdSolutionData + + +This code shows how you can get the farfield data and perform some post-processing: + +.. code:: python + + import ansys.aedt.core + from ansys.aedt.core.generic.farfield_visualization import FfdSolutionDataExporter + app = ansys.aedt.core.Hfss() + ffdata = app.get_antenna_data(frequencies=None, + setup="Setup1 : Sweep", + sphere="3D", + variations=None, + overwrite=False, + link_to_hfss=True, + export_touchstone=True) + incident_power = ffdata.incident_power + ffdata.plot_cut(primary_sweep="Theta", theta=0) + ffdata.plot_contour(polar=True) + ffdata.plot_3d(show_geometry=False) + app.release_desktop(False, False) + +If you exported the farfield data previously, you can directly get the farfield data: + +.. code:: python + + from ansys.aedt.core.generic.farfield_visualization import FfdSolutionData + input_file = r"path_to_ffd\pyaedt_antenna_metadata.json" + ffdata = FfdSolutionData(input_file) + incident_power = ffdata.incident_power + ffdata.plot_cut(primary_sweep="Theta", theta=0) + ffdata.plot_contour(polar=True) + ffdata.plot_3d(show_geometry=False) + app.release_desktop(False, False) + +The following diagram shows both classes work. You can use them independently or from the ``get_antenna_data`` method. + + .. image:: ../../_static/farfield_visualization_pyaedt.png + :width: 800 + :alt: Farfield data with PyAEDT + + +If you have existing farfield data, or you want to export it manually, you can still use FfdSolutionData class. + + .. image:: ../../_static/farfield_visualization_aedt.png + :width: 800 + :alt: Farfield data with AEDT + + +Heterogeneous data message +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Heterogeneous data message (HDM) is the file exported from SBR+ solver containing rays information. +The following methods allows to read and plot rays information. + +.. currentmodule:: ansys.aedt.core.visualization.advanced + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + hdm_plot.HDMPlotter + sbrplus.hdm_parser.Parser + + +Miscellaneous +~~~~~~~~~~~~~ + +PyAEDT has additional advanced post-processing features: + +.. currentmodule:: ansys.aedt.core.visualization.advanced.misc + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + convert_nearfield_data + parse_rdat_file + nastran_to_stl + simplify_stl + diff --git a/doc/source/API/visualization/plot.rst b/doc/source/API/visualization/plot.rst new file mode 100644 index 00000000000..a00e71715c3 --- /dev/null +++ b/doc/source/API/visualization/plot.rst @@ -0,0 +1,79 @@ +Graphics operations +=================== + +PyAEDT enables powerful post-processing of AEDT results, +allowing you to visualize graphics objects and plot data with ease. + +PyAEDT supports external report capabilities available with installed third-party +packages like `pyvista `_, `matplotlib `_, +`pandas `_, and `numpy `_. + + +There have three main categories: + +* **Three-dimensional visualization** +* **Graph visualization** +* **PDF** + + +Three-dimensional visualization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PyAEDT benefits of `pyvista `_ package and allows to generate +models and 3D plots. + +.. currentmodule:: ansys.aedt.core.visualization.plot.pyvista + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ModelPlotter + FieldClass + ObjClass + + +Graph visualization +~~~~~~~~~~~~~~~~~~~ + +PyAEDT benefits of `matplotlib `_ package and allows to generate 2D plots. + + +.. currentmodule:: ansys.aedt.core.visualization.plot.matplotlib + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ReportPlotter + is_notebook + + +PDF +~~~ + +PyAEDT benefits of `fpdf2 `_ package and allows to generate PDF files. + +.. currentmodule:: ansys.aedt.core.visualization.plot.pdf + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + AnsysReport.read_template + AnsysReport.header + AnsysReport.footer + AnsysReport.create + AnsysReport.add_project_info + AnsysReport.add_section + AnsysReport.add_chapter + AnsysReport.add_sub_chapter + AnsysReport.add_image + AnsysReport.add_caption + AnsysReport.add_empty_line + AnsysReport.add_page_break + AnsysReport.add_table + AnsysReport.add_text + AnsysReport.add_toc + AnsysReport.save_pdf + AnsysReport.add_chart diff --git a/doc/source/API/visualization/post.rst b/doc/source/API/visualization/post.rst new file mode 100644 index 00000000000..d8490fc6933 --- /dev/null +++ b/doc/source/API/visualization/post.rst @@ -0,0 +1,266 @@ +AEDT post-processing +==================== + +AEDT offers a wide range of powerful post-processing tools for advanced data analysis and visualization. +PyAEDT provides dedicated classes that allow you to seamlessly interact with and modify these tools, expanding the scope of your data insights + + +.. note:: + Some functionalities are available only when AEDT is running + in graphical mode. + + +Core +~~~~ + +The following classes grant access to the core post-processing functionalities of AEDT: + +* **PostProcessor3D**: This class is utilized across all 3D applications, including HFSS, HFSS 3D Layout, Maxwell 3D and 2D, Q3D Extractor, and Mechanical AEDT. + +* **PostProcessorIcepak**: A specialized class for Icepak, which extends the ``PostProcessor3D`` class by adding features tailored to thermal analysis. + +* **PostProcessorCircuit**: This class handles schematic post-processing, supporting Circuit and Twin Builder applications. + + +.. currentmodule:: ansys.aedt.core.visualization.post.post_common_3d + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessor3D + +.. currentmodule:: ansys.aedt.core.visualization.post.post_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessorIcepak + +.. currentmodule:: ansys.aedt.core.visualization.post.post_circuit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessorCircuit + + +You can access these classes directly from the design object: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the PostProcessor class + post = app.post + + # This call returns a FieldPlot object + plotf = post.create_fieldplot_volume(objects, quantity_name, setup_name, intrinsics) + + # This call returns a SolutionData object + my_data = post.get_solution_data(expressions=trace_names) + + # This call returns a new standard report object and creates one or multiple reports from it. + standard_report = post.reports_by_category.standard("db(S(1,1))") + report_standard.create() + sols = report_standard.get_solution_data() + + +User can get the properties of the default reports using the following class: + +.. currentmodule:: ansys.aedt.core.visualization.post.common + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Reports + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.visualization.post.common import Reports + app = Hfss(specified_version="2024.2", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + reports = Reports(app.post, app.design_type) + app.release_desktop(False, False) + + +AEDT data is returned in a structured format, providing organized and detailed results. +For a comprehensive overview of the data structure and its capabilities, refer to the class definition below: + + +.. currentmodule:: ansys.aedt.core.visualization.post.solution_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SolutionData + + +Field +~~~~~ + +AEDT offers additional specialized post-processing features for enhanced 3D field visualization and control. + + +The following classes manage all aspects of AEDT 3D post-processing and are utilized by the ``PostProcessor3D`` class: + +.. currentmodule:: ansys.aedt.core.visualization.post.field_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldPlot + +.. code:: python + + from ansys.aedt.core import Hfss + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = app.post.create_fieldplot_line(quantity="Mag_E", assignment=p1.name) + report.create() + app.release_desktop(False, False) + + +Additionally, the following classes control field overlay settings, +enabling precise adjustments to visualization parameters: + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ColorMapSettings + AutoScale + MinMaxScale + Scale3DSettings + NumberFormat + MarkerSettings + ArrowSettings + FolderPlotSettings + +The ``fields_calculator`` module includes the ``FieldsCalculator`` class. +It provides methods to interact with AEDT Fields Calculator by adding, loading and deleting custom expressions. + +.. currentmodule:: ansys.aedt.core.visualization.post.fields_calculator + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldsCalculator + + +HFSS +~~~~ + +For HFSS solutions, there are two additionally features: virtual ray tracing and farfield exporter. + +To define and control virtual ray tracing (VRT) you can use: + +.. currentmodule:: ansys.aedt.core.visualization.post.vrt_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VRTFieldPlot + + +If you need to export HFSS far field data, then you can use the following feature to obtain the antenna metadata: + +.. currentmodule:: ansys.aedt.core.visualization.post.farfield_exporter + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FfdSolutionDataExporter + +.. code:: python + + from ansys.aedt.core import Hfss + + app = Hfss() + + antenna_data = app.post.get_antenna_data() + app.release_desktop(False, False) + + +Icepak +~~~~~~ + +The ``monitor_icepak`` module includes the classes listed below to add, modify, and manage monitors during simulations. +Retrieve monitor values for post-processing and analysis to gain insights into key simulation metrics. +Methods and properties are accessible through the ``monitor`` property of the ``Icepak`` class. + +.. currentmodule:: ansys.aedt.core.visualization.post.monitor_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Monitor + + +The ``field_summary`` module includes the classes listed below to the ``Icepak`` field summary. + +.. currentmodule:: ansys.aedt.core.visualization.post.field_summary + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldSummary + + +Additional tools +~~~~~~~~~~~~~~~~ + +Finally, users can use additional AEDT postprocessing tools like SPiSim: + +.. currentmodule:: ansys.aedt.core.visualization.post.spisim + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SpiSim + + +.. currentmodule:: ansys.aedt.core.visualization.post.spisim_com_configuration_files.com_parameters + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + COMParameters + COMParametersVer3p4 + + +If you are looking for Virtual Compliance post processing, you should use this set of features: + +.. currentmodule:: ansys.aedt.core.visualization.post.compliance + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VirtualComplianceGenerator + VirtualCompliance \ No newline at end of file diff --git a/doc/source/API/visualization/report.rst b/doc/source/API/visualization/report.rst new file mode 100644 index 00000000000..d922cd08990 --- /dev/null +++ b/doc/source/API/visualization/report.rst @@ -0,0 +1,81 @@ +Report management +================= + +AEDT provides extensive flexibility for generating reports. + + +PyAEDT includes dedicated classes to manipulate all report properties, +offering full control over report customization. + +.. note:: + Some functionalities are available only when AEDT is running + in graphical mode. + + +.. currentmodule:: ansys.aedt.core.visualization.report + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + standard.Standard + standard.Spectral + field.AntennaParameters + field.Fields + field.NearField + field.FarField + field.Emission + eye.EyeDiagram + eye.AMIConturEyeDiagram + eye.AMIEyeDiagram + emi.EMIReceiver + + +The following code shows how to use report modules in standalone mode. + +.. code:: python + + # Create `Mag_E` report in a polyline + + from ansys.aedt.core import Hfss + from ansys.aedt.core.visualization.report.field import Fields + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = Fields(app=app, report_category="Fields", + setup_name=setup.name + " : LastAdaptive", + expressions="Mag_E") + report.polyline = p1.name + report.create() + + app.release_desktop(False, False) + + +You can use these classes directly from the application object: + +.. code:: python + + # Create `Mag_E` report in a polyline + + from ansys.aedt.core import Hfss + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = app.post.reports_by_category.fields("Mag_E", setup.name + " : LastAdaptive", p1.name) + report.create() + + app.release_desktop(False, False) diff --git a/doc/source/Getting_started/About.rst b/doc/source/Getting_started/About.rst new file mode 100644 index 00000000000..5f42b245b34 --- /dev/null +++ b/doc/source/Getting_started/About.rst @@ -0,0 +1,86 @@ +About PyAnsys and AEDT +====================== + +PyAnsys +------- + +PyAEDT is part of the larger `PyAnsys `_ +effort to facilitate the use of Ansys technologies directly from Python. + +PyAEDT is intended to consolidate and extend all existing +functionalities around scripting for AEDT to allow reuse of existing code, +sharing of best practices, and increased collaboration. + + +About AEDT +---------- + +`AEDT `_ is a platform that enables true +electronics system design. AEDT provides access to the Ansys gold-standard +electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell, +Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. + +In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid, +and mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_collage.jpg + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + + +PyAEDT is licensed under the `MIT License +`_. + +PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products: + +- HFSS and HFSS 3D Layout +- Icepak +- Maxwell 2D, Maxwell 3D, and RMXprt +- 2D Extractor and Q3D Extractor +- Mechanical +- Nexxim +- EDB +- Twin Builder + + +Dependencies +------------ +To run PyAEDT, you must have a local licensed copy of AEDT. +PyAEDT supports AEDT versions 2022 R2 and later. + +Student version +--------------- + +PyAEDT supports AEDT Student versions 2022 R2 and later. For more information, see the +`Ansys Electronics Desktop Student - Free Software Download `_ page on the Ansys website. + + +Why PyAEDT? +----------- +A quick and easy approach for automating a simple operation in the +AEDT UI is to record and reuse a script. However, here are some disadvantages of +this approach: + +- Recorded code is dirty and difficult to read and understand. +- Recorded scripts are difficult to reuse and adapt. +- Complex coding is required by many global users of AEDT. + +Here are the main advantages that PyAEDT provides: + +- Automatic initialization of all AEDT objects, such as desktop + objects like the editor, boundaries, and more +- Error management +- Log management +- Variable management +- Compatibility with IronPython (limited) and CPython +- Simplification of complex API syntax using data objects while + maintaining PEP8 compliance. +- Code reusability across different solvers +- Clear documentation on functions and API +- Unit tests of code to increase quality across different AEDT versions + diff --git a/doc/source/Getting_started/ClientServer.rst b/doc/source/Getting_started/ClientServer.rst new file mode 100644 index 00000000000..712a1bb6cb9 --- /dev/null +++ b/doc/source/Getting_started/ClientServer.rst @@ -0,0 +1,93 @@ +Client-server +============= +You can launch PyAEDT on a remote machine if these conditions are met: + +- AEDT and PyAEDT is installed on client and server machines. +- The same Python version is used on the client and server machines. (CPython 3.8+ + is embedded in the AEDT installation.) + +gRPC connection in AEDT 2022 R2 and later +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In AEDT 2022 R2 and later, PyAEDT fully supports the gRPC API (except for EDB): + +.. code:: python + + # Launch the latest installed version of AEDT in graphical mode. + from ansys.aedt.core import Hfss + from ansys.aedt.core import settings + settings.use_grpc_api=True + hfss = Hfss(machine="fullmachinename", port=portnumber) + +If the ``machine`` argument is provided and the machine is a remote machine, AEDT +must be up and running on the remote server listening on the specified port ``portnumber``. + +To start AEDT in listening mode on the remote machine: + +.. code:: + + path/to/ANSYSEM/v222/Win64/ansysedt.exe -grpcsrv portnumber #windows + path/to/ANSYSEM/v222/Lin64/ansysedt -grpcsrv portnumber #linux + +If the connection is local, the ``machine`` argument must be left empty. PyAEDT then +starts the AEDT session automatically. Machine and port arguments are available to +all applications except EDB. + + +PyAEDT remote service manager +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PyAEDT includes a service manager that can be run on the server machine and can be +launched on-demand in AEDT sessions and act as a file manager. +You can make a remote application call on a CPython server +or any Windows client machine in AEDT 2022 R2 and later. + +On a CPython Server run the ``pyaedt_service_manager`` service that listens on port 17878 +for incoming requests of connections from clients. The port is configurable. +Requirements: + +- Python 3.8+ Virtual Environment. +- pyaedt > 0.6.0 + +On Linux, in addition to the preceding requirements, these environments are needed: +- You can use the CPython version in the AEDT installation folder if you first +add the Python library folder to the ``LD_LIBRARY_PATH`` environment variable. +- You can use the Python 3.8 or later version that is installed. +- You can export ``ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64``. +- You can export ``LD_LIBRARY_PATH=$ANSYSEM_ROOT242/common/mono/Linux64/lib:$ANSYSEM_ROOT242/Delcross:$LD_LIBRARY_PATH``. + +On the server, the ``pyaedt_service_manager`` service listen for incoming connections: + +.. code:: python + + # Launch PyAEDT remote server on CPython + from ansys.aedt.core.common_rpc import pyaedt_service_manager + pyaedt_service_manager() + + +On any client machine, the user must establish the connection as shown in following example. +AEDT can be launched directly while creating the session or after the connection is established. + +.. code:: python + + from ansys.aedt.core.common_rpc import create_session + # User can establish the connection and start a new AEDT session + cl1 = create_session("server_name", launch_aedt_on_server=True, aedt_port=17880, non_graphical=True) + + # Optionally AEDT can be launched after the connection is established + cl2 = create_session("server_name", launch_aedt_on_server=False) + cl2.aedt(port=17880, non_graphical=True) + + +Once AEDT is started then user can connect an application to it. + +.. code:: python + + hfss = Hfss(machine=cl1.server_name, port=cl1.aedt_port) + # your code here + +The client can be used also to upload or download files from the server. + +.. code:: python + + cl1.filemanager.upload(local_path, remote_path) + file_content = cl1.open_file(remote_file) + diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst new file mode 100644 index 00000000000..b62237fa983 --- /dev/null +++ b/doc/source/Getting_started/Contributing.rst @@ -0,0 +1,206 @@ +.. _contributing_aedt: + +========== +Contribute +========== +Overall guidance on contributing to a PyAnsys repository appears in +`Contribute `_ +in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar +with this guide, paying particular attention to `Guidelines and Best Practices +`_, before attempting +to contribute to PyAEDT. + +The following contribution information is specific to PyAEDT. + +Clone the repository +-------------------- +To clone and install the latest version of PyAEDT in +development mode, run: + +.. code:: + + git clone https://github.com/ansys/pyaedt + cd pyaedt + python -m pip install --upgrade pip + pip install -e . + +Post issues +----------- +Use the `PyAEDT Issues `_ +page to submit questions, report bugs, and request new features. + +To reach the product support team, email `pyansys.core@ansys.com `_. + +View PyAEDT documentation +------------------------- +Documentation for the latest stable release of PyAEDT is hosted at +`PyAEDT Documentation `_. + +In the upper right corner of the documentation's title bar, there is an option +for switching from viewing the documentation for the latest stable release +to viewing the documentation for the development version or previously +released versions. + +Code style +---------- +PyAEDT complies with the `PyAnsys code style +`_. +`pre-commit `_ is applied within the CI/CD to ensure compliance. +The ``pre-commit`` Python package can be installed +and run as follows: + +.. code:: bash + + pip install pre-commit + pre-commit run --all-files + +You can also install this as a pre-commit hook with: + +.. code:: bash + + pre-commit install + +This way, it's not possible for you to push code that fails the style checks. +For example:: + + $ pre-commit install + $ git commit -am "Add my cool feature." + black....................................................................Passed + isort (python)...........................................................Passed + flake8...................................................................Passed + codespell................................................................Passed + debug statements (python)................................................Passed + trim trailing whitespace.................................................Passed + Validate GitHub Workflows................................................Passed + blacken-docs.............................................................Passed + +Naming conventions +~~~~~~~~~~~~~~~~~~ +Consistency of names helps improve readability and +ease of use. Starting with release 0.8 a concerted effort +has been made to +improve consistency of naming and adherence to +:ref:`PEP-8`_. + +For example, methods used to create or access entities in +AEDT require that a name be passed to the method or function +as an argument. +It is tempting to +include context as part of that variable name. For example, while it is tempting to use +``setupname`` +as an argument to :meth:`Hfss.create_setup`_, +the context "setup" is +explicitly defined by the method name. The variable ``name`` provides +a more compact +description of the variable in this context. + +In previous PyAEDT versions, you can also find both ``setup_name`` and ``setupname`` used +for various methods or classes. +Improving naming consistency improves maintainability and readability. + +The following table illustrates the recommended conventions: + +.. list-table:: Keywords and object names + :widths: 25 25 50 + :header-rows: 1 + + * - Old name + - New name + - Example + * - ``setupname``, ``setup_name``, ``sweepname`` + - ``name`` + - ``Hfss.create_setup()``, ``Hfss.create_linear_step_sweep()`` + * - ``usethickness`` + - ``thickness`` + - ``Hfss.assign_coating()`` + * - ``entities`` + - ``assignment`` + - ``Maxwell.assign_current_density()`` + * - ``entity_list`` + - ``assignment`` + - ``Maxwell.assign_symmetry()`` + +Take care to use descriptive names for +variables and classes that adhere to PEP-8 and are consistent with conventions already +used in PyAEDT. + +Log errors +~~~~~~~~~~ +PyAEDT has an internal logging tool named ``Messenger`` +and a log file that is automatically generated in the project +folder. + +The following examples demonstrate how ``Messenger`` is used to +write both to the internal AEDT message windows and the log file: + +.. code:: python + + self.logger.error("This is an error message.") + self.logger.warning("This is a warning message.") + self.logger.info("This is an info message.") + +These examples demonstrate how to write messages only to the log file: + +.. code:: python + + self.logger.error("This is an error message.") + self.logger.warning("This is a warning message.") + self.logger.info("This is an info message.") + + +Handle exceptions +~~~~~~~~~~~~~~~~~ +PyAEDT uses a specific decorator, ``@pyaedt_function_handler``, +to handle exceptions caused by methods and by the AEDT API. +This exception handler decorator makes PyAEDT fault tolerant +to errors that can occur in any method. + +For example: + +.. code:: python + + @pyaedt_function_handler() + def my_method(self, var): + pass + +Every method can return a value of ``True`` when successful or +``False`` when failed. When a failure occurs, the error +handler returns information about the error in both the console and +log file. + +Here is an example of an error: + +.. code:: + + ---------------------------------------------------------------------------------- + PyAEDT error on method create_box: General or AEDT error. Check again + the arguments provided: + position = [0, 0, 0] + dimensions_list = [0, 10, 10] + name = None + material = None + ---------------------------------------------------------------------------------- + + (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147024381), None) + File "C:\GIT\repos\AnsysAutomation\PyAEDT\Primitives.py", line 1930, in create_box + o.name = self.oeditor.createbox(vArg1, vArg2) + + ************************************************************ + Method Docstring: + + Create a box. + + Parameters + ---------- + ... + + +Hard-coded values +~~~~~~~~~~~~~~~~~~ +Do not write hard-coded values to the registry. Instead, use the Configuration service. + +Maximum line length +~~~~~~~~~~~~~~~~~~~ +Best practice is to keep the length at or below 120 characters for code, +and comments. Lines longer than this might not display properly on some terminals +and tools or might be difficult to follow. diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst new file mode 100644 index 00000000000..ff37cae9cc9 --- /dev/null +++ b/doc/source/Getting_started/Installation.rst @@ -0,0 +1,197 @@ +Installation +============ +PyAEDT consolidates and extends all existing capital around scripting for AEDT, +allowing re-use of existing code, sharing of best practices, and collaboration. + +This PyAnsys library has been tested on HFSS, Icepak, and Maxwell 3D. It also provides +basic support for EDB and Circuit (Nexxim). + +Requirements +~~~~~~~~~~~~ +In addition to the runtime dependencies listed in the installation information, PyAEDT +requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Version is also supported. + + +Install from PyAEDT installer +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following python script automatically installs PyAEDT from AEDT, +using the CPython interpreter included in the AEDT installation. + +In order to do that you can: + +- Download the following file: :download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>` + +- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. + +- Offline install is also possible using wheelhouses. + +.. note:: + A wheelhouse is a zip containing all needed packages that can be installed offline. + PyAEDT wheelhouse can be found at `Releases `_. + After downloading the wheelhouse zip specific for your distribution and Python release, + run the script from Electronics Desktop using the zip full path as argument. + Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2 + and higher requires the Python 3.10 wheelhouse. + +.. image:: ../Resources/wheelhouse_installation.png + :width: 800 + :alt: PyAEDT run script + +Starting from 2023R2, buttons are available in the Automation Tab as in the example below. + +.. image:: ../Resources/toolkits_ribbon.png + :width: 800 + :alt: PyAEDT toolkit buttons available in AEDT + + +Extension manager +~~~~~~~~~~~~~~~~~ +The user can install or uninstall automated workflows using the extension manager. +There are three options: + +- **Pre-installed extensions** already available in the PyAEDT library. + +- **Open source PyAEDT toolkits** described in the `PyAEDT Common Toolkit documentation `_. + +- **Custom PyAEDT extensions**. + +See `Extension Manager `_ for more information. + +.. image:: ../Resources/toolkit_manager_1.png + :width: 800 + :alt: PyAEDT toolkit manager 1 + +The user can select the AEDT application to install the specific workflow. + +.. image:: ../Resources/toolkit_manager_2.png + :width: 400 + :alt: PyAEDT toolkit manager 2 + +For additional information about AEDT extensions, +see `Extensions `_. + + +Install on CPython from PyPI +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +You can install PyAEDT on CPython from PyPI: + +.. code:: python + + pip install pyaedt + +You can also install PyAEDT from Conda-Forge: + +.. code:: python + + conda install -c conda-forge pyaedt + +To ensure you have all the necessary dependencies, including optional components, use the following command: + +.. code:: python + + pip install pyaedt[all] + +If you are not utilizing gRPC, you can install the required dotnet dependencies separately: + +.. code:: python + + pip install pyaedt[dotnet] + +If you want to install the PyAEDT panels in the AEDT Automation tab, use the following command: + +.. code:: python + + pip install pyaedt[installer] + +Finally, in the python console, run the following commands: + +.. code:: + + from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt + add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") + +You can also install the PyAEDT panels using the following steps, this is also useful if you have a centralized PyAEDT installation: + +- Download the following file: :download:`PyAEDT panel Installer Python file <../Resources/toolkit_installer_from_aedt.py>` + +- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the python interpreter in which PyAEDT is installed. + +- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. You do not need the previous step if +you pass as an argument the path of the python interpreter. + + +Linux support +~~~~~~~~~~~~~ + +PyAEDT works with CPython 3.8 through 3.12 on Linux in AEDT 2022 R2 and later. +However, you must set up the following environment variables: + +.. code:: + + export ANSYSEM_ROOT222=/path/to/AedtRoot/AnsysEM/v222/Linux64 + export LD_LIBRARY_PATH=$ANSYSEM_ROOT222/common/mono/Linux64/lib64:$ANSYSEM_ROOT222/Delcross:$LD_LIBRARY_PATH + + +Install offline from a wheelhouse +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Using a wheelhouse can be helpful if you work for a company that restricts access to external networks. + +Wheelhouses for CPython 3.8, 3.9, 3.10, 3.11, and 3.12 are available in the releases for both Windows and Linux. +From the `Releases `_ +page in the PyAEDT repository, you can find the wheelhouses for a particular release in its +assets and download the wheelhouse specific to your setup. + +There are two kind of wheelhouses: `all` and `installer`. + +The `all` wheelhouse contains all PyAEDT dependencies. And the `installer` one includes `ipython` and `jupyter lab`. + +You can then install PyAEDT and all of its dependencies from one single entry point that can be shared internally, +which eases the security review of the PyAEDT package content. + +For example, on Windows with Python 3.10, install PyAEDT and all its dependencies from a wheelhouse with code like this: + +.. code:: + + pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[all] + +If you want to add the PyAEDT panels in the AEDT Automation tab, you need first to install the installer dependencies: + +.. code:: + + pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[installer] + +Finally, in the python console, run the following commands: + +.. code:: + + from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt + add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") + + +Install PyAEDT in Conda virtual environment +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Create virtual environment + +.. code:: bash + + conda create --name pyaedt_py310 python=3.10 + +Activate virtual environment + +.. code:: bash + + conda activate pyaedt_py310 + +You can also install PyAEDT from Conda-Forge with this command: + +.. code:: bash + + conda install -c conda-forge pyaedt + + +Upgrade PyAEDT to the latest version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code:: bash + + pip install -U pyaedt diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst new file mode 100644 index 00000000000..1d62085640f --- /dev/null +++ b/doc/source/Getting_started/Troubleshooting.rst @@ -0,0 +1,201 @@ +Troubleshooting +=============== +This section contains common issues and suggestions related to installation and use of PyAEDT. + +Installation +~~~~~~~~~~~~ + +Error installing Python or Conda +-------------------------------- +Sometimes companies do not allow installation of a Python interpreter. +In this case, you can use the Python interpreter available in the AEDT installation. + +.. note:: + + Python 3.7 is available in AEDT 2023 R1 and earlier. Python 3.10 is available in AEDT 2023 R2. + +Here is the path to the Python 3.10 interpreter for the 2024 R2 installation: + +.. code:: python + + path\to\AnsysEM\v242\commonfiles\CPython\3_10\winx64\Release\python" + + +Error installing PyAEDT using pip +--------------------------------- +- **Proxy server**: If your company uses a proxy server, you may have to update proxy + settings at the command line. For more information, see the `Using a Proxy + Server `_ in the pip + documentation. +- **Install permission**: Make sure that you have write access to the directory where the + Python interpreter is + installed. The use of a `virtual environment `_ helps + mitigate this issue by placing the Python interpreter and dependencies in a location that is owned + by the user. +- **Firewall**: Some corporate firewalls may block pip. If you face this issue, you'll have to work with your IT + administrator to enable pip. The proxy server settings (described earlier) allow you to explicitly define + the ports used by pip. + +If downloads from `pypi `_ are not allowed, you may use a +`wheelhouse `_. +The wheelhouse file contains all dependencies for PyAEDT and allows full installation without a need to +download additional files. +The wheelhouse for PyAEDT can be found `here `_. +After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and +run the Python command: + +.. code:: python + + >>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyaedt + + +Another option to install PyAEDT from the wheelhouse is to download the following file +:download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>`. +Run this script directly from AEDT and pass the wheelhouse file name as an argument. + + + + +Run PyAEDT +~~~~~~~~~~ + +COM and gRPC +------------ +Prior to the 2022 R2 release, CPython automation in AEDT used +`COM `_ , which +requires all interfaces to be registered in the Windows Registry. +Communication between Python and the AEDT API were translated through an intermediate layer using +`pywin32 `_ and `PythonNET `_. + +`gRPC `_ is a modern open source high performance Remote Procedure Call (RPC) +framework that can run in any environment and supports client/server remote calls. +Starting from 2022R2 the AEDT API has replaced the COM interface with a gRPC interface. + + +.. list-table:: *gRPC Compatibility:* + :widths: 65 65 65 + :header-rows: 1 + + * - < 2022 R2 + - 2022 R2 + - > 2022 R2 + * - Only ``Python.NET`` + - | ``Python.NET``: *Default* + | Enable gRPC: ``ansys.aedt.core.settings.use_grpc_api = True`` + - | gRPC: *Default* + | Enable ``Python.NET``: ``ansys.aedt.core.settings.use_grpc_api = False`` + +The options shown here apply only to the Windows platform. +On Linux, the Python interface to AEDT uses gRPC for all versions. + +.. _GRPC ref: + +Check the AEDT API configuration +-------------------------------- +Run the following command to start AEDT as a gRPC server: + +*Windows:* + +.. code:: console + + path\to\AnsysEM\v231\Win64\ansysedt.exe -grpcsrv 50001 + +**On Linux:** + +.. code:: console + + path\to\AnsysEM\v231\Lin64\ansysedt -grpcsrv 50352 + +The server port number is used by AEDT to listen and receive +commands from the PyAEDT client. This configuration +supports multiple sessions of AEDT running on a single server +and listening on the same port. + +Check the gRPC interface +------------------------ +The native Electronics Desktop API can be used to launch +AEDT from the command line. +PyAEDT is not required to verify the setup for the server and ensure that +all environment +variables have been defined correctly. + +.. code:: python + + import sys + sys.path.append(r"ANSYSEM_ROOT231\PythonFiles\DesktopPlugin") + import ScriptEnv + print(dir()) + ScriptEnv.Initialize("", False, "", 50051) + print(dir()) + + + +Failure connecting to the gRPC server +------------------------------------- +On Linux, PyAEDT may fail to initialize a new instance of the gRPC server +or connect to an existing server session. +This may be due to: + +- Firewall +- Proxy +- Permissions +- License +- Scheduler (for example if the gRPC server was started from LSF or Slurm) + +For issues related to use of a proxy server, you may set the following environment variable to +disable the proxy server for the *localhost*. + +.. code:: console + + export no_proxy=localhost,127.0.0.1 + +Run your PyAEDT script. + +If it still fails, you can disable the proxy server: + +.. code:: console + + export http_proxy= + +Run your PyAEDT script. If the errors persist, perform these steps: + +1. Check that AEDT starts correctly from the command line by + starting the :ref:`gRPC server`. +2. Enable debugging. + +.. code:: console + + export ANSOFT_DEBUG_LOG=/tmp/testlogs/logs/lg + export ANSOFT_DEBUG_LOG_SEPARATE=1 + export ANSOFT_DEBUG_LOG_TIMESTAMP=1 + export ANSOFT_DEBUG_LOG_THREAD_ID=1 + export ANSOFT_DEBUG_MODE=3 + + +Enable the gRPC trace on the server: + +.. code:: console + + export GRPC_VERBOSITY=DEBUG + export GRPC_TRACE=all + +Then run ansysedt.exe as a gRPC server and redirect the output. + +.. code:: console + + ansysedt -grpcsrv 50051 > /path/to/file/server.txt + +The preceding command redirects the gRPC trace +to the file ``server.txt``. + +Open another terminal window to trace the +gRPC calls on the client where the Python script is to be run. + +.. code:: console + + export GRPC_VERBOSITY=DEBUG + export GRPC_TRACE=all + +Now run the PyAEDT script, (making sure it connects to the same port as the gRPC server - 50051). +Capture the output in a file. For example *client.txt*. Then send all the logs +to `Ansys Support `_. diff --git a/doc/source/Getting_started/index.rst b/doc/source/Getting_started/index.rst new file mode 100644 index 00000000000..a981d1a5f83 --- /dev/null +++ b/doc/source/Getting_started/index.rst @@ -0,0 +1,132 @@ +Getting started +=============== + +.. grid:: 2 + + .. grid-item-card:: About PyAnsys and AEDT + :link: About + :link-type: doc + :margin: 2 2 0 0 + + Learn more about PyAnsys and AEDT. + + .. grid-item-card:: Installation + :link: Installation + :link-type: doc + :margin: 2 2 0 0 + + Learn how to install PyAEDT from PyPi or Conda. + + .. grid-item-card:: User guide + :link: ../User_guide/index + :link-type: doc + :margin: 2 2 0 0 + + This section provides in-depth information on PyAEDT key concepts. + + .. grid-item-card:: Client-Server + :link: ClientServer + :link-type: doc + :margin: 2 2 0 0 + + Launch PyAEDT on a client machine and control Electronics Desktop + on a remote server. + + .. grid-item-card:: Versions and interfaces + :link: versioning + :link-type: doc + :margin: 2 2 0 0 + + Discover the compatibility between PyAEDT and Ansys AEDT versions. + + .. grid-item-card:: Troubleshooting + :link: Troubleshooting + :link-type: doc + :margin: 2 2 0 0 + + Any questions? Refer to Q&A before submitting an issue. + + +What is PyAEDT? +--------------- +PyAEDT is a Python library that interacts directly with the API for +Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture +for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, +and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides +support for Circuit tools like Nexxim and system simulation tools like +Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout +tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures +simplify operation while reusing information as much as possible across +the API. + +To run PyAEDT, you must have a licensed copy of Ansys Electronics +Desktop (AEDT) installed. + +The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. +`AEDT `_ provides access to the Ansys gold-standard +electro-magnetics simulation solutions such as Ansys HFSS, +Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. +In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, +and Mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_3.png + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + +For more information, see `Ansys Electronics `_ +on the Ansys website. + +PyAEDT cheat sheets +------------------- + +PyAEDT cheat sheets introduce the basics that you need to use PyAEDT. +These one-page references providing syntax rules and commands +for using PyAEDT API and EDB API: + +**PyAEDT cheat sheet:** `PyAEDT API `_ + +**EDB cheat sheet:** `EDB API `_ + + +Get help +-------- + +**Development issues:** For PyAEDT development-related matters, see the +`PyAEDT Issues `_ page. +You can create issues to report bugs and request new features. + +**User questions:** The best way to get help is to post your question on the `PyAEDT Discussions +`_ page or the `Discussions `_ +page on the Ansys Developer portal. You can post questions, share ideas, and get community feedback. + + +License +------- +PyAEDT is licensed under the MIT license. + +PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the +functionality of AEDT by adding a Python interface to AEDT without changing the +core behavior or license of the original software. The use of PyAEDT requires a +legally licensed local copy of AEDT. + +To get a copy of AEDT, see the `Ansys Electronics `_ +page on the Ansys website. + + + +.. toctree:: + :hidden: + :maxdepth: 2 + + Installation + Troubleshooting + ../User_guide/index + ClientServer + versioning + Contributing + About + diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst new file mode 100644 index 00000000000..f0c872ffa64 --- /dev/null +++ b/doc/source/Getting_started/versioning.rst @@ -0,0 +1,78 @@ +.. _versions_and_interfaces: + +======================= +Versions and interfaces +======================= + +The PyAEDT project attempts to maintain compatibility with legacy +versions of AEDT while allowing for support of faster and better +interfaces with the latest versions of AEDT. + +There are two interfaces PyAEDT can use to connect to AEDT. +You can see a table with the AEDT version and the supported interfaces +in `Table of supported versions `_ + + +gRPC interface +============== + +This is the default and preferred interface to connect to AEDT. +Ansys 2022 R2 and later support the latest gRPC interface, allowing +for remote management of AEDT with rapid streaming of mesh, results, +and files from the AEDT service. + + +Legacy interfaces +================= + +COM interface +-------------- + +AnsysEM supports the legacy COM interface, enabled with the settings option. + +This interface works only on Windows and uses .NET COM objects. + + +.. code:: python + + + from ansys.aedt.core import settings + + settings.use_grpc_api = False + + + +Compatibility between AEDT and interfaces +========================================= + +The following table shows the supported versions of Ansys EDT and the recommended interface for each one of them in PyAEDT. + + +**Table of supported versions** + +.. _table_versions: + ++---------------------------+------------------------+-----------------------------------------------+ +| Ansys Version | Recommended interface | Support | +| | +-----------------------+-----------------------+ +| | | gRPC | COM | ++===========================+========================+=======================+=======================+ +| AnsysEM 2024 R1 | gRPC | YES | NO* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2023 R2 | gRPC | YES | YES* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2023 R1 | gRPC | YES | YES* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2022 R2 | gRPC | YES* | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2022 R1 | gRPC | NO | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2021 R2 | gRPC | NO | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ + +Where: + +* YES means that the interface is supported and recommended. +* YES* means that the interface is supported, but not recommended. Their support might be dropped in the future. +* NO means that the interface is not supported. +* NO* means that the interface is still supported but it is deprecated. diff --git a/doc/source/index.rst b/doc/source/index.rst index 746275cd105..32528e3a1a9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,12 +24,32 @@ enabling straightforward and efficient automation in your workflow. .. grid:: 2 + .. grid-item-card:: Getting started :fa:`person-running` + :link: Getting_started/index + :link-type: doc + + New to PyAEDT? This section provides the information that you need to get started with PyAEDT. + .. grid-item-card:: User guide :fa:`book-open-reader` :link: User_guide/index :link-type: doc This section provides in-depth information on PyAEDT key concepts. +.. grid:: 2 + + .. grid-item-card:: API reference :fa:`book-bookmark` + :link: API/index + :link-type: doc + + This section contains descriptions of the functions and modules included in PyAEDT. + It describes how the methods work and the parameters that can be used. + + .. grid-item-card:: Examples :fa:`scroll` + :link: https://examples.aedt.docs.pyansys.com/ + + Explore examples that show how to use PyAEDT to perform different types of simulations. + .. grid:: 2 .. grid-item-card:: Contribute :fa:`people-group` @@ -43,5 +63,7 @@ enabling straightforward and efficient automation in your workflow. :hidden: + Getting_started/index User_guide/index + API/index Examples From 45ea0eea0fd55d612bd7568e3c0f17db40feb30f Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 15 Nov 2024 10:31:06 +0100 Subject: [PATCH 4/8] TBR: Temporary files removal --- doc/source/API/Application.rst | 70 ----- doc/source/API/Boundaries.rst | 77 ----- doc/source/API/CableModeling.rst | 132 --------- doc/source/API/Configuration.rst | 52 ---- doc/source/API/Constants.rst | 21 -- doc/source/API/DesktopMessenger.rst | 13 - doc/source/API/MaterialManagement.rst | 56 ---- doc/source/API/Mesh.rst | 48 ---- doc/source/API/MultiPartComponent.rst | 23 -- doc/source/API/Optimetrics.rst | 34 --- doc/source/API/Primitive_Objects.rst | 143 ---------- doc/source/API/Primitives2D.rst | 51 ---- doc/source/API/Primitives3D.rst | 74 ----- doc/source/API/Primitives3DLayout.rst | 81 ------ doc/source/API/PrimitivesCircuit.rst | 174 ------------ doc/source/API/Setup.rst | 62 ---- doc/source/API/SetupTemplates.rst | 32 --- doc/source/API/SetupTemplates3DLayout.rst | 22 -- doc/source/API/SetupTemplatesCircuit.rst | 26 -- doc/source/API/SetupTemplatesHFSS.rst | 25 -- doc/source/API/SetupTemplatesIcepak.rst | 24 -- doc/source/API/SetupTemplatesMaxwell.rst | 23 -- doc/source/API/SetupTemplatesMechanical.rst | 23 -- doc/source/API/SetupTemplatesQ3D.rst | 24 -- doc/source/API/SetupTemplatesRmxprt.rst | 33 --- doc/source/API/SetupTemplatesTwinBuilder.rst | 21 -- doc/source/API/Stackup3D.rst | 22 -- doc/source/API/Variables.rst | 31 -- doc/source/API/Visualization.rst | 73 ----- doc/source/API/index.rst | 104 ------- doc/source/API/visualization/advanced.rst | 150 ---------- doc/source/API/visualization/plot.rst | 79 ------ doc/source/API/visualization/post.rst | 266 ------------------ doc/source/API/visualization/report.rst | 81 ------ doc/source/Getting_started/About.rst | 86 ------ doc/source/Getting_started/ClientServer.rst | 93 ------ doc/source/Getting_started/Contributing.rst | 206 -------------- doc/source/Getting_started/Installation.rst | 197 ------------- .../Getting_started/Troubleshooting.rst | 201 ------------- doc/source/Getting_started/index.rst | 132 --------- doc/source/Getting_started/versioning.rst | 78 ----- doc/source/index.rst | 22 -- 42 files changed, 3185 deletions(-) delete mode 100644 doc/source/API/Application.rst delete mode 100644 doc/source/API/Boundaries.rst delete mode 100644 doc/source/API/CableModeling.rst delete mode 100644 doc/source/API/Configuration.rst delete mode 100644 doc/source/API/Constants.rst delete mode 100644 doc/source/API/DesktopMessenger.rst delete mode 100644 doc/source/API/MaterialManagement.rst delete mode 100644 doc/source/API/Mesh.rst delete mode 100644 doc/source/API/MultiPartComponent.rst delete mode 100644 doc/source/API/Optimetrics.rst delete mode 100644 doc/source/API/Primitive_Objects.rst delete mode 100644 doc/source/API/Primitives2D.rst delete mode 100644 doc/source/API/Primitives3D.rst delete mode 100644 doc/source/API/Primitives3DLayout.rst delete mode 100644 doc/source/API/PrimitivesCircuit.rst delete mode 100644 doc/source/API/Setup.rst delete mode 100644 doc/source/API/SetupTemplates.rst delete mode 100644 doc/source/API/SetupTemplates3DLayout.rst delete mode 100644 doc/source/API/SetupTemplatesCircuit.rst delete mode 100644 doc/source/API/SetupTemplatesHFSS.rst delete mode 100644 doc/source/API/SetupTemplatesIcepak.rst delete mode 100644 doc/source/API/SetupTemplatesMaxwell.rst delete mode 100644 doc/source/API/SetupTemplatesMechanical.rst delete mode 100644 doc/source/API/SetupTemplatesQ3D.rst delete mode 100644 doc/source/API/SetupTemplatesRmxprt.rst delete mode 100644 doc/source/API/SetupTemplatesTwinBuilder.rst delete mode 100644 doc/source/API/Stackup3D.rst delete mode 100644 doc/source/API/Variables.rst delete mode 100644 doc/source/API/Visualization.rst delete mode 100644 doc/source/API/index.rst delete mode 100644 doc/source/API/visualization/advanced.rst delete mode 100644 doc/source/API/visualization/plot.rst delete mode 100644 doc/source/API/visualization/post.rst delete mode 100644 doc/source/API/visualization/report.rst delete mode 100644 doc/source/Getting_started/About.rst delete mode 100644 doc/source/Getting_started/ClientServer.rst delete mode 100644 doc/source/Getting_started/Contributing.rst delete mode 100644 doc/source/Getting_started/Installation.rst delete mode 100644 doc/source/Getting_started/Troubleshooting.rst delete mode 100644 doc/source/Getting_started/index.rst delete mode 100644 doc/source/Getting_started/versioning.rst diff --git a/doc/source/API/Application.rst b/doc/source/API/Application.rst deleted file mode 100644 index d7ad0ed6724..00000000000 --- a/doc/source/API/Application.rst +++ /dev/null @@ -1,70 +0,0 @@ -Application and solvers -======================= -The PyAEDT API includes classes for different applications available in Ansys Electronics Desktop (AEDT). -You must initialize AEDT to get access to all PyAEDT modules and methods. - -.. image:: ../Resources/aedt_2.png - :width: 800 - :alt: Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. - - -Available PyAEDT apps are: - -.. autosummary:: - :toctree: _autosummary - - ansys.aedt.core.desktop.Desktop - ansys.aedt.core.hfss.Hfss - ansys.aedt.core.q3d.Q3d - ansys.aedt.core.q3d.Q2d - ansys.aedt.core.maxwell.Maxwell2d - ansys.aedt.core.maxwell.Maxwell3d - ansys.aedt.core.icepak.Icepak - ansys.aedt.core.hfss3dlayout.Hfss3dLayout - ansys.aedt.core.mechanical.Mechanical - ansys.aedt.core.rmxprt.Rmxprt - ansys.aedt.core.circuit.Circuit - ansys.aedt.core.maxwellcircuit.MaxwellCircuit - ansys.aedt.core.emit.Emit - ansys.aedt.core.twinbuilder.TwinBuilder - ansys.aedt.core.filtersolutions.FilterSolutions - - -All other classes and methods are inherited into the app class. -AEDT, which is also referred to as the desktop app, is implicitly launched in any PyAEDT app. -Before accessing a PyAEDT app, the desktop app must be launched and initialized. -The desktop app can be explicitly or implicitly initialized as in the following examples. - -Example with ``Desktop`` class explicit initialization: - -.. code:: python - - from ansys.aedt.core import launch_desktop, Circuit - d = launch_desktop(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here will be caught by Desktop. - ... - d.release_desktop() - -Example with ``Desktop`` class implicit initialization: - -.. code:: python - - from ansys.aedt.core import Circuit - circuit = Circuit(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here will be caught by Desktop. - ... - circuit.release_desktop() - - diff --git a/doc/source/API/Boundaries.rst b/doc/source/API/Boundaries.rst deleted file mode 100644 index b09d5924cfd..00000000000 --- a/doc/source/API/Boundaries.rst +++ /dev/null @@ -1,77 +0,0 @@ -Boundary objects -================ -This section lists classes for creating and editing -boundaries in the 3D tools. These objects are returned by -app methods and can be used to edit or delete a boundary condition. - - -.. currentmodule:: ansys.aedt.core.modules.boundary - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - BoundaryObject - BoundaryObject3dLayout - NetworkObject - FarFieldSetup - Matrix - BoundaryObject3dLayout - Sources - Excitations - -Native components ------------------ - -When native components object are created, the ``NativeComponentObject`` class is returned. For PCB components, ``NativeComponentPCB`` is returned. - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - NativeComponentObject - NativeComponentPCB - -``Native Component Object`` example: - -.. code:: python - - from ansys.aedt.core import Icepak - ipk = Icepak() - component_name = "RadioBoard1" - pcb_comp = self.aedtapp.create_ipk_3dcomponent_pcb( - component_name, link_data, solution_freq, resolution, custom_x_resolution=400, custom_y_resolution=500 - ) - # pcb_comp is a NativeComponentPCB - ... - ipk.release_desktop() - -Icepak transient assignments ----------------------------- -To facilitate transient assignment handling in Icepak, it is possible to use one of the following classes: - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - LinearDictionary - PowerLawDictionary - ExponentialDictionary - SinusoidalDictionary - SquareWaveDictionary - PieceWiseLinearDictionary - -It is possible to initialize the class manually or through a method: - -.. code:: python - - bc_transient = ipk.create_sinusoidal_transient_assignment(vertical_offset="1W", vertical_scaling="3", - period="2", period_offset="0.5s") - # bc_transient will be SinusoidalDictionary type - ipk.assign_solid_block("Cylinder1", bc_transient) - - #or - - bc_transient = SinusoidalDictionary(vertical_offset="1W", vertical_scaling="3", - period="2", period_offset="0.5s") - ipk.assign_solid_block("Cylinder1", bc_transient) \ No newline at end of file diff --git a/doc/source/API/CableModeling.rst b/doc/source/API/CableModeling.rst deleted file mode 100644 index b152c2c4043..00000000000 --- a/doc/source/API/CableModeling.rst +++ /dev/null @@ -1,132 +0,0 @@ -Cable modeling -============== -The ``Cable Modeling`` module includes several methods to work -with the Cable Modeling HFSS Beta feature: - - -* ``create_cable`` to create all available types of cables: bundle, straight wire and twisted pair. -* ``update_cable_properties`` to update all cables properties for all cable types. -* ``update_shielding`` to update only the shielding jacket type for bundle cable. -* ``remove_cables`` to remove cables. -* ``add_cable_to_bundle`` to add a cable or a list of cables to a bundle. -* ``create_clock_source`` to create a clock source. -* ``update_clock_source`` to update a clock source. -* ``remove_source`` to remove a source. -* ``remove_all_sources`` to remove all sources. -* ``create_pwl_source`` to create a pwl source. -* ``create_pwl_source_from_file`` to create a pwl source from file. -* ``update_pwl_source`` to update a pwl source. -* ``create_cable_harness`` to create a cable harness. - -They are accessible through: - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cable_modeling.Cable - -Cable bundle creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the cable properties - cable_props["Add_Cable"] = "True" - cable_props["Cable_prop"]["CableType"] = "bundle" - cable_props["Cable_prop"]["IsJacketTypeInsulation"] = "True" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "InsThickness" - ] = "3.66mm" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "JacketMaterial" - ] = "pec" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ - "InnerDiameter" - ] = "2.88mm" - cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleAttribs"]["Name"] = "Bundle_Cable_Insulation" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the cable bundle - cable.create_cable() - -Clock source creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the clock source properties - cable_props["Add_Cable"] = "False" - cable_props["Update_Cable"] = "False" - cable_props["Add_CablesToBundle"] = "False" - cable_props["Remove_Cable"] = "False" - cable_props["Add_Source"] = "True" - cable_props["Source_prop"]["AddClockSource"] = "True" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Period"] = "40us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["LowPulseVal"] = "0.1V" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["HighPulseVal"] = "2V" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Risetime"] = "5us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Falltime"] = "10us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["PulseWidth"] = "23us" - cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["TDSourceAttribs"]["Name"] = "clock_test_1" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the clock source - cable.create_clock_source() - -Cable harness creation example: - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.generic.DataHandlers import json_to_dict - from ansys.aedt.core.modules.cable_modeling import Cable - - hfss = Hfss(projectname=project_path, specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns a dictionary out of the JSON file - cable_props = json_to_dict(json_path) - # This example shows how to manually change from script the cable harness properties - cable_props["Add_Cable"] = "False" - cable_props["Update_Cable"] = "False" - cable_props["Add_CablesToBundle"] = "False" - cable_props["Remove_Cable"] = "False" - cable_props["Add_Source"] = "False" - cable_props["Update_Source"] = "False" - cable_props["Remove_Source"] = "False" - cable_props["Add_CableHarness"] = "True" - cable_props["CableHarness_prop"]["Name"] = "cable_harness_test" - cable_props["CableHarness_prop"]["Bundle"] = "New_updated_name_cable_bundle_insulation" - cable_props["CableHarness_prop"]["TwistAngleAlongRoute"] = "20deg" - cable_props["CableHarness_prop"]["Polyline"] = "Polyline1" - cable_props["CableHarness_prop"]["AutoOrient"] = "False" - cable_props["CableHarness_prop"]["XAxis"] = "Undefined" - cable_props["CableHarness_prop"]["XAxisOrigin"] = ["0mm", "0mm", "0mm"] - cable_props["CableHarness_prop"]["XAxisEnd"] = ["0mm", "0mm", "0mm"] - cable_props["CableHarness_prop"]["ReverseYAxisDirection"] = "True" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][0]["CableName"] = "straight_wire_cable" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][1]["CableName"] = "straight_wire_cable1" - cable_props["CableHarness_prop"]["CableTerminationsToInclude"][2]["CableName"] = "straight_wire_cable2" - # This call returns the Cable class - cable = Cable(hfss, cable_props) - # This call creates the cable harness - cable.create_cable_harness() \ No newline at end of file diff --git a/doc/source/API/Configuration.rst b/doc/source/API/Configuration.rst deleted file mode 100644 index c81b35eb20d..00000000000 --- a/doc/source/API/Configuration.rst +++ /dev/null @@ -1,52 +0,0 @@ -Configuration files -~~~~~~~~~~~~~~~~~~~ -This module contains all methods to export project settings to a JSON file -and import and apply settings to a new design. Currently the configuration -cover the following apps: -* HFSS -* Q2D and Q3D Extractor -* Maxwell -* Icepak -* Mechanical - -The sections covered are: - -* Variables -* Mesh operations -* Setup and optimetrics -* Material properties -* Object properties -* Boundaries and excitations - -When a boundary is attached to a face, the tool tries to match it with a -FaceByPosition on the same object name on the target design. If, for any -reason, this face position has changed or the object name in the target design has changed, -the boundary fails to apply. - - -.. currentmodule:: ansys.aedt.core.generic.configurations - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Configurations - ConfigurationsOptions - ImportResults - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(project_name="original_project", specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - conf_file = self.aedtapp.configurations.export_config() - - app2 = Hfss(projec_name='newproject') - app2.modeler.import_3d_cad(file_path) - out = app2.configurations.import_config(conf_file) - app2.configurations.results.global_import_success - - ... diff --git a/doc/source/API/Constants.rst b/doc/source/API/Constants.rst deleted file mode 100644 index 70b4bce618f..00000000000 --- a/doc/source/API/Constants.rst +++ /dev/null @@ -1,21 +0,0 @@ -Constants -========== -This section lists constants that are commonly used in PyAEDT. - - -Example of constants usage: - -.. code:: python - - from ansys.aedt.core import constants - ipk = Icepak() - # Use of AXIS Constant - cylinder = ipk.modeler.create_cylinder(constants.AXIS.X, [0,0,0],10,3) - # Use of PLANE Constant - ipk.modeler.split(cylinder, constants.PLANE.YZ, sides="Both") - ... - ipk.release_desktop() - - -.. automodule:: ansys.aedt.core.generic.constants - :members: diff --git a/doc/source/API/DesktopMessenger.rst b/doc/source/API/DesktopMessenger.rst deleted file mode 100644 index 3b6077d85d5..00000000000 --- a/doc/source/API/DesktopMessenger.rst +++ /dev/null @@ -1,13 +0,0 @@ -Logger -~~~~~~ -This section lists modules for creating and editing -PyAEDT log files. - -.. currentmodule:: ansys.aedt.core.aedt_logger - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - AedtLogger - AppFilter diff --git a/doc/source/API/MaterialManagement.rst b/doc/source/API/MaterialManagement.rst deleted file mode 100644 index bf672ae8afd..00000000000 --- a/doc/source/API/MaterialManagement.rst +++ /dev/null @@ -1,56 +0,0 @@ -Material and stackup -==================== -This section lists material and stackup modules. -These classes cannot be used directly but can be accessed through an app. -Example: - - - -Material management -~~~~~~~~~~~~~~~~~~~ -This section describes all material-related classes and methods. - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - material_lib.Materials - material.Material - material.SurfaceMaterial - material.MatProperties - material.SurfMatProperties - material.MatProperty - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Materials class - my_materials = app.materials - # This call returns the Material class - copper = my_materials["copper"] - # This property is from the MatProperty class - copper.conductivity - ... - - - -Stackup management -~~~~~~~~~~~~~~~~~~ -This section describes all layer-related classes and methods used in HFSS 3D Layout (and indirectly in Circuit). - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - - layer_stackup.Layers - layer_stackup.Layer \ No newline at end of file diff --git a/doc/source/API/Mesh.rst b/doc/source/API/Mesh.rst deleted file mode 100644 index 5ac5adad37d..00000000000 --- a/doc/source/API/Mesh.rst +++ /dev/null @@ -1,48 +0,0 @@ -Mesh operations -=============== -The ``Mesh`` module includes these classes: - -* ``Mesh`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor -* ``IcepakMesh`` for Icepak -* ``Mesh3d`` for HFSS 3D Layout - -They are accessible through the mesh property: - -.. currentmodule:: ansys.aedt.core.modules - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - mesh.Mesh - mesh_icepak.IcepakMesh - mesh_3d_layout.Mesh3d - -.. code:: python - - from ansys.aedt.core import Maxwell3d - app = Maxwell3d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - # This call returns the Mesh class - my_mesh = app.mesh - # This call executes a ``Mesh`` method and creates an object to control the mesh operation - mesh_operation_object = my_mesh.assign_surface_mesh("MyBox", 2) - ... - -Icepak mesh -~~~~~~~~~~~~~~~ - -These objects are relevant objects while using the ``MeshIcepak`` class: - -.. currentmodule:: ansys.aedt.core.modules.mesh_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - - Region - SubRegion - MeshRegion - GlobalMeshRegion \ No newline at end of file diff --git a/doc/source/API/MultiPartComponent.rst b/doc/source/API/MultiPartComponent.rst deleted file mode 100644 index 2c55c82bcb1..00000000000 --- a/doc/source/API/MultiPartComponent.rst +++ /dev/null @@ -1,23 +0,0 @@ -Multi-part components -===================== -This section lists classes for creating and editing multi-part components in the 3D tools. -This consists of a set of one or more 3D component objects, linked together and parametrized -to allow movements. - - - -.. currentmodule:: ansys.aedt.core.modeler.advanced_cad - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - actors.Person - actors.Vehicle - actors.Bird - actors.Radar - parts.Part - parts.Antenna - multiparts.MultiPartComponent - multiparts.Environment - multiparts.Actor diff --git a/doc/source/API/Optimetrics.rst b/doc/source/API/Optimetrics.rst deleted file mode 100644 index 5f02473f306..00000000000 --- a/doc/source/API/Optimetrics.rst +++ /dev/null @@ -1,34 +0,0 @@ -Optimetrics -=========== -This module contains all properties and methods needed to create -optimetrics setups. - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # returns the ParametericsSetups Class - app.parametrics - - # returns the OptimizationSetups Class - app.optimizations - - # adds an optimization and returns Setup class with all settings and methods - sweep3 = hfss.opti_optimization.add_optimization(calculation="dB(S(1,1))", calculation_value="2.5GHz") - - ... - -.. currentmodule:: ansys.aedt.core.modules.design_xploration - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ParametricSetups - OptimizationSetups - SetupParam - SetupOpti - diff --git a/doc/source/API/Primitive_Objects.rst b/doc/source/API/Primitive_Objects.rst deleted file mode 100644 index ac3a3fcbfd7..00000000000 --- a/doc/source/API/Primitive_Objects.rst +++ /dev/null @@ -1,143 +0,0 @@ -Primitives -========== - -This section lists the core AEDT Modeler primitives that are supported both in 2D and 3D solvers (HFSS, Maxwell, -Icepak, Q3D, and Mechanical): - -* Primitives -* Objects - -They are accessible through the ``modeler.objects`` property: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call return an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - my_box = primitives.objects[my_box.id] - - # This call return a FacePrimitive object list - my_box.faces - # This call returns an EdgePrimitive object list - my_box.edges - my_box.faces[0].edges - - # This call returns a VertexPrimitive object list - my_box.vertices - my_box.faces[0].vertices - my_box.faces[0].edges[0].vertices - - ... - - - -Objects -~~~~~~~ - -The following classes define objects properties for 3D and 2D Solvers (excluding HFSS 3D Layout). -They contain all getters and setters to simplify object manipulation. - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cad.object_3d.Object3d - cad.elements_3d.FacePrimitive - cad.elements_3d.EdgePrimitive - cad.elements_3d.VertexPrimitive - cad.polylines.PolylineSegment - cad.polylines.Polyline - cad.component_array.ComponentArray - cad.components_3d.UserDefinedComponent - cad.elements_3d.Point - cad.elements_3d.Plane - cad.elements_3d.HistoryProps - cad.elements_3d.BinaryTreeNode - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call returns an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - - # Getter and setter - my_box.material_name - my_box.material_name = "copper" - - my_box.faces[0].center - - ... - - -Coordinate systems and geometry operators -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This module contains all properties and methods needed to edit a -coordinate system and a set of useful geometry operators. -The ``CoordinateSystem`` class is accessible through the ``create_coordinate_system`` -method or the ``coordinate_systems`` list. The ``GeometryOperators`` class can be -imported and used because it is made by static methods. - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - cad.modeler.CoordinateSystem - geometry_operators.GeometryOperators - - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the CoordinateSystem object list - cs = app.modeler.coordinate_systems - - # This call returns a CoordinateSystem object - new_cs = app.modeler.create_coordinate_system() - - ... - - -Advanced modeler operations -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -PyAEDT includes some advanced modeler tools like ``MultiPartComponent`` for 3D component -management and ``Stackup3D`` for parametric creation of 3D modeler stackups. - -.. toctree:: - :maxdepth: 2 - - MultiPartComponent - Stackup3D \ No newline at end of file diff --git a/doc/source/API/Primitives2D.rst b/doc/source/API/Primitives2D.rst deleted file mode 100644 index 13273427673..00000000000 --- a/doc/source/API/Primitives2D.rst +++ /dev/null @@ -1,51 +0,0 @@ -2D modeler -=========== - -This section lists the core AEDT Modeler modules for 2D and 3D solvers (Maxwell 2D, 2D Extractor). - - -They are accessible through the ``modeler`` property: - -.. code:: python - - from ansys.aedt.core import Maxwell2d - app = Maxwell2d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler2D class - modeler = app.modeler - - - ... - - - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_2d.Modeler2D - - - -.. code:: python - - from ansys.aedt.core import Maxwell2d - app = Maxwell2d(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the NexximComponents class - origin = [0,0,0] - dimensions = [10,5,20] - #Material and name are not mandatory fields - box_object = app.modeler.primivites.create_rectangle([15, 20, 0], [5, 5], material="aluminum") - - ... diff --git a/doc/source/API/Primitives3D.rst b/doc/source/API/Primitives3D.rst deleted file mode 100644 index 4d55ad3fc86..00000000000 --- a/doc/source/API/Primitives3D.rst +++ /dev/null @@ -1,74 +0,0 @@ -3D modeler -========== - -This section lists the core AEDT Modeler modules with 3D solvers (HFSS, Maxwell, -Icepak, Q3D, and Mechanical): - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` property: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call return the Modeler3D class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call return an Object3d object - my_box = primitives.create_box([0,0,0],[10,10,10]) - my_box = primitives.objects[my_box.id] - - # This call return a FacePrimitive object list - my_box.faces - # This call returns an EdgePrimitive object list - my_box.edges - my_box.faces[0].edges - - # This call returns a VertexPrimitive object list - my_box.vertices - my_box.faces[0].vertices - my_box.faces[0].edges[0].vertices - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties for HFSS, Maxwell 3D, Q3D Extractor, and Icepak: - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_3d.Modeler3D - - -.. code:: python - - from ansys.aedt.core import Circuit - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the NexximComponents class - origin = [0,0,0] - sizes = [10,5,20] - #Material and name are not mandatory fields - box_object = app.modeler.primivites.create_box(origin, sizes, name="mybox", material="copper") - - ... diff --git a/doc/source/API/Primitives3DLayout.rst b/doc/source/API/Primitives3DLayout.rst deleted file mode 100644 index 263443209a2..00000000000 --- a/doc/source/API/Primitives3DLayout.rst +++ /dev/null @@ -1,81 +0,0 @@ -Modeler in HFSS 3D Layout -========================== - -This section lists the core AEDT Modeler modules available in HFSS 3D Layout: - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` module and ``modeler.objects`` property: - -.. code:: python - - from ansys.aedt.core import Hfss3dLayout - hfss = Hfss3dLayout() - my_modeler = hfss.modeler - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - - -* ``Modeler3DLayout`` for HFSS 3D Layout - - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - modeler_pcb.Modeler3DLayout - - -Objects in HFSS 3D Layout -~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for HFSS 3D Layout. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.pcb - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - object_3d_layout.Components3DLayout - object_3d_layout.Nets3DLayout - object_3d_layout.Pins3DLayout - object_3d_layout.Line3dLayout - object_3d_layout.Polygons3DLayout - object_3d_layout.Circle3dLayout - object_3d_layout.Rect3dLayout - object_3d_layout.Points3dLayout - object_3d_layout.Padstack - -.. code:: python - - from ansys.aedt.core import Hfss3dLayout - app = Hfss3dLayout(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler3DLayout class - modeler = app.modeler - - # This call returns a Primitives3D object - primitives = modeler - - # This call returns an Object3d object - my_rect = primitives.create_rectangle([0,0,0],[10,10]) - - # Getter and setter - my_rect.material_name - - ... diff --git a/doc/source/API/PrimitivesCircuit.rst b/doc/source/API/PrimitivesCircuit.rst deleted file mode 100644 index a9b8444712c..00000000000 --- a/doc/source/API/PrimitivesCircuit.rst +++ /dev/null @@ -1,174 +0,0 @@ -Modeler and components Circuit -============================== - -This section lists the core AEDT Modeler modules: - -* Modeler -* Primitives -* Objects - -They are accessible through the ``modeler`` module and ``modeler.objects`` property: - -.. code:: python - - - from ansys.aedt.core import TwinBuilder - app = TwinBuilder(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - ... - - -Modeler -~~~~~~~ - -The ``Modeler`` module contains all properties and methods needed to edit a -modeler, including all primitives methods and properties: - -* ``ModelerNexxim`` for Circuit -* ``ModelerTwinBuilder`` for Twin Builder -* ``ModelerEmit`` for EMIT - - -.. currentmodule:: ansys.aedt.core.modeler - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - schematic.ModelerNexxim - schematic.ModelerTwinBuilder - schematic.ModelerEmit - schematic.ModelerMaxwellCircuit - - -Schematic in Circuit -~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Circuit components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_nexxim - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - NexximComponents - -.. code:: python - - from ansys.aedt.core import Circuit - app = Circuit(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - -Objects in Circuit -~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Circuit. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - object_3d_circuit.CircuitComponent - object_3d_circuit.CircuitPins - object_3d_circuit.Wire - -.. code:: python - - from ansys.aedt.core import Circuit - app = Circuit(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - # Getter and setter - my_res.location - my_res.parameters["R"]=100 - - ... - -Schematic in EMIT -~~~~~~~~~~~~~~~~~ -The following classes define the object properties for EMIT components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_emit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - EmitComponents - - -Schematic in Twin Builder -~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Twin Builder components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_twin_builder - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - TwinBuilderComponents - -.. code:: python - - from ansys.aedt.core import TwinBuilder - app = TwinBuilder(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Modeler class - modeler = app.modeler - - # This call returns a Schematic object - schematic = modeler.schematic - - # This call returns an Object3d object - my_res = schematic.create_resistor("R1", 50) - - # Getter and setter - my_res.location - my_res.parameters["R"]=100 - - ... - - -Schematic in Maxwell Circuit -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes define the object properties for Maxwell Circuit components. -They contain all getters and setters to simplify object manipulation. - -.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_maxwell_circuit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - MaxwellCircuitComponents diff --git a/doc/source/API/Setup.rst b/doc/source/API/Setup.rst deleted file mode 100644 index 3b2774a64d5..00000000000 --- a/doc/source/API/Setup.rst +++ /dev/null @@ -1,62 +0,0 @@ -Setup -===== -This section lists setup modules: - -* ``Setup`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor -* ``Setup3DLayout`` for HFSS 3D Layout -* ``SetupCircuit`` for Circuit and Twin Builder - -The ``Setup`` object is accessible through the ``create_setup`` method and ``setups`` object list. - -.. currentmodule:: ansys.aedt.core.modules.solve_setup - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SetupHFSS - SetupHFSSAuto - SetupSBR - SetupQ3D - SetupMaxwell - Setup - Setup3DLayout - SetupCircuit - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the Setup class - my_setup = app.setups[0] - - - # This call returns a Setup object - setup = app.create_setup("MySetup") - - ... - - -Sweep classes -============= -This section lists sweep classes and their default values: - -* ``SweepHFSS`` for HFSS -* ``SweepHFSS3DLayout`` for HFSS 3D Layout -* ``SweepMatrix`` for Q3D and 2D Extractor - -The ``Setup`` object is accessible through the methods available for sweep creation. - - -.. currentmodule:: ansys.aedt.core.modules.solve_sweeps - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SweepHFSS - SweepHFSS3DLayout - SweepMatrix diff --git a/doc/source/API/SetupTemplates.rst b/doc/source/API/SetupTemplates.rst deleted file mode 100644 index 89a80c540c9..00000000000 --- a/doc/source/API/SetupTemplates.rst +++ /dev/null @@ -1,32 +0,0 @@ -Setup templates -=============== - -This section lists all setup templates with their default values and keys. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - Launch AEDT 2023 R1 in non-graphical mode - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - -.. toctree:: - :maxdepth: 2 - - SetupTemplatesHFSS - SetupTemplates3DLayout - SetupTemplatesMaxwell - SetupTemplatesQ3D - SetupTemplatesIcepak - SetupTemplatesMechanical - SetupTemplatesCircuit - SetupTemplatesTwinBuilder - SetupTemplatesRmxprt diff --git a/doc/source/API/SetupTemplates3DLayout.rst b/doc/source/API/SetupTemplates3DLayout.rst deleted file mode 100644 index 20007619039..00000000000 --- a/doc/source/API/SetupTemplates3DLayout.rst +++ /dev/null @@ -1,22 +0,0 @@ -HFSS 3D Layout and arguments -============================ - -This section lists all setup templates with their default values and keys available in HFSS 3D Layout. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - Launch AEDT 2023 R1 in non-graphical mode - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSS3DLayout diff --git a/doc/source/API/SetupTemplatesCircuit.rst b/doc/source/API/SetupTemplatesCircuit.rst deleted file mode 100644 index 32c3b59025b..00000000000 --- a/doc/source/API/SetupTemplatesCircuit.rst +++ /dev/null @@ -1,26 +0,0 @@ -Circuit templates and arguments -================================ - -This section lists all setup templates with their default values and keys available in Circuit. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximLNA -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximDC -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximQuickEye -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximVerifEye -.. pprint:: ansys.aedt.core.modules.setup_templates.NexximAMI - diff --git a/doc/source/API/SetupTemplatesHFSS.rst b/doc/source/API/SetupTemplatesHFSS.rst deleted file mode 100644 index e3e09901dc6..00000000000 --- a/doc/source/API/SetupTemplatesHFSS.rst +++ /dev/null @@ -1,25 +0,0 @@ -HFSS templates and arguments -============================ - -This section lists all setup templates with their default values and keys available in HFSS. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenAuto -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSSBR - diff --git a/doc/source/API/SetupTemplatesIcepak.rst b/doc/source/API/SetupTemplatesIcepak.rst deleted file mode 100644 index 30d623930e1..00000000000 --- a/doc/source/API/SetupTemplatesIcepak.rst +++ /dev/null @@ -1,24 +0,0 @@ -Icepak templates and arguments -=============================== - -This section lists all setup templates with their default values and keys available in Icepak. -Note that Icepak parameters contain spaces. To use them as arguments of the ``"create_setup"`` method, these -same parameters have to be used without spaces. -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Icepak - - app = Icepak() - # Any property of this setup can be found on this page. - setup = app.create_setup(MaxIterations=5) - -Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``. - -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientFlowOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureAndFlow -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyFlowOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureOnly -.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureAndFlow diff --git a/doc/source/API/SetupTemplatesMaxwell.rst b/doc/source/API/SetupTemplatesMaxwell.rst deleted file mode 100644 index 5ac02dcc9dc..00000000000 --- a/doc/source/API/SetupTemplatesMaxwell.rst +++ /dev/null @@ -1,23 +0,0 @@ -Maxwell templates and arguments -=============================== - - -This section lists all setup templates with their default values and keys available in Maxwell 2D and 3D. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Maxwell3d - - Maxwell3d = Maxwell3d () - # Any property of this setup can be found on this page. - setup = Maxwell3d.create_setup () - setup.props["MaximumPasses"] = 5 - setup.update () - -.. pprint:: ansys.aedt.core.modules.setup_templates.MaxwellTransient -.. pprint:: ansys.aedt.core.modules.setup_templates.Magnetostatic -.. pprint:: ansys.aedt.core.modules.setup_templates.Electrostatic -.. pprint:: ansys.aedt.core.modules.setup_templates.EddyCurrent -.. pprint:: ansys.aedt.core.modules.setup_templates.ElectricTransient diff --git a/doc/source/API/SetupTemplatesMechanical.rst b/doc/source/API/SetupTemplatesMechanical.rst deleted file mode 100644 index 09b9adc824f..00000000000 --- a/doc/source/API/SetupTemplatesMechanical.rst +++ /dev/null @@ -1,23 +0,0 @@ -Mechanical templates and arguments -================================== - -This section lists all setup templates with their default values and keys available in Mechanical. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - - from ansys.aedt.core import Mechanical - - app = Mechanical() - # Any property of this setup can be found on this page. - setup = app.create_setup(MaxModes=6) - - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.MechTerm -.. pprint:: ansys.aedt.core.modules.setup_templates.MechModal -.. pprint:: ansys.aedt.core.modules.setup_templates.MechStructural - diff --git a/doc/source/API/SetupTemplatesQ3D.rst b/doc/source/API/SetupTemplatesQ3D.rst deleted file mode 100644 index 838e2cd68b7..00000000000 --- a/doc/source/API/SetupTemplatesQ3D.rst +++ /dev/null @@ -1,24 +0,0 @@ -Q3D templates and arguments -=========================== - - -This section lists all setup templates with their default values and keys available in Q3D and 2D Extractor. -Note that to use nested parameters, you can set a parameter using the "__" separator as shown in the following example. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - - from ansys.aedt.core import Q3d - - app = Q3d() - # Any property of this setup can be found on this page. - setup = app.create_setup(AC__MaxPasses=6) - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.Matrix -.. pprint:: ansys.aedt.core.modules.setup_templates.Close -.. pprint:: ansys.aedt.core.modules.setup_templates.Open - diff --git a/doc/source/API/SetupTemplatesRmxprt.rst b/doc/source/API/SetupTemplatesRmxprt.rst deleted file mode 100644 index 57fb82b99af..00000000000 --- a/doc/source/API/SetupTemplatesRmxprt.rst +++ /dev/null @@ -1,33 +0,0 @@ -RMXprt templates and arguments -============================== - -This section lists all setup templates with their default values and keys available in RMXprt. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.GRM -.. pprint:: ansys.aedt.core.modules.setup_templates.DFIG -.. pprint:: ansys.aedt.core.modules.setup_templates.TPIM -.. pprint:: ansys.aedt.core.modules.setup_templates.TPSM -.. pprint:: ansys.aedt.core.modules.setup_templates.BLDC -.. pprint:: ansys.aedt.core.modules.setup_templates.ASSM -.. pprint:: ansys.aedt.core.modules.setup_templates.PMDC -.. pprint:: ansys.aedt.core.modules.setup_templates.SRM -.. pprint:: ansys.aedt.core.modules.setup_templates.LSSM -.. pprint:: ansys.aedt.core.modules.setup_templates.UNIM -.. pprint:: ansys.aedt.core.modules.setup_templates.DCM -.. pprint:: ansys.aedt.core.modules.setup_templates.CPSM -.. pprint:: ansys.aedt.core.modules.setup_templates.NSSM - diff --git a/doc/source/API/SetupTemplatesTwinBuilder.rst b/doc/source/API/SetupTemplatesTwinBuilder.rst deleted file mode 100644 index 153c99fa365..00000000000 --- a/doc/source/API/SetupTemplatesTwinBuilder.rst +++ /dev/null @@ -1,21 +0,0 @@ -Twin Builder templates and arguments -==================================== - - -This section lists all setup templates with their default values and keys available in Twin Builder. - -You can edit a setup after it is created. Here is an example: - -.. code:: python - - from ansys.aedt.core import Hfss - - hfss = Hfss() - # Any property of this setup can be found on this page. - setup = hfss.create_setup() - setup.props["AdaptMultipleFreqs"] = True - setup.update() - - - -.. pprint:: ansys.aedt.core.modules.setup_templates.TR diff --git a/doc/source/API/Stackup3D.rst b/doc/source/API/Stackup3D.rst deleted file mode 100644 index 439502b773d..00000000000 --- a/doc/source/API/Stackup3D.rst +++ /dev/null @@ -1,22 +0,0 @@ -Stackup 3D components -===================== -This section lists ``stackup_3d`` classes for creating and editing a stackup and objects in the 3D tools. -This consists of a set of one or more parametrized layer objects and placing lines, patches, polygons, -and vias. - - - -.. currentmodule:: ansys.aedt.core.modeler.advanced_cad - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - stackup_3d.Stackup3D - stackup_3d.Layer3D - stackup_3d.Padstack - stackup_3d.PadstackLayer - stackup_3d.Patch - stackup_3d.Trace - stackup_3d.Polygon - stackup_3d.NamedVariable diff --git a/doc/source/API/Variables.rst b/doc/source/API/Variables.rst deleted file mode 100644 index 168bdd55ea9..00000000000 --- a/doc/source/API/Variables.rst +++ /dev/null @@ -1,31 +0,0 @@ -Variable -======== -This module provides all functionalities for creating and editing -design and project variables in the 3D tools. - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the VariableManager class - variable_manager = self.aedtapp._variable_manager - - # Set and get a variable - app["w"] = "10mm" - a = app["w"] - ... - - -.. currentmodule:: ansys.aedt.core.application.variables - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VariableManager - Variable - DataSet - CSVDataset diff --git a/doc/source/API/Visualization.rst b/doc/source/API/Visualization.rst deleted file mode 100644 index dd31524bbb6..00000000000 --- a/doc/source/API/Visualization.rst +++ /dev/null @@ -1,73 +0,0 @@ -Visualization -============= - -This section outlines the available modules for creating and editing data within and outside AEDT. - -PyAEDT offers four primary levels of visualization: - -* **Reports** -* **Post-processing** -* **Graphics** -* **Advanced Visualization** - -Reports -~~~~~~~ - -AEDT provides extensive flexibility for generating reports. -PyAEDT includes dedicated classes to manipulate all report properties, offering full control over report customization. - -.. toctree:: - :maxdepth: 1 - - visualization/report - -.. image:: ../Resources/sparams.jpg - :width: 800 - :alt: S-Parameters - - -Post-processing -~~~~~~~~~~~~~~~ - -AEDT has different post-processing tools. -PyAEDT provides classes to interact with and modify any of these tools, -enhancing data analysis and visualization capabilities. - -.. toctree:: - :maxdepth: 1 - - visualization/post - -.. image:: ../Resources/field_plot.png - :width: 800 - :alt: Postprocessing features - - -Graphics -~~~~~~~~ - -Specialized plotting options. - -.. toctree:: - :maxdepth: 1 - - visualization/plot - -.. image:: ../Resources/pyvista_plot.jpg - :width: 800 - :alt: S-Parameters Matplotlib - - -Advanced Visualization -~~~~~~~~~~~~~~~~~~~~~~ - -High-level visualization tools. - -.. toctree:: - :maxdepth: 1 - - visualization/advanced - -.. image:: ../Resources/farfield.png - :width: 800 - :alt: Farfield pyvista diff --git a/doc/source/API/index.rst b/doc/source/API/index.rst deleted file mode 100644 index 0d7dbde7ad4..00000000000 --- a/doc/source/API/index.rst +++ /dev/null @@ -1,104 +0,0 @@ -============= -API reference -============= - -This section describes PyAEDT core classes, methods, and functions -for AEDT apps and modules. Use the search feature or click links -to view API documentation. -The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. -`AEDT `_ provides access to the Ansys gold-standard -electro-magnetics simulation solutions such as Ansys HFSS, -Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. -In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, -and Mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_2.png - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - -The PyAEDT API includes classes for apps and modules. You must initialize the -PyAEDT app to get access to all modules and methods. Available apps are: - -- `HFSS `_ -- `HFSS 3D Layout `_ -- `Maxwell 3D `_ -- `Maxwell 2D `_ -- `Maxwell Circuit `_ -- `Q3D `_ -- `Q2D Extractor `_ -- `Icepak `_ -- `Mechanical `_ -- RMXprt -- EMIT -- Circuit -- `TwinBuilder `_ -- `FilterSolutions `_ - - -All other classes and methods are inherited into the app class. -The desktop app is implicitly launched in any of the other applications. -Before accessing a PyAEDT app, the desktop app has to be launched and initialized. -The desktop app can be explicitly or implicitly initialized as shown in the following examples. - -Example with ``Desktop`` class explicit initialization: - -.. code:: python - - from ansys.aedt.core import launch_desktop, Circuit - d = launch_desktop(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here should be caught by the desktop app. - ... - d.release_desktop() - -Example with ``Desktop`` class implicit initialization: - -.. code:: python - - from ansys.aedt.core import Circuit - circuit = Circuit(specified_version="2023.1", - non_graphical=False, - new_desktop_session=True, - close_on_exit=True, - student_version=False): - circuit = Circuit() - ... - # Any error here should be caught by the desktop app. - ... - circuit.release_desktop() - - -.. toctree:: - :maxdepth: 2 - - Application - MaterialManagement - Primitives3D - Primitives2D - Primitive_Objects - Primitives3DLayout - PrimitivesCircuit - Boundaries - Mesh - Setup - Visualization - DesktopMessenger - Optimetrics - Variables - Constants - Configuration - SetupTemplates - CableModeling - - - - diff --git a/doc/source/API/visualization/advanced.rst b/doc/source/API/visualization/advanced.rst deleted file mode 100644 index 39dbc5fc16b..00000000000 --- a/doc/source/API/visualization/advanced.rst +++ /dev/null @@ -1,150 +0,0 @@ -Advanced -======== - -You can use PyAEDT for postprocessing of AEDT results to display graphics object and plot data. - - -Touchstone -~~~~~~~~~~ - -TouchstoneData class is based on `scikit-rf `_ package and allows advanced -touchstone post-processing. -The following methods allows to read and check touchstone files. - -.. currentmodule:: ansys.aedt.core.visualization.advanced.touchstone_parser - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - TouchstoneData.get_insertion_loss_index - TouchstoneData.plot_insertion_losses - TouchstoneData.plot - TouchstoneData.plot_return_losses - TouchstoneData.get_mixed_mode_touchstone_data - TouchstoneData.get_return_loss_index - TouchstoneData.get_insertion_loss_index_from_prefix - TouchstoneData.get_next_xtalk_index - TouchstoneData.get_fext_xtalk_index_from_prefix - TouchstoneData.plot_next_xtalk_losses - TouchstoneData.plot_fext_xtalk_losses - TouchstoneData.get_worst_curve - read_touchstone - check_touchstone_files - find_touchstone_files - - -Here an example on how to use TouchstoneData class. - -.. code:: python - - from ansys.aedt.core.visualization.advanced.touchstone_parser import TouchstoneData - - ts1 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1234.s8p")) - assert ts1.get_mixed_mode_touchstone_data() - ts2 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1324.s8p")) - assert ts2.get_mixed_mode_touchstone_data(port_ordering="1324") - - assert ts1.plot_insertion_losses(plot=False) - assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False) - - -Farfield -~~~~~~~~ - -PyAEDT offers sophisticated tools for advanced farfield post-processing. -There are two complementary classes: ``FfdSolutionDataExporter`` and ``FfdSolutionData``. - -- FfdSolutionDataExporter: Enables efficient export and manipulation of farfield data. It allows users to convert simulation results into a standard metadata format for further analysis, or reporting. - -- FfdSolutionData: Focuses on the direct access and processing of farfield solution data. It supports a comprehensive set of postprocessing operations, from visualizing radiation patterns to computing key performance metrics. - - -.. currentmodule:: ansys.aedt.core.visualization.advanced.farfield_visualization - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FfdSolutionData - - -This code shows how you can get the farfield data and perform some post-processing: - -.. code:: python - - import ansys.aedt.core - from ansys.aedt.core.generic.farfield_visualization import FfdSolutionDataExporter - app = ansys.aedt.core.Hfss() - ffdata = app.get_antenna_data(frequencies=None, - setup="Setup1 : Sweep", - sphere="3D", - variations=None, - overwrite=False, - link_to_hfss=True, - export_touchstone=True) - incident_power = ffdata.incident_power - ffdata.plot_cut(primary_sweep="Theta", theta=0) - ffdata.plot_contour(polar=True) - ffdata.plot_3d(show_geometry=False) - app.release_desktop(False, False) - -If you exported the farfield data previously, you can directly get the farfield data: - -.. code:: python - - from ansys.aedt.core.generic.farfield_visualization import FfdSolutionData - input_file = r"path_to_ffd\pyaedt_antenna_metadata.json" - ffdata = FfdSolutionData(input_file) - incident_power = ffdata.incident_power - ffdata.plot_cut(primary_sweep="Theta", theta=0) - ffdata.plot_contour(polar=True) - ffdata.plot_3d(show_geometry=False) - app.release_desktop(False, False) - -The following diagram shows both classes work. You can use them independently or from the ``get_antenna_data`` method. - - .. image:: ../../_static/farfield_visualization_pyaedt.png - :width: 800 - :alt: Farfield data with PyAEDT - - -If you have existing farfield data, or you want to export it manually, you can still use FfdSolutionData class. - - .. image:: ../../_static/farfield_visualization_aedt.png - :width: 800 - :alt: Farfield data with AEDT - - -Heterogeneous data message -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Heterogeneous data message (HDM) is the file exported from SBR+ solver containing rays information. -The following methods allows to read and plot rays information. - -.. currentmodule:: ansys.aedt.core.visualization.advanced - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - hdm_plot.HDMPlotter - sbrplus.hdm_parser.Parser - - -Miscellaneous -~~~~~~~~~~~~~ - -PyAEDT has additional advanced post-processing features: - -.. currentmodule:: ansys.aedt.core.visualization.advanced.misc - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - convert_nearfield_data - parse_rdat_file - nastran_to_stl - simplify_stl - diff --git a/doc/source/API/visualization/plot.rst b/doc/source/API/visualization/plot.rst deleted file mode 100644 index a00e71715c3..00000000000 --- a/doc/source/API/visualization/plot.rst +++ /dev/null @@ -1,79 +0,0 @@ -Graphics operations -=================== - -PyAEDT enables powerful post-processing of AEDT results, -allowing you to visualize graphics objects and plot data with ease. - -PyAEDT supports external report capabilities available with installed third-party -packages like `pyvista `_, `matplotlib `_, -`pandas `_, and `numpy `_. - - -There have three main categories: - -* **Three-dimensional visualization** -* **Graph visualization** -* **PDF** - - -Three-dimensional visualization -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -PyAEDT benefits of `pyvista `_ package and allows to generate -models and 3D plots. - -.. currentmodule:: ansys.aedt.core.visualization.plot.pyvista - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ModelPlotter - FieldClass - ObjClass - - -Graph visualization -~~~~~~~~~~~~~~~~~~~ - -PyAEDT benefits of `matplotlib `_ package and allows to generate 2D plots. - - -.. currentmodule:: ansys.aedt.core.visualization.plot.matplotlib - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ReportPlotter - is_notebook - - -PDF -~~~ - -PyAEDT benefits of `fpdf2 `_ package and allows to generate PDF files. - -.. currentmodule:: ansys.aedt.core.visualization.plot.pdf - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - AnsysReport.read_template - AnsysReport.header - AnsysReport.footer - AnsysReport.create - AnsysReport.add_project_info - AnsysReport.add_section - AnsysReport.add_chapter - AnsysReport.add_sub_chapter - AnsysReport.add_image - AnsysReport.add_caption - AnsysReport.add_empty_line - AnsysReport.add_page_break - AnsysReport.add_table - AnsysReport.add_text - AnsysReport.add_toc - AnsysReport.save_pdf - AnsysReport.add_chart diff --git a/doc/source/API/visualization/post.rst b/doc/source/API/visualization/post.rst deleted file mode 100644 index d8490fc6933..00000000000 --- a/doc/source/API/visualization/post.rst +++ /dev/null @@ -1,266 +0,0 @@ -AEDT post-processing -==================== - -AEDT offers a wide range of powerful post-processing tools for advanced data analysis and visualization. -PyAEDT provides dedicated classes that allow you to seamlessly interact with and modify these tools, expanding the scope of your data insights - - -.. note:: - Some functionalities are available only when AEDT is running - in graphical mode. - - -Core -~~~~ - -The following classes grant access to the core post-processing functionalities of AEDT: - -* **PostProcessor3D**: This class is utilized across all 3D applications, including HFSS, HFSS 3D Layout, Maxwell 3D and 2D, Q3D Extractor, and Mechanical AEDT. - -* **PostProcessorIcepak**: A specialized class for Icepak, which extends the ``PostProcessor3D`` class by adding features tailored to thermal analysis. - -* **PostProcessorCircuit**: This class handles schematic post-processing, supporting Circuit and Twin Builder applications. - - -.. currentmodule:: ansys.aedt.core.visualization.post.post_common_3d - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessor3D - -.. currentmodule:: ansys.aedt.core.visualization.post.post_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessorIcepak - -.. currentmodule:: ansys.aedt.core.visualization.post.post_circuit - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - PostProcessorCircuit - - -You can access these classes directly from the design object: - -.. code:: python - - from ansys.aedt.core import Hfss - app = Hfss(specified_version="2023.1", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - - # This call returns the PostProcessor class - post = app.post - - # This call returns a FieldPlot object - plotf = post.create_fieldplot_volume(objects, quantity_name, setup_name, intrinsics) - - # This call returns a SolutionData object - my_data = post.get_solution_data(expressions=trace_names) - - # This call returns a new standard report object and creates one or multiple reports from it. - standard_report = post.reports_by_category.standard("db(S(1,1))") - report_standard.create() - sols = report_standard.get_solution_data() - - -User can get the properties of the default reports using the following class: - -.. currentmodule:: ansys.aedt.core.visualization.post.common - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Reports - -.. code:: python - - from ansys.aedt.core import Hfss - from ansys.aedt.core.visualization.post.common import Reports - app = Hfss(specified_version="2024.2", - non_graphical=False, new_desktop_session=True, - close_on_exit=True, student_version=False) - reports = Reports(app.post, app.design_type) - app.release_desktop(False, False) - - -AEDT data is returned in a structured format, providing organized and detailed results. -For a comprehensive overview of the data structure and its capabilities, refer to the class definition below: - - -.. currentmodule:: ansys.aedt.core.visualization.post.solution_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SolutionData - - -Field -~~~~~ - -AEDT offers additional specialized post-processing features for enhanced 3D field visualization and control. - - -The following classes manage all aspects of AEDT 3D post-processing and are utilized by the ``PostProcessor3D`` class: - -.. currentmodule:: ansys.aedt.core.visualization.post.field_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldPlot - -.. code:: python - - from ansys.aedt.core import Hfss - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = app.post.create_fieldplot_line(quantity="Mag_E", assignment=p1.name) - report.create() - app.release_desktop(False, False) - - -Additionally, the following classes control field overlay settings, -enabling precise adjustments to visualization parameters: - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - ColorMapSettings - AutoScale - MinMaxScale - Scale3DSettings - NumberFormat - MarkerSettings - ArrowSettings - FolderPlotSettings - -The ``fields_calculator`` module includes the ``FieldsCalculator`` class. -It provides methods to interact with AEDT Fields Calculator by adding, loading and deleting custom expressions. - -.. currentmodule:: ansys.aedt.core.visualization.post.fields_calculator - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldsCalculator - - -HFSS -~~~~ - -For HFSS solutions, there are two additionally features: virtual ray tracing and farfield exporter. - -To define and control virtual ray tracing (VRT) you can use: - -.. currentmodule:: ansys.aedt.core.visualization.post.vrt_data - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VRTFieldPlot - - -If you need to export HFSS far field data, then you can use the following feature to obtain the antenna metadata: - -.. currentmodule:: ansys.aedt.core.visualization.post.farfield_exporter - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FfdSolutionDataExporter - -.. code:: python - - from ansys.aedt.core import Hfss - - app = Hfss() - - antenna_data = app.post.get_antenna_data() - app.release_desktop(False, False) - - -Icepak -~~~~~~ - -The ``monitor_icepak`` module includes the classes listed below to add, modify, and manage monitors during simulations. -Retrieve monitor values for post-processing and analysis to gain insights into key simulation metrics. -Methods and properties are accessible through the ``monitor`` property of the ``Icepak`` class. - -.. currentmodule:: ansys.aedt.core.visualization.post.monitor_icepak - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - Monitor - - -The ``field_summary`` module includes the classes listed below to the ``Icepak`` field summary. - -.. currentmodule:: ansys.aedt.core.visualization.post.field_summary - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - FieldSummary - - -Additional tools -~~~~~~~~~~~~~~~~ - -Finally, users can use additional AEDT postprocessing tools like SPiSim: - -.. currentmodule:: ansys.aedt.core.visualization.post.spisim - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - SpiSim - - -.. currentmodule:: ansys.aedt.core.visualization.post.spisim_com_configuration_files.com_parameters - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - COMParameters - COMParametersVer3p4 - - -If you are looking for Virtual Compliance post processing, you should use this set of features: - -.. currentmodule:: ansys.aedt.core.visualization.post.compliance - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - VirtualComplianceGenerator - VirtualCompliance \ No newline at end of file diff --git a/doc/source/API/visualization/report.rst b/doc/source/API/visualization/report.rst deleted file mode 100644 index d922cd08990..00000000000 --- a/doc/source/API/visualization/report.rst +++ /dev/null @@ -1,81 +0,0 @@ -Report management -================= - -AEDT provides extensive flexibility for generating reports. - - -PyAEDT includes dedicated classes to manipulate all report properties, -offering full control over report customization. - -.. note:: - Some functionalities are available only when AEDT is running - in graphical mode. - - -.. currentmodule:: ansys.aedt.core.visualization.report - -.. autosummary:: - :toctree: _autosummary - :nosignatures: - - standard.Standard - standard.Spectral - field.AntennaParameters - field.Fields - field.NearField - field.FarField - field.Emission - eye.EyeDiagram - eye.AMIConturEyeDiagram - eye.AMIEyeDiagram - emi.EMIReceiver - - -The following code shows how to use report modules in standalone mode. - -.. code:: python - - # Create `Mag_E` report in a polyline - - from ansys.aedt.core import Hfss - from ansys.aedt.core.visualization.report.field import Fields - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = Fields(app=app, report_category="Fields", - setup_name=setup.name + " : LastAdaptive", - expressions="Mag_E") - report.polyline = p1.name - report.create() - - app.release_desktop(False, False) - - -You can use these classes directly from the application object: - -.. code:: python - - # Create `Mag_E` report in a polyline - - from ansys.aedt.core import Hfss - - app = Hfss(specified_version="2024.2", - non_graphical=False, - new_desktop_session=False - ) - test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], - ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] - p1 = app.modeler.create_polyline(test_points) - setup = app.create_setup() - - report = app.post.reports_by_category.fields("Mag_E", setup.name + " : LastAdaptive", p1.name) - report.create() - - app.release_desktop(False, False) diff --git a/doc/source/Getting_started/About.rst b/doc/source/Getting_started/About.rst deleted file mode 100644 index 5f42b245b34..00000000000 --- a/doc/source/Getting_started/About.rst +++ /dev/null @@ -1,86 +0,0 @@ -About PyAnsys and AEDT -====================== - -PyAnsys -------- - -PyAEDT is part of the larger `PyAnsys `_ -effort to facilitate the use of Ansys technologies directly from Python. - -PyAEDT is intended to consolidate and extend all existing -functionalities around scripting for AEDT to allow reuse of existing code, -sharing of best practices, and increased collaboration. - - -About AEDT ----------- - -`AEDT `_ is a platform that enables true -electronics system design. AEDT provides access to the Ansys gold-standard -electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell, -Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. - -In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid, -and mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_collage.jpg - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - - -PyAEDT is licensed under the `MIT License -`_. - -PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products: - -- HFSS and HFSS 3D Layout -- Icepak -- Maxwell 2D, Maxwell 3D, and RMXprt -- 2D Extractor and Q3D Extractor -- Mechanical -- Nexxim -- EDB -- Twin Builder - - -Dependencies ------------- -To run PyAEDT, you must have a local licensed copy of AEDT. -PyAEDT supports AEDT versions 2022 R2 and later. - -Student version ---------------- - -PyAEDT supports AEDT Student versions 2022 R2 and later. For more information, see the -`Ansys Electronics Desktop Student - Free Software Download `_ page on the Ansys website. - - -Why PyAEDT? ------------ -A quick and easy approach for automating a simple operation in the -AEDT UI is to record and reuse a script. However, here are some disadvantages of -this approach: - -- Recorded code is dirty and difficult to read and understand. -- Recorded scripts are difficult to reuse and adapt. -- Complex coding is required by many global users of AEDT. - -Here are the main advantages that PyAEDT provides: - -- Automatic initialization of all AEDT objects, such as desktop - objects like the editor, boundaries, and more -- Error management -- Log management -- Variable management -- Compatibility with IronPython (limited) and CPython -- Simplification of complex API syntax using data objects while - maintaining PEP8 compliance. -- Code reusability across different solvers -- Clear documentation on functions and API -- Unit tests of code to increase quality across different AEDT versions - diff --git a/doc/source/Getting_started/ClientServer.rst b/doc/source/Getting_started/ClientServer.rst deleted file mode 100644 index 712a1bb6cb9..00000000000 --- a/doc/source/Getting_started/ClientServer.rst +++ /dev/null @@ -1,93 +0,0 @@ -Client-server -============= -You can launch PyAEDT on a remote machine if these conditions are met: - -- AEDT and PyAEDT is installed on client and server machines. -- The same Python version is used on the client and server machines. (CPython 3.8+ - is embedded in the AEDT installation.) - -gRPC connection in AEDT 2022 R2 and later -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In AEDT 2022 R2 and later, PyAEDT fully supports the gRPC API (except for EDB): - -.. code:: python - - # Launch the latest installed version of AEDT in graphical mode. - from ansys.aedt.core import Hfss - from ansys.aedt.core import settings - settings.use_grpc_api=True - hfss = Hfss(machine="fullmachinename", port=portnumber) - -If the ``machine`` argument is provided and the machine is a remote machine, AEDT -must be up and running on the remote server listening on the specified port ``portnumber``. - -To start AEDT in listening mode on the remote machine: - -.. code:: - - path/to/ANSYSEM/v222/Win64/ansysedt.exe -grpcsrv portnumber #windows - path/to/ANSYSEM/v222/Lin64/ansysedt -grpcsrv portnumber #linux - -If the connection is local, the ``machine`` argument must be left empty. PyAEDT then -starts the AEDT session automatically. Machine and port arguments are available to -all applications except EDB. - - -PyAEDT remote service manager -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PyAEDT includes a service manager that can be run on the server machine and can be -launched on-demand in AEDT sessions and act as a file manager. -You can make a remote application call on a CPython server -or any Windows client machine in AEDT 2022 R2 and later. - -On a CPython Server run the ``pyaedt_service_manager`` service that listens on port 17878 -for incoming requests of connections from clients. The port is configurable. -Requirements: - -- Python 3.8+ Virtual Environment. -- pyaedt > 0.6.0 - -On Linux, in addition to the preceding requirements, these environments are needed: -- You can use the CPython version in the AEDT installation folder if you first -add the Python library folder to the ``LD_LIBRARY_PATH`` environment variable. -- You can use the Python 3.8 or later version that is installed. -- You can export ``ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64``. -- You can export ``LD_LIBRARY_PATH=$ANSYSEM_ROOT242/common/mono/Linux64/lib:$ANSYSEM_ROOT242/Delcross:$LD_LIBRARY_PATH``. - -On the server, the ``pyaedt_service_manager`` service listen for incoming connections: - -.. code:: python - - # Launch PyAEDT remote server on CPython - from ansys.aedt.core.common_rpc import pyaedt_service_manager - pyaedt_service_manager() - - -On any client machine, the user must establish the connection as shown in following example. -AEDT can be launched directly while creating the session or after the connection is established. - -.. code:: python - - from ansys.aedt.core.common_rpc import create_session - # User can establish the connection and start a new AEDT session - cl1 = create_session("server_name", launch_aedt_on_server=True, aedt_port=17880, non_graphical=True) - - # Optionally AEDT can be launched after the connection is established - cl2 = create_session("server_name", launch_aedt_on_server=False) - cl2.aedt(port=17880, non_graphical=True) - - -Once AEDT is started then user can connect an application to it. - -.. code:: python - - hfss = Hfss(machine=cl1.server_name, port=cl1.aedt_port) - # your code here - -The client can be used also to upload or download files from the server. - -.. code:: python - - cl1.filemanager.upload(local_path, remote_path) - file_content = cl1.open_file(remote_file) - diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst deleted file mode 100644 index b62237fa983..00000000000 --- a/doc/source/Getting_started/Contributing.rst +++ /dev/null @@ -1,206 +0,0 @@ -.. _contributing_aedt: - -========== -Contribute -========== -Overall guidance on contributing to a PyAnsys repository appears in -`Contribute `_ -in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar -with this guide, paying particular attention to `Guidelines and Best Practices -`_, before attempting -to contribute to PyAEDT. - -The following contribution information is specific to PyAEDT. - -Clone the repository --------------------- -To clone and install the latest version of PyAEDT in -development mode, run: - -.. code:: - - git clone https://github.com/ansys/pyaedt - cd pyaedt - python -m pip install --upgrade pip - pip install -e . - -Post issues ------------ -Use the `PyAEDT Issues `_ -page to submit questions, report bugs, and request new features. - -To reach the product support team, email `pyansys.core@ansys.com `_. - -View PyAEDT documentation -------------------------- -Documentation for the latest stable release of PyAEDT is hosted at -`PyAEDT Documentation `_. - -In the upper right corner of the documentation's title bar, there is an option -for switching from viewing the documentation for the latest stable release -to viewing the documentation for the development version or previously -released versions. - -Code style ----------- -PyAEDT complies with the `PyAnsys code style -`_. -`pre-commit `_ is applied within the CI/CD to ensure compliance. -The ``pre-commit`` Python package can be installed -and run as follows: - -.. code:: bash - - pip install pre-commit - pre-commit run --all-files - -You can also install this as a pre-commit hook with: - -.. code:: bash - - pre-commit install - -This way, it's not possible for you to push code that fails the style checks. -For example:: - - $ pre-commit install - $ git commit -am "Add my cool feature." - black....................................................................Passed - isort (python)...........................................................Passed - flake8...................................................................Passed - codespell................................................................Passed - debug statements (python)................................................Passed - trim trailing whitespace.................................................Passed - Validate GitHub Workflows................................................Passed - blacken-docs.............................................................Passed - -Naming conventions -~~~~~~~~~~~~~~~~~~ -Consistency of names helps improve readability and -ease of use. Starting with release 0.8 a concerted effort -has been made to -improve consistency of naming and adherence to -:ref:`PEP-8`_. - -For example, methods used to create or access entities in -AEDT require that a name be passed to the method or function -as an argument. -It is tempting to -include context as part of that variable name. For example, while it is tempting to use -``setupname`` -as an argument to :meth:`Hfss.create_setup`_, -the context "setup" is -explicitly defined by the method name. The variable ``name`` provides -a more compact -description of the variable in this context. - -In previous PyAEDT versions, you can also find both ``setup_name`` and ``setupname`` used -for various methods or classes. -Improving naming consistency improves maintainability and readability. - -The following table illustrates the recommended conventions: - -.. list-table:: Keywords and object names - :widths: 25 25 50 - :header-rows: 1 - - * - Old name - - New name - - Example - * - ``setupname``, ``setup_name``, ``sweepname`` - - ``name`` - - ``Hfss.create_setup()``, ``Hfss.create_linear_step_sweep()`` - * - ``usethickness`` - - ``thickness`` - - ``Hfss.assign_coating()`` - * - ``entities`` - - ``assignment`` - - ``Maxwell.assign_current_density()`` - * - ``entity_list`` - - ``assignment`` - - ``Maxwell.assign_symmetry()`` - -Take care to use descriptive names for -variables and classes that adhere to PEP-8 and are consistent with conventions already -used in PyAEDT. - -Log errors -~~~~~~~~~~ -PyAEDT has an internal logging tool named ``Messenger`` -and a log file that is automatically generated in the project -folder. - -The following examples demonstrate how ``Messenger`` is used to -write both to the internal AEDT message windows and the log file: - -.. code:: python - - self.logger.error("This is an error message.") - self.logger.warning("This is a warning message.") - self.logger.info("This is an info message.") - -These examples demonstrate how to write messages only to the log file: - -.. code:: python - - self.logger.error("This is an error message.") - self.logger.warning("This is a warning message.") - self.logger.info("This is an info message.") - - -Handle exceptions -~~~~~~~~~~~~~~~~~ -PyAEDT uses a specific decorator, ``@pyaedt_function_handler``, -to handle exceptions caused by methods and by the AEDT API. -This exception handler decorator makes PyAEDT fault tolerant -to errors that can occur in any method. - -For example: - -.. code:: python - - @pyaedt_function_handler() - def my_method(self, var): - pass - -Every method can return a value of ``True`` when successful or -``False`` when failed. When a failure occurs, the error -handler returns information about the error in both the console and -log file. - -Here is an example of an error: - -.. code:: - - ---------------------------------------------------------------------------------- - PyAEDT error on method create_box: General or AEDT error. Check again - the arguments provided: - position = [0, 0, 0] - dimensions_list = [0, 10, 10] - name = None - material = None - ---------------------------------------------------------------------------------- - - (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147024381), None) - File "C:\GIT\repos\AnsysAutomation\PyAEDT\Primitives.py", line 1930, in create_box - o.name = self.oeditor.createbox(vArg1, vArg2) - - ************************************************************ - Method Docstring: - - Create a box. - - Parameters - ---------- - ... - - -Hard-coded values -~~~~~~~~~~~~~~~~~~ -Do not write hard-coded values to the registry. Instead, use the Configuration service. - -Maximum line length -~~~~~~~~~~~~~~~~~~~ -Best practice is to keep the length at or below 120 characters for code, -and comments. Lines longer than this might not display properly on some terminals -and tools or might be difficult to follow. diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst deleted file mode 100644 index ff37cae9cc9..00000000000 --- a/doc/source/Getting_started/Installation.rst +++ /dev/null @@ -1,197 +0,0 @@ -Installation -============ -PyAEDT consolidates and extends all existing capital around scripting for AEDT, -allowing re-use of existing code, sharing of best practices, and collaboration. - -This PyAnsys library has been tested on HFSS, Icepak, and Maxwell 3D. It also provides -basic support for EDB and Circuit (Nexxim). - -Requirements -~~~~~~~~~~~~ -In addition to the runtime dependencies listed in the installation information, PyAEDT -requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Version is also supported. - - -Install from PyAEDT installer -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following python script automatically installs PyAEDT from AEDT, -using the CPython interpreter included in the AEDT installation. - -In order to do that you can: - -- Download the following file: :download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>` - -- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. - -- Offline install is also possible using wheelhouses. - -.. note:: - A wheelhouse is a zip containing all needed packages that can be installed offline. - PyAEDT wheelhouse can be found at `Releases `_. - After downloading the wheelhouse zip specific for your distribution and Python release, - run the script from Electronics Desktop using the zip full path as argument. - Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2 - and higher requires the Python 3.10 wheelhouse. - -.. image:: ../Resources/wheelhouse_installation.png - :width: 800 - :alt: PyAEDT run script - -Starting from 2023R2, buttons are available in the Automation Tab as in the example below. - -.. image:: ../Resources/toolkits_ribbon.png - :width: 800 - :alt: PyAEDT toolkit buttons available in AEDT - - -Extension manager -~~~~~~~~~~~~~~~~~ -The user can install or uninstall automated workflows using the extension manager. -There are three options: - -- **Pre-installed extensions** already available in the PyAEDT library. - -- **Open source PyAEDT toolkits** described in the `PyAEDT Common Toolkit documentation `_. - -- **Custom PyAEDT extensions**. - -See `Extension Manager `_ for more information. - -.. image:: ../Resources/toolkit_manager_1.png - :width: 800 - :alt: PyAEDT toolkit manager 1 - -The user can select the AEDT application to install the specific workflow. - -.. image:: ../Resources/toolkit_manager_2.png - :width: 400 - :alt: PyAEDT toolkit manager 2 - -For additional information about AEDT extensions, -see `Extensions `_. - - -Install on CPython from PyPI -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can install PyAEDT on CPython from PyPI: - -.. code:: python - - pip install pyaedt - -You can also install PyAEDT from Conda-Forge: - -.. code:: python - - conda install -c conda-forge pyaedt - -To ensure you have all the necessary dependencies, including optional components, use the following command: - -.. code:: python - - pip install pyaedt[all] - -If you are not utilizing gRPC, you can install the required dotnet dependencies separately: - -.. code:: python - - pip install pyaedt[dotnet] - -If you want to install the PyAEDT panels in the AEDT Automation tab, use the following command: - -.. code:: python - - pip install pyaedt[installer] - -Finally, in the python console, run the following commands: - -.. code:: - - from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt - add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") - -You can also install the PyAEDT panels using the following steps, this is also useful if you have a centralized PyAEDT installation: - -- Download the following file: :download:`PyAEDT panel Installer Python file <../Resources/toolkit_installer_from_aedt.py>` - -- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the python interpreter in which PyAEDT is installed. - -- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. You do not need the previous step if -you pass as an argument the path of the python interpreter. - - -Linux support -~~~~~~~~~~~~~ - -PyAEDT works with CPython 3.8 through 3.12 on Linux in AEDT 2022 R2 and later. -However, you must set up the following environment variables: - -.. code:: - - export ANSYSEM_ROOT222=/path/to/AedtRoot/AnsysEM/v222/Linux64 - export LD_LIBRARY_PATH=$ANSYSEM_ROOT222/common/mono/Linux64/lib64:$ANSYSEM_ROOT222/Delcross:$LD_LIBRARY_PATH - - -Install offline from a wheelhouse -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Using a wheelhouse can be helpful if you work for a company that restricts access to external networks. - -Wheelhouses for CPython 3.8, 3.9, 3.10, 3.11, and 3.12 are available in the releases for both Windows and Linux. -From the `Releases `_ -page in the PyAEDT repository, you can find the wheelhouses for a particular release in its -assets and download the wheelhouse specific to your setup. - -There are two kind of wheelhouses: `all` and `installer`. - -The `all` wheelhouse contains all PyAEDT dependencies. And the `installer` one includes `ipython` and `jupyter lab`. - -You can then install PyAEDT and all of its dependencies from one single entry point that can be shared internally, -which eases the security review of the PyAEDT package content. - -For example, on Windows with Python 3.10, install PyAEDT and all its dependencies from a wheelhouse with code like this: - -.. code:: - - pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[all] - -If you want to add the PyAEDT panels in the AEDT Automation tab, you need first to install the installer dependencies: - -.. code:: - - pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[installer] - -Finally, in the python console, run the following commands: - -.. code:: - - from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt - add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") - - -Install PyAEDT in Conda virtual environment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Create virtual environment - -.. code:: bash - - conda create --name pyaedt_py310 python=3.10 - -Activate virtual environment - -.. code:: bash - - conda activate pyaedt_py310 - -You can also install PyAEDT from Conda-Forge with this command: - -.. code:: bash - - conda install -c conda-forge pyaedt - - -Upgrade PyAEDT to the latest version -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code:: bash - - pip install -U pyaedt diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst deleted file mode 100644 index 1d62085640f..00000000000 --- a/doc/source/Getting_started/Troubleshooting.rst +++ /dev/null @@ -1,201 +0,0 @@ -Troubleshooting -=============== -This section contains common issues and suggestions related to installation and use of PyAEDT. - -Installation -~~~~~~~~~~~~ - -Error installing Python or Conda --------------------------------- -Sometimes companies do not allow installation of a Python interpreter. -In this case, you can use the Python interpreter available in the AEDT installation. - -.. note:: - - Python 3.7 is available in AEDT 2023 R1 and earlier. Python 3.10 is available in AEDT 2023 R2. - -Here is the path to the Python 3.10 interpreter for the 2024 R2 installation: - -.. code:: python - - path\to\AnsysEM\v242\commonfiles\CPython\3_10\winx64\Release\python" - - -Error installing PyAEDT using pip ---------------------------------- -- **Proxy server**: If your company uses a proxy server, you may have to update proxy - settings at the command line. For more information, see the `Using a Proxy - Server `_ in the pip - documentation. -- **Install permission**: Make sure that you have write access to the directory where the - Python interpreter is - installed. The use of a `virtual environment `_ helps - mitigate this issue by placing the Python interpreter and dependencies in a location that is owned - by the user. -- **Firewall**: Some corporate firewalls may block pip. If you face this issue, you'll have to work with your IT - administrator to enable pip. The proxy server settings (described earlier) allow you to explicitly define - the ports used by pip. - -If downloads from `pypi `_ are not allowed, you may use a -`wheelhouse `_. -The wheelhouse file contains all dependencies for PyAEDT and allows full installation without a need to -download additional files. -The wheelhouse for PyAEDT can be found `here `_. -After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and -run the Python command: - -.. code:: python - - >>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyaedt - - -Another option to install PyAEDT from the wheelhouse is to download the following file -:download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>`. -Run this script directly from AEDT and pass the wheelhouse file name as an argument. - - - - -Run PyAEDT -~~~~~~~~~~ - -COM and gRPC ------------- -Prior to the 2022 R2 release, CPython automation in AEDT used -`COM `_ , which -requires all interfaces to be registered in the Windows Registry. -Communication between Python and the AEDT API were translated through an intermediate layer using -`pywin32 `_ and `PythonNET `_. - -`gRPC `_ is a modern open source high performance Remote Procedure Call (RPC) -framework that can run in any environment and supports client/server remote calls. -Starting from 2022R2 the AEDT API has replaced the COM interface with a gRPC interface. - - -.. list-table:: *gRPC Compatibility:* - :widths: 65 65 65 - :header-rows: 1 - - * - < 2022 R2 - - 2022 R2 - - > 2022 R2 - * - Only ``Python.NET`` - - | ``Python.NET``: *Default* - | Enable gRPC: ``ansys.aedt.core.settings.use_grpc_api = True`` - - | gRPC: *Default* - | Enable ``Python.NET``: ``ansys.aedt.core.settings.use_grpc_api = False`` - -The options shown here apply only to the Windows platform. -On Linux, the Python interface to AEDT uses gRPC for all versions. - -.. _GRPC ref: - -Check the AEDT API configuration --------------------------------- -Run the following command to start AEDT as a gRPC server: - -*Windows:* - -.. code:: console - - path\to\AnsysEM\v231\Win64\ansysedt.exe -grpcsrv 50001 - -**On Linux:** - -.. code:: console - - path\to\AnsysEM\v231\Lin64\ansysedt -grpcsrv 50352 - -The server port number is used by AEDT to listen and receive -commands from the PyAEDT client. This configuration -supports multiple sessions of AEDT running on a single server -and listening on the same port. - -Check the gRPC interface ------------------------- -The native Electronics Desktop API can be used to launch -AEDT from the command line. -PyAEDT is not required to verify the setup for the server and ensure that -all environment -variables have been defined correctly. - -.. code:: python - - import sys - sys.path.append(r"ANSYSEM_ROOT231\PythonFiles\DesktopPlugin") - import ScriptEnv - print(dir()) - ScriptEnv.Initialize("", False, "", 50051) - print(dir()) - - - -Failure connecting to the gRPC server -------------------------------------- -On Linux, PyAEDT may fail to initialize a new instance of the gRPC server -or connect to an existing server session. -This may be due to: - -- Firewall -- Proxy -- Permissions -- License -- Scheduler (for example if the gRPC server was started from LSF or Slurm) - -For issues related to use of a proxy server, you may set the following environment variable to -disable the proxy server for the *localhost*. - -.. code:: console - - export no_proxy=localhost,127.0.0.1 - -Run your PyAEDT script. - -If it still fails, you can disable the proxy server: - -.. code:: console - - export http_proxy= - -Run your PyAEDT script. If the errors persist, perform these steps: - -1. Check that AEDT starts correctly from the command line by - starting the :ref:`gRPC server`. -2. Enable debugging. - -.. code:: console - - export ANSOFT_DEBUG_LOG=/tmp/testlogs/logs/lg - export ANSOFT_DEBUG_LOG_SEPARATE=1 - export ANSOFT_DEBUG_LOG_TIMESTAMP=1 - export ANSOFT_DEBUG_LOG_THREAD_ID=1 - export ANSOFT_DEBUG_MODE=3 - - -Enable the gRPC trace on the server: - -.. code:: console - - export GRPC_VERBOSITY=DEBUG - export GRPC_TRACE=all - -Then run ansysedt.exe as a gRPC server and redirect the output. - -.. code:: console - - ansysedt -grpcsrv 50051 > /path/to/file/server.txt - -The preceding command redirects the gRPC trace -to the file ``server.txt``. - -Open another terminal window to trace the -gRPC calls on the client where the Python script is to be run. - -.. code:: console - - export GRPC_VERBOSITY=DEBUG - export GRPC_TRACE=all - -Now run the PyAEDT script, (making sure it connects to the same port as the gRPC server - 50051). -Capture the output in a file. For example *client.txt*. Then send all the logs -to `Ansys Support `_. diff --git a/doc/source/Getting_started/index.rst b/doc/source/Getting_started/index.rst deleted file mode 100644 index a981d1a5f83..00000000000 --- a/doc/source/Getting_started/index.rst +++ /dev/null @@ -1,132 +0,0 @@ -Getting started -=============== - -.. grid:: 2 - - .. grid-item-card:: About PyAnsys and AEDT - :link: About - :link-type: doc - :margin: 2 2 0 0 - - Learn more about PyAnsys and AEDT. - - .. grid-item-card:: Installation - :link: Installation - :link-type: doc - :margin: 2 2 0 0 - - Learn how to install PyAEDT from PyPi or Conda. - - .. grid-item-card:: User guide - :link: ../User_guide/index - :link-type: doc - :margin: 2 2 0 0 - - This section provides in-depth information on PyAEDT key concepts. - - .. grid-item-card:: Client-Server - :link: ClientServer - :link-type: doc - :margin: 2 2 0 0 - - Launch PyAEDT on a client machine and control Electronics Desktop - on a remote server. - - .. grid-item-card:: Versions and interfaces - :link: versioning - :link-type: doc - :margin: 2 2 0 0 - - Discover the compatibility between PyAEDT and Ansys AEDT versions. - - .. grid-item-card:: Troubleshooting - :link: Troubleshooting - :link-type: doc - :margin: 2 2 0 0 - - Any questions? Refer to Q&A before submitting an issue. - - -What is PyAEDT? ---------------- -PyAEDT is a Python library that interacts directly with the API for -Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture -for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, -and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides -support for Circuit tools like Nexxim and system simulation tools like -Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout -tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures -simplify operation while reusing information as much as possible across -the API. - -To run PyAEDT, you must have a licensed copy of Ansys Electronics -Desktop (AEDT) installed. - -The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. -`AEDT `_ provides access to the Ansys gold-standard -electro-magnetics simulation solutions such as Ansys HFSS, -Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and -Mechanical CAD (MCAD) workflows. -In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, -and Mechanical solvers for comprehensive multiphysics analysis. -Tight integration among these solutions provides unprecedented ease of use for setup and -faster resolution of complex simulations for design and optimization. - -.. image:: ../Resources/aedt_3.png - :width: 800 - :alt: AEDT Applications - :target: https://www.ansys.com/products/electronics - -For more information, see `Ansys Electronics `_ -on the Ansys website. - -PyAEDT cheat sheets -------------------- - -PyAEDT cheat sheets introduce the basics that you need to use PyAEDT. -These one-page references providing syntax rules and commands -for using PyAEDT API and EDB API: - -**PyAEDT cheat sheet:** `PyAEDT API `_ - -**EDB cheat sheet:** `EDB API `_ - - -Get help --------- - -**Development issues:** For PyAEDT development-related matters, see the -`PyAEDT Issues `_ page. -You can create issues to report bugs and request new features. - -**User questions:** The best way to get help is to post your question on the `PyAEDT Discussions -`_ page or the `Discussions `_ -page on the Ansys Developer portal. You can post questions, share ideas, and get community feedback. - - -License -------- -PyAEDT is licensed under the MIT license. - -PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the -functionality of AEDT by adding a Python interface to AEDT without changing the -core behavior or license of the original software. The use of PyAEDT requires a -legally licensed local copy of AEDT. - -To get a copy of AEDT, see the `Ansys Electronics `_ -page on the Ansys website. - - - -.. toctree:: - :hidden: - :maxdepth: 2 - - Installation - Troubleshooting - ../User_guide/index - ClientServer - versioning - Contributing - About - diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst deleted file mode 100644 index f0c872ffa64..00000000000 --- a/doc/source/Getting_started/versioning.rst +++ /dev/null @@ -1,78 +0,0 @@ -.. _versions_and_interfaces: - -======================= -Versions and interfaces -======================= - -The PyAEDT project attempts to maintain compatibility with legacy -versions of AEDT while allowing for support of faster and better -interfaces with the latest versions of AEDT. - -There are two interfaces PyAEDT can use to connect to AEDT. -You can see a table with the AEDT version and the supported interfaces -in `Table of supported versions `_ - - -gRPC interface -============== - -This is the default and preferred interface to connect to AEDT. -Ansys 2022 R2 and later support the latest gRPC interface, allowing -for remote management of AEDT with rapid streaming of mesh, results, -and files from the AEDT service. - - -Legacy interfaces -================= - -COM interface --------------- - -AnsysEM supports the legacy COM interface, enabled with the settings option. - -This interface works only on Windows and uses .NET COM objects. - - -.. code:: python - - - from ansys.aedt.core import settings - - settings.use_grpc_api = False - - - -Compatibility between AEDT and interfaces -========================================= - -The following table shows the supported versions of Ansys EDT and the recommended interface for each one of them in PyAEDT. - - -**Table of supported versions** - -.. _table_versions: - -+---------------------------+------------------------+-----------------------------------------------+ -| Ansys Version | Recommended interface | Support | -| | +-----------------------+-----------------------+ -| | | gRPC | COM | -+===========================+========================+=======================+=======================+ -| AnsysEM 2024 R1 | gRPC | YES | NO* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R2 | gRPC | YES | YES* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R1 | gRPC | YES | YES* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R2 | gRPC | YES* | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R1 | gRPC | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2021 R2 | gRPC | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ - -Where: - -* YES means that the interface is supported and recommended. -* YES* means that the interface is supported, but not recommended. Their support might be dropped in the future. -* NO means that the interface is not supported. -* NO* means that the interface is still supported but it is deprecated. diff --git a/doc/source/index.rst b/doc/source/index.rst index 32528e3a1a9..746275cd105 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,32 +24,12 @@ enabling straightforward and efficient automation in your workflow. .. grid:: 2 - .. grid-item-card:: Getting started :fa:`person-running` - :link: Getting_started/index - :link-type: doc - - New to PyAEDT? This section provides the information that you need to get started with PyAEDT. - .. grid-item-card:: User guide :fa:`book-open-reader` :link: User_guide/index :link-type: doc This section provides in-depth information on PyAEDT key concepts. -.. grid:: 2 - - .. grid-item-card:: API reference :fa:`book-bookmark` - :link: API/index - :link-type: doc - - This section contains descriptions of the functions and modules included in PyAEDT. - It describes how the methods work and the parameters that can be used. - - .. grid-item-card:: Examples :fa:`scroll` - :link: https://examples.aedt.docs.pyansys.com/ - - Explore examples that show how to use PyAEDT to perform different types of simulations. - .. grid:: 2 .. grid-item-card:: Contribute :fa:`people-group` @@ -63,7 +43,5 @@ enabling straightforward and efficient automation in your workflow. :hidden: - Getting_started/index User_guide/index - API/index Examples From 7b973edf7c1edeef023726b6ceebe48e8fd77c5d Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 15 Nov 2024 16:16:51 +0100 Subject: [PATCH 5/8] DOCS: Update cheat sheet --- doc/source/cheatsheet/cheat_sheet.qmd | 150 ++++++++++++++++++++++++-- 1 file changed, 139 insertions(+), 11 deletions(-) diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd index add51075ad5..211652d17b2 100644 --- a/doc/source/cheatsheet/cheat_sheet.qmd +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -35,22 +35,150 @@ jupyter: # Launch PyAEDT -## Launch an HFSS instance locally +Open a Desktop session and run HFSS +```{python} +#| eval: false +from ansys.aedt.core import Desktop, Hfss +desktop = Desktop(version="2024.2", close_on_exit=True) +hfss = Hfss(new_desktop=False, project="project_name", design="design_name") +``` + +Connect to a running application with given project name and design name +```{python} +#| eval: false +from ansys.aedt.core.generic.design_types import get_pyaedt_app +app = get_pyaedt_app(project_name="project_name", design="design_name") +``` + +Launch an application directly ```{python} #| eval: false from ansys.aedt.core import Hfss -hfss = Hfss( - version='2024.2', - new_desktop=True, - close_on_exit=True, - non_graphical=False, - project="project_name", - design="design_name" -) +# Run the application in non graphical mode +hfss = Hfss(non_graphical=True, project="project_name", design="design_name") +``` + +# Close the active AEDT session +```{python} +#| eval: false +hfss.release_desktop(close_projects=True, close_on_exit=True) +``` + +# Work with variables +Create a variable that only applies to this design: +```{python} +#| eval: false +hfss["dim"] = "1mm" +``` +Create a variable that applies at a project level: +```{python} +#| eval: false +hfss["$dim"] = "1mm" +``` +Manage your variables: +```{python} +#| eval: false +hfss.variable_manager.variables +``` + +# Handle your materials +Add a new material with custom properties: +```{python} +#| eval: false +material = hfss.materials.add_material("my_mat") +material.permittivity = 3.5 +material.conductivity = 450000 +material.permeability = 1.5 +``` + +# Create and manipulate your geometry +Create a box from an anchor and edge sizes: +```{python} +#| eval: false +box = hfss.modeler.create_box([1,1,1], [5,2,5], name="box", material="FR4_epoxy") +rectangle = hfss.modeler.create_rectangle([1,1,1], [5,2], name="rectangle", material="Copper") +``` + +Access edges or vertices data: +```{python} +#| eval: false +nb_edges = len(box.edges) +for edge in box.edges: + print(edge.segment_info) +nb_vertices = len(box.vertices) +for vertex in box.vertices: + print(vertex.position) ``` -## Exit your local instance: +# Define the solution setup +```{python} +#| eval: false +setup = hfss.create_setup("MySetup") +setup.props["Frequency"] = "50MHz" +setup["MaximumPasses"] = 10 +hfss.create_linear_count_sweep("my_setup", "MHz", 0.1, 100, num_of_freq_points=100, name="sweep1", sweep_type="Interpolating", save_fields=False) +``` +Access the parametric sweep: ```{python} #| eval: false -hfss.release_desktop() +hfss.parametrics +``` +Access the optimizations: +```{python} +#| eval: false +hfss.optimizations +``` +Analyze the solution setup +```{python} +#| eval: false +hfss.analyze(cores=4) +``` + + +# Post processing +Post processing can be performed within and outside AEDT. + +## Report in AEDT +Create "Mag_E" report in a polyline: +```{python} +#| eval: false +test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] +p1 = hfss.modeler.create_polyline(test_points) +report = hfss.post.reports_by_category.fields( + "Mag_E", setup.name + " : LastAdaptive", p1.name) +report.create() +``` + +## Graphic operations +Visualize graphics objects and plot data within AEDT +```{python} +#| eval: false +field_plot = hfss.post.create_fieldplot_volume( + ["box"], "Mag_E") +image_path = field_plot.export_image( + r"C:\\workdir\\my_image.png") +``` +Generate 2D/3D plots or PDF files using third-party packages +```{python} +#| eval: false +# Plot the box +hfss.post.plot_model_obj(objects=["box"], show_grid=True) + +# Plot solution data +plot_data = hfss.get_traces_for_plot() +report = hfss.post.create_report(plot_data) +solution = report.get_solution_data() +plt = solution.plot(solution.expressions) + +# Save postprocessing output in PDF file +from ansys.aedt.core.visualization.plot.pdf import AnsysReport +pdf_report = AnsysReport( + project_name=hfss.project_name, + design_name=hfss.design_name) +pdf_report.create() +pdf_report.add_section() +pdf_report.add_chapter("HFSS Results") +pdf_report.add_text("This section contains plots.") +pdf_report.add_image(image_path) +pdf_report.save_pdf(file_path=r"C:\\workdir", file_name="report.pdf") ``` From 4d007e0b17d4ef918f2760a3324263331abf5cac Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 15 Nov 2024 16:17:02 +0100 Subject: [PATCH 6/8] Revert "TBR: Temporary files removal" This reverts commit 45ea0eea0fd55d612bd7568e3c0f17db40feb30f. --- doc/source/API/Application.rst | 70 +++++ doc/source/API/Boundaries.rst | 77 +++++ doc/source/API/CableModeling.rst | 132 +++++++++ doc/source/API/Configuration.rst | 52 ++++ doc/source/API/Constants.rst | 21 ++ doc/source/API/DesktopMessenger.rst | 13 + doc/source/API/MaterialManagement.rst | 56 ++++ doc/source/API/Mesh.rst | 48 ++++ doc/source/API/MultiPartComponent.rst | 23 ++ doc/source/API/Optimetrics.rst | 34 +++ doc/source/API/Primitive_Objects.rst | 143 ++++++++++ doc/source/API/Primitives2D.rst | 51 ++++ doc/source/API/Primitives3D.rst | 74 +++++ doc/source/API/Primitives3DLayout.rst | 81 ++++++ doc/source/API/PrimitivesCircuit.rst | 174 ++++++++++++ doc/source/API/Setup.rst | 62 ++++ doc/source/API/SetupTemplates.rst | 32 +++ doc/source/API/SetupTemplates3DLayout.rst | 22 ++ doc/source/API/SetupTemplatesCircuit.rst | 26 ++ doc/source/API/SetupTemplatesHFSS.rst | 25 ++ doc/source/API/SetupTemplatesIcepak.rst | 24 ++ doc/source/API/SetupTemplatesMaxwell.rst | 23 ++ doc/source/API/SetupTemplatesMechanical.rst | 23 ++ doc/source/API/SetupTemplatesQ3D.rst | 24 ++ doc/source/API/SetupTemplatesRmxprt.rst | 33 +++ doc/source/API/SetupTemplatesTwinBuilder.rst | 21 ++ doc/source/API/Stackup3D.rst | 22 ++ doc/source/API/Variables.rst | 31 ++ doc/source/API/Visualization.rst | 73 +++++ doc/source/API/index.rst | 104 +++++++ doc/source/API/visualization/advanced.rst | 150 ++++++++++ doc/source/API/visualization/plot.rst | 79 ++++++ doc/source/API/visualization/post.rst | 266 ++++++++++++++++++ doc/source/API/visualization/report.rst | 81 ++++++ doc/source/Getting_started/About.rst | 86 ++++++ doc/source/Getting_started/ClientServer.rst | 93 ++++++ doc/source/Getting_started/Contributing.rst | 206 ++++++++++++++ doc/source/Getting_started/Installation.rst | 197 +++++++++++++ .../Getting_started/Troubleshooting.rst | 201 +++++++++++++ doc/source/Getting_started/index.rst | 132 +++++++++ doc/source/Getting_started/versioning.rst | 78 +++++ doc/source/index.rst | 22 ++ 42 files changed, 3185 insertions(+) create mode 100644 doc/source/API/Application.rst create mode 100644 doc/source/API/Boundaries.rst create mode 100644 doc/source/API/CableModeling.rst create mode 100644 doc/source/API/Configuration.rst create mode 100644 doc/source/API/Constants.rst create mode 100644 doc/source/API/DesktopMessenger.rst create mode 100644 doc/source/API/MaterialManagement.rst create mode 100644 doc/source/API/Mesh.rst create mode 100644 doc/source/API/MultiPartComponent.rst create mode 100644 doc/source/API/Optimetrics.rst create mode 100644 doc/source/API/Primitive_Objects.rst create mode 100644 doc/source/API/Primitives2D.rst create mode 100644 doc/source/API/Primitives3D.rst create mode 100644 doc/source/API/Primitives3DLayout.rst create mode 100644 doc/source/API/PrimitivesCircuit.rst create mode 100644 doc/source/API/Setup.rst create mode 100644 doc/source/API/SetupTemplates.rst create mode 100644 doc/source/API/SetupTemplates3DLayout.rst create mode 100644 doc/source/API/SetupTemplatesCircuit.rst create mode 100644 doc/source/API/SetupTemplatesHFSS.rst create mode 100644 doc/source/API/SetupTemplatesIcepak.rst create mode 100644 doc/source/API/SetupTemplatesMaxwell.rst create mode 100644 doc/source/API/SetupTemplatesMechanical.rst create mode 100644 doc/source/API/SetupTemplatesQ3D.rst create mode 100644 doc/source/API/SetupTemplatesRmxprt.rst create mode 100644 doc/source/API/SetupTemplatesTwinBuilder.rst create mode 100644 doc/source/API/Stackup3D.rst create mode 100644 doc/source/API/Variables.rst create mode 100644 doc/source/API/Visualization.rst create mode 100644 doc/source/API/index.rst create mode 100644 doc/source/API/visualization/advanced.rst create mode 100644 doc/source/API/visualization/plot.rst create mode 100644 doc/source/API/visualization/post.rst create mode 100644 doc/source/API/visualization/report.rst create mode 100644 doc/source/Getting_started/About.rst create mode 100644 doc/source/Getting_started/ClientServer.rst create mode 100644 doc/source/Getting_started/Contributing.rst create mode 100644 doc/source/Getting_started/Installation.rst create mode 100644 doc/source/Getting_started/Troubleshooting.rst create mode 100644 doc/source/Getting_started/index.rst create mode 100644 doc/source/Getting_started/versioning.rst diff --git a/doc/source/API/Application.rst b/doc/source/API/Application.rst new file mode 100644 index 00000000000..d7ad0ed6724 --- /dev/null +++ b/doc/source/API/Application.rst @@ -0,0 +1,70 @@ +Application and solvers +======================= +The PyAEDT API includes classes for different applications available in Ansys Electronics Desktop (AEDT). +You must initialize AEDT to get access to all PyAEDT modules and methods. + +.. image:: ../Resources/aedt_2.png + :width: 800 + :alt: Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. + + +Available PyAEDT apps are: + +.. autosummary:: + :toctree: _autosummary + + ansys.aedt.core.desktop.Desktop + ansys.aedt.core.hfss.Hfss + ansys.aedt.core.q3d.Q3d + ansys.aedt.core.q3d.Q2d + ansys.aedt.core.maxwell.Maxwell2d + ansys.aedt.core.maxwell.Maxwell3d + ansys.aedt.core.icepak.Icepak + ansys.aedt.core.hfss3dlayout.Hfss3dLayout + ansys.aedt.core.mechanical.Mechanical + ansys.aedt.core.rmxprt.Rmxprt + ansys.aedt.core.circuit.Circuit + ansys.aedt.core.maxwellcircuit.MaxwellCircuit + ansys.aedt.core.emit.Emit + ansys.aedt.core.twinbuilder.TwinBuilder + ansys.aedt.core.filtersolutions.FilterSolutions + + +All other classes and methods are inherited into the app class. +AEDT, which is also referred to as the desktop app, is implicitly launched in any PyAEDT app. +Before accessing a PyAEDT app, the desktop app must be launched and initialized. +The desktop app can be explicitly or implicitly initialized as in the following examples. + +Example with ``Desktop`` class explicit initialization: + +.. code:: python + + from ansys.aedt.core import launch_desktop, Circuit + d = launch_desktop(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here will be caught by Desktop. + ... + d.release_desktop() + +Example with ``Desktop`` class implicit initialization: + +.. code:: python + + from ansys.aedt.core import Circuit + circuit = Circuit(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here will be caught by Desktop. + ... + circuit.release_desktop() + + diff --git a/doc/source/API/Boundaries.rst b/doc/source/API/Boundaries.rst new file mode 100644 index 00000000000..b09d5924cfd --- /dev/null +++ b/doc/source/API/Boundaries.rst @@ -0,0 +1,77 @@ +Boundary objects +================ +This section lists classes for creating and editing +boundaries in the 3D tools. These objects are returned by +app methods and can be used to edit or delete a boundary condition. + + +.. currentmodule:: ansys.aedt.core.modules.boundary + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + BoundaryObject + BoundaryObject3dLayout + NetworkObject + FarFieldSetup + Matrix + BoundaryObject3dLayout + Sources + Excitations + +Native components +----------------- + +When native components object are created, the ``NativeComponentObject`` class is returned. For PCB components, ``NativeComponentPCB`` is returned. + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + NativeComponentObject + NativeComponentPCB + +``Native Component Object`` example: + +.. code:: python + + from ansys.aedt.core import Icepak + ipk = Icepak() + component_name = "RadioBoard1" + pcb_comp = self.aedtapp.create_ipk_3dcomponent_pcb( + component_name, link_data, solution_freq, resolution, custom_x_resolution=400, custom_y_resolution=500 + ) + # pcb_comp is a NativeComponentPCB + ... + ipk.release_desktop() + +Icepak transient assignments +---------------------------- +To facilitate transient assignment handling in Icepak, it is possible to use one of the following classes: + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + LinearDictionary + PowerLawDictionary + ExponentialDictionary + SinusoidalDictionary + SquareWaveDictionary + PieceWiseLinearDictionary + +It is possible to initialize the class manually or through a method: + +.. code:: python + + bc_transient = ipk.create_sinusoidal_transient_assignment(vertical_offset="1W", vertical_scaling="3", + period="2", period_offset="0.5s") + # bc_transient will be SinusoidalDictionary type + ipk.assign_solid_block("Cylinder1", bc_transient) + + #or + + bc_transient = SinusoidalDictionary(vertical_offset="1W", vertical_scaling="3", + period="2", period_offset="0.5s") + ipk.assign_solid_block("Cylinder1", bc_transient) \ No newline at end of file diff --git a/doc/source/API/CableModeling.rst b/doc/source/API/CableModeling.rst new file mode 100644 index 00000000000..b152c2c4043 --- /dev/null +++ b/doc/source/API/CableModeling.rst @@ -0,0 +1,132 @@ +Cable modeling +============== +The ``Cable Modeling`` module includes several methods to work +with the Cable Modeling HFSS Beta feature: + + +* ``create_cable`` to create all available types of cables: bundle, straight wire and twisted pair. +* ``update_cable_properties`` to update all cables properties for all cable types. +* ``update_shielding`` to update only the shielding jacket type for bundle cable. +* ``remove_cables`` to remove cables. +* ``add_cable_to_bundle`` to add a cable or a list of cables to a bundle. +* ``create_clock_source`` to create a clock source. +* ``update_clock_source`` to update a clock source. +* ``remove_source`` to remove a source. +* ``remove_all_sources`` to remove all sources. +* ``create_pwl_source`` to create a pwl source. +* ``create_pwl_source_from_file`` to create a pwl source from file. +* ``update_pwl_source`` to update a pwl source. +* ``create_cable_harness`` to create a cable harness. + +They are accessible through: + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cable_modeling.Cable + +Cable bundle creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the cable properties + cable_props["Add_Cable"] = "True" + cable_props["Cable_prop"]["CableType"] = "bundle" + cable_props["Cable_prop"]["IsJacketTypeInsulation"] = "True" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "InsThickness" + ] = "3.66mm" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "JacketMaterial" + ] = "pec" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleParams"]["InsulationJacketParams"][ + "InnerDiameter" + ] = "2.88mm" + cable_props["CableManager"]["Definitions"]["CableBundle"]["BundleAttribs"]["Name"] = "Bundle_Cable_Insulation" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the cable bundle + cable.create_cable() + +Clock source creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the clock source properties + cable_props["Add_Cable"] = "False" + cable_props["Update_Cable"] = "False" + cable_props["Add_CablesToBundle"] = "False" + cable_props["Remove_Cable"] = "False" + cable_props["Add_Source"] = "True" + cable_props["Source_prop"]["AddClockSource"] = "True" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Period"] = "40us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["LowPulseVal"] = "0.1V" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["HighPulseVal"] = "2V" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Risetime"] = "5us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["Falltime"] = "10us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["ClockSignalParams"]["PulseWidth"] = "23us" + cable_props["CableManager"]["TDSources"]["ClockSourceDef"]["TDSourceAttribs"]["Name"] = "clock_test_1" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the clock source + cable.create_clock_source() + +Cable harness creation example: + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.generic.DataHandlers import json_to_dict + from ansys.aedt.core.modules.cable_modeling import Cable + + hfss = Hfss(projectname=project_path, specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns a dictionary out of the JSON file + cable_props = json_to_dict(json_path) + # This example shows how to manually change from script the cable harness properties + cable_props["Add_Cable"] = "False" + cable_props["Update_Cable"] = "False" + cable_props["Add_CablesToBundle"] = "False" + cable_props["Remove_Cable"] = "False" + cable_props["Add_Source"] = "False" + cable_props["Update_Source"] = "False" + cable_props["Remove_Source"] = "False" + cable_props["Add_CableHarness"] = "True" + cable_props["CableHarness_prop"]["Name"] = "cable_harness_test" + cable_props["CableHarness_prop"]["Bundle"] = "New_updated_name_cable_bundle_insulation" + cable_props["CableHarness_prop"]["TwistAngleAlongRoute"] = "20deg" + cable_props["CableHarness_prop"]["Polyline"] = "Polyline1" + cable_props["CableHarness_prop"]["AutoOrient"] = "False" + cable_props["CableHarness_prop"]["XAxis"] = "Undefined" + cable_props["CableHarness_prop"]["XAxisOrigin"] = ["0mm", "0mm", "0mm"] + cable_props["CableHarness_prop"]["XAxisEnd"] = ["0mm", "0mm", "0mm"] + cable_props["CableHarness_prop"]["ReverseYAxisDirection"] = "True" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][0]["CableName"] = "straight_wire_cable" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][1]["CableName"] = "straight_wire_cable1" + cable_props["CableHarness_prop"]["CableTerminationsToInclude"][2]["CableName"] = "straight_wire_cable2" + # This call returns the Cable class + cable = Cable(hfss, cable_props) + # This call creates the cable harness + cable.create_cable_harness() \ No newline at end of file diff --git a/doc/source/API/Configuration.rst b/doc/source/API/Configuration.rst new file mode 100644 index 00000000000..c81b35eb20d --- /dev/null +++ b/doc/source/API/Configuration.rst @@ -0,0 +1,52 @@ +Configuration files +~~~~~~~~~~~~~~~~~~~ +This module contains all methods to export project settings to a JSON file +and import and apply settings to a new design. Currently the configuration +cover the following apps: +* HFSS +* Q2D and Q3D Extractor +* Maxwell +* Icepak +* Mechanical + +The sections covered are: + +* Variables +* Mesh operations +* Setup and optimetrics +* Material properties +* Object properties +* Boundaries and excitations + +When a boundary is attached to a face, the tool tries to match it with a +FaceByPosition on the same object name on the target design. If, for any +reason, this face position has changed or the object name in the target design has changed, +the boundary fails to apply. + + +.. currentmodule:: ansys.aedt.core.generic.configurations + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Configurations + ConfigurationsOptions + ImportResults + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(project_name="original_project", specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + conf_file = self.aedtapp.configurations.export_config() + + app2 = Hfss(projec_name='newproject') + app2.modeler.import_3d_cad(file_path) + out = app2.configurations.import_config(conf_file) + app2.configurations.results.global_import_success + + ... diff --git a/doc/source/API/Constants.rst b/doc/source/API/Constants.rst new file mode 100644 index 00000000000..70b4bce618f --- /dev/null +++ b/doc/source/API/Constants.rst @@ -0,0 +1,21 @@ +Constants +========== +This section lists constants that are commonly used in PyAEDT. + + +Example of constants usage: + +.. code:: python + + from ansys.aedt.core import constants + ipk = Icepak() + # Use of AXIS Constant + cylinder = ipk.modeler.create_cylinder(constants.AXIS.X, [0,0,0],10,3) + # Use of PLANE Constant + ipk.modeler.split(cylinder, constants.PLANE.YZ, sides="Both") + ... + ipk.release_desktop() + + +.. automodule:: ansys.aedt.core.generic.constants + :members: diff --git a/doc/source/API/DesktopMessenger.rst b/doc/source/API/DesktopMessenger.rst new file mode 100644 index 00000000000..3b6077d85d5 --- /dev/null +++ b/doc/source/API/DesktopMessenger.rst @@ -0,0 +1,13 @@ +Logger +~~~~~~ +This section lists modules for creating and editing +PyAEDT log files. + +.. currentmodule:: ansys.aedt.core.aedt_logger + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + AedtLogger + AppFilter diff --git a/doc/source/API/MaterialManagement.rst b/doc/source/API/MaterialManagement.rst new file mode 100644 index 00000000000..bf672ae8afd --- /dev/null +++ b/doc/source/API/MaterialManagement.rst @@ -0,0 +1,56 @@ +Material and stackup +==================== +This section lists material and stackup modules. +These classes cannot be used directly but can be accessed through an app. +Example: + + + +Material management +~~~~~~~~~~~~~~~~~~~ +This section describes all material-related classes and methods. + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + material_lib.Materials + material.Material + material.SurfaceMaterial + material.MatProperties + material.SurfMatProperties + material.MatProperty + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Materials class + my_materials = app.materials + # This call returns the Material class + copper = my_materials["copper"] + # This property is from the MatProperty class + copper.conductivity + ... + + + +Stackup management +~~~~~~~~~~~~~~~~~~ +This section describes all layer-related classes and methods used in HFSS 3D Layout (and indirectly in Circuit). + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + + layer_stackup.Layers + layer_stackup.Layer \ No newline at end of file diff --git a/doc/source/API/Mesh.rst b/doc/source/API/Mesh.rst new file mode 100644 index 00000000000..5ac5adad37d --- /dev/null +++ b/doc/source/API/Mesh.rst @@ -0,0 +1,48 @@ +Mesh operations +=============== +The ``Mesh`` module includes these classes: + +* ``Mesh`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor +* ``IcepakMesh`` for Icepak +* ``Mesh3d`` for HFSS 3D Layout + +They are accessible through the mesh property: + +.. currentmodule:: ansys.aedt.core.modules + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + mesh.Mesh + mesh_icepak.IcepakMesh + mesh_3d_layout.Mesh3d + +.. code:: python + + from ansys.aedt.core import Maxwell3d + app = Maxwell3d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + # This call returns the Mesh class + my_mesh = app.mesh + # This call executes a ``Mesh`` method and creates an object to control the mesh operation + mesh_operation_object = my_mesh.assign_surface_mesh("MyBox", 2) + ... + +Icepak mesh +~~~~~~~~~~~~~~~ + +These objects are relevant objects while using the ``MeshIcepak`` class: + +.. currentmodule:: ansys.aedt.core.modules.mesh_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + + Region + SubRegion + MeshRegion + GlobalMeshRegion \ No newline at end of file diff --git a/doc/source/API/MultiPartComponent.rst b/doc/source/API/MultiPartComponent.rst new file mode 100644 index 00000000000..2c55c82bcb1 --- /dev/null +++ b/doc/source/API/MultiPartComponent.rst @@ -0,0 +1,23 @@ +Multi-part components +===================== +This section lists classes for creating and editing multi-part components in the 3D tools. +This consists of a set of one or more 3D component objects, linked together and parametrized +to allow movements. + + + +.. currentmodule:: ansys.aedt.core.modeler.advanced_cad + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + actors.Person + actors.Vehicle + actors.Bird + actors.Radar + parts.Part + parts.Antenna + multiparts.MultiPartComponent + multiparts.Environment + multiparts.Actor diff --git a/doc/source/API/Optimetrics.rst b/doc/source/API/Optimetrics.rst new file mode 100644 index 00000000000..5f02473f306 --- /dev/null +++ b/doc/source/API/Optimetrics.rst @@ -0,0 +1,34 @@ +Optimetrics +=========== +This module contains all properties and methods needed to create +optimetrics setups. + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # returns the ParametericsSetups Class + app.parametrics + + # returns the OptimizationSetups Class + app.optimizations + + # adds an optimization and returns Setup class with all settings and methods + sweep3 = hfss.opti_optimization.add_optimization(calculation="dB(S(1,1))", calculation_value="2.5GHz") + + ... + +.. currentmodule:: ansys.aedt.core.modules.design_xploration + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ParametricSetups + OptimizationSetups + SetupParam + SetupOpti + diff --git a/doc/source/API/Primitive_Objects.rst b/doc/source/API/Primitive_Objects.rst new file mode 100644 index 00000000000..ac3a3fcbfd7 --- /dev/null +++ b/doc/source/API/Primitive_Objects.rst @@ -0,0 +1,143 @@ +Primitives +========== + +This section lists the core AEDT Modeler primitives that are supported both in 2D and 3D solvers (HFSS, Maxwell, +Icepak, Q3D, and Mechanical): + +* Primitives +* Objects + +They are accessible through the ``modeler.objects`` property: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call return an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + my_box = primitives.objects[my_box.id] + + # This call return a FacePrimitive object list + my_box.faces + # This call returns an EdgePrimitive object list + my_box.edges + my_box.faces[0].edges + + # This call returns a VertexPrimitive object list + my_box.vertices + my_box.faces[0].vertices + my_box.faces[0].edges[0].vertices + + ... + + + +Objects +~~~~~~~ + +The following classes define objects properties for 3D and 2D Solvers (excluding HFSS 3D Layout). +They contain all getters and setters to simplify object manipulation. + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cad.object_3d.Object3d + cad.elements_3d.FacePrimitive + cad.elements_3d.EdgePrimitive + cad.elements_3d.VertexPrimitive + cad.polylines.PolylineSegment + cad.polylines.Polyline + cad.component_array.ComponentArray + cad.components_3d.UserDefinedComponent + cad.elements_3d.Point + cad.elements_3d.Plane + cad.elements_3d.HistoryProps + cad.elements_3d.BinaryTreeNode + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call returns an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + + # Getter and setter + my_box.material_name + my_box.material_name = "copper" + + my_box.faces[0].center + + ... + + +Coordinate systems and geometry operators +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This module contains all properties and methods needed to edit a +coordinate system and a set of useful geometry operators. +The ``CoordinateSystem`` class is accessible through the ``create_coordinate_system`` +method or the ``coordinate_systems`` list. The ``GeometryOperators`` class can be +imported and used because it is made by static methods. + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + cad.modeler.CoordinateSystem + geometry_operators.GeometryOperators + + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the CoordinateSystem object list + cs = app.modeler.coordinate_systems + + # This call returns a CoordinateSystem object + new_cs = app.modeler.create_coordinate_system() + + ... + + +Advanced modeler operations +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PyAEDT includes some advanced modeler tools like ``MultiPartComponent`` for 3D component +management and ``Stackup3D`` for parametric creation of 3D modeler stackups. + +.. toctree:: + :maxdepth: 2 + + MultiPartComponent + Stackup3D \ No newline at end of file diff --git a/doc/source/API/Primitives2D.rst b/doc/source/API/Primitives2D.rst new file mode 100644 index 00000000000..13273427673 --- /dev/null +++ b/doc/source/API/Primitives2D.rst @@ -0,0 +1,51 @@ +2D modeler +=========== + +This section lists the core AEDT Modeler modules for 2D and 3D solvers (Maxwell 2D, 2D Extractor). + + +They are accessible through the ``modeler`` property: + +.. code:: python + + from ansys.aedt.core import Maxwell2d + app = Maxwell2d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler2D class + modeler = app.modeler + + + ... + + + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_2d.Modeler2D + + + +.. code:: python + + from ansys.aedt.core import Maxwell2d + app = Maxwell2d(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the NexximComponents class + origin = [0,0,0] + dimensions = [10,5,20] + #Material and name are not mandatory fields + box_object = app.modeler.primivites.create_rectangle([15, 20, 0], [5, 5], material="aluminum") + + ... diff --git a/doc/source/API/Primitives3D.rst b/doc/source/API/Primitives3D.rst new file mode 100644 index 00000000000..4d55ad3fc86 --- /dev/null +++ b/doc/source/API/Primitives3D.rst @@ -0,0 +1,74 @@ +3D modeler +========== + +This section lists the core AEDT Modeler modules with 3D solvers (HFSS, Maxwell, +Icepak, Q3D, and Mechanical): + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` property: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call return the Modeler3D class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call return an Object3d object + my_box = primitives.create_box([0,0,0],[10,10,10]) + my_box = primitives.objects[my_box.id] + + # This call return a FacePrimitive object list + my_box.faces + # This call returns an EdgePrimitive object list + my_box.edges + my_box.faces[0].edges + + # This call returns a VertexPrimitive object list + my_box.vertices + my_box.faces[0].vertices + my_box.faces[0].edges[0].vertices + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties for HFSS, Maxwell 3D, Q3D Extractor, and Icepak: + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_3d.Modeler3D + + +.. code:: python + + from ansys.aedt.core import Circuit + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the NexximComponents class + origin = [0,0,0] + sizes = [10,5,20] + #Material and name are not mandatory fields + box_object = app.modeler.primivites.create_box(origin, sizes, name="mybox", material="copper") + + ... diff --git a/doc/source/API/Primitives3DLayout.rst b/doc/source/API/Primitives3DLayout.rst new file mode 100644 index 00000000000..263443209a2 --- /dev/null +++ b/doc/source/API/Primitives3DLayout.rst @@ -0,0 +1,81 @@ +Modeler in HFSS 3D Layout +========================== + +This section lists the core AEDT Modeler modules available in HFSS 3D Layout: + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` module and ``modeler.objects`` property: + +.. code:: python + + from ansys.aedt.core import Hfss3dLayout + hfss = Hfss3dLayout() + my_modeler = hfss.modeler + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + + +* ``Modeler3DLayout`` for HFSS 3D Layout + + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + modeler_pcb.Modeler3DLayout + + +Objects in HFSS 3D Layout +~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for HFSS 3D Layout. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.pcb + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + object_3d_layout.Components3DLayout + object_3d_layout.Nets3DLayout + object_3d_layout.Pins3DLayout + object_3d_layout.Line3dLayout + object_3d_layout.Polygons3DLayout + object_3d_layout.Circle3dLayout + object_3d_layout.Rect3dLayout + object_3d_layout.Points3dLayout + object_3d_layout.Padstack + +.. code:: python + + from ansys.aedt.core import Hfss3dLayout + app = Hfss3dLayout(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler3DLayout class + modeler = app.modeler + + # This call returns a Primitives3D object + primitives = modeler + + # This call returns an Object3d object + my_rect = primitives.create_rectangle([0,0,0],[10,10]) + + # Getter and setter + my_rect.material_name + + ... diff --git a/doc/source/API/PrimitivesCircuit.rst b/doc/source/API/PrimitivesCircuit.rst new file mode 100644 index 00000000000..a9b8444712c --- /dev/null +++ b/doc/source/API/PrimitivesCircuit.rst @@ -0,0 +1,174 @@ +Modeler and components Circuit +============================== + +This section lists the core AEDT Modeler modules: + +* Modeler +* Primitives +* Objects + +They are accessible through the ``modeler`` module and ``modeler.objects`` property: + +.. code:: python + + + from ansys.aedt.core import TwinBuilder + app = TwinBuilder(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + ... + + +Modeler +~~~~~~~ + +The ``Modeler`` module contains all properties and methods needed to edit a +modeler, including all primitives methods and properties: + +* ``ModelerNexxim`` for Circuit +* ``ModelerTwinBuilder`` for Twin Builder +* ``ModelerEmit`` for EMIT + + +.. currentmodule:: ansys.aedt.core.modeler + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + schematic.ModelerNexxim + schematic.ModelerTwinBuilder + schematic.ModelerEmit + schematic.ModelerMaxwellCircuit + + +Schematic in Circuit +~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Circuit components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_nexxim + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + NexximComponents + +.. code:: python + + from ansys.aedt.core import Circuit + app = Circuit(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + +Objects in Circuit +~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Circuit. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + object_3d_circuit.CircuitComponent + object_3d_circuit.CircuitPins + object_3d_circuit.Wire + +.. code:: python + + from ansys.aedt.core import Circuit + app = Circuit(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + # Getter and setter + my_res.location + my_res.parameters["R"]=100 + + ... + +Schematic in EMIT +~~~~~~~~~~~~~~~~~ +The following classes define the object properties for EMIT components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_emit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + EmitComponents + + +Schematic in Twin Builder +~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Twin Builder components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_twin_builder + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + TwinBuilderComponents + +.. code:: python + + from ansys.aedt.core import TwinBuilder + app = TwinBuilder(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Modeler class + modeler = app.modeler + + # This call returns a Schematic object + schematic = modeler.schematic + + # This call returns an Object3d object + my_res = schematic.create_resistor("R1", 50) + + # Getter and setter + my_res.location + my_res.parameters["R"]=100 + + ... + + +Schematic in Maxwell Circuit +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following classes define the object properties for Maxwell Circuit components. +They contain all getters and setters to simplify object manipulation. + +.. currentmodule:: ansys.aedt.core.modeler.circuits.primitives_maxwell_circuit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + MaxwellCircuitComponents diff --git a/doc/source/API/Setup.rst b/doc/source/API/Setup.rst new file mode 100644 index 00000000000..3b2774a64d5 --- /dev/null +++ b/doc/source/API/Setup.rst @@ -0,0 +1,62 @@ +Setup +===== +This section lists setup modules: + +* ``Setup`` for HFSS, Maxwell 2D, Maxwell 3D, Q2D Extractor, and Q3D Extractor +* ``Setup3DLayout`` for HFSS 3D Layout +* ``SetupCircuit`` for Circuit and Twin Builder + +The ``Setup`` object is accessible through the ``create_setup`` method and ``setups`` object list. + +.. currentmodule:: ansys.aedt.core.modules.solve_setup + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SetupHFSS + SetupHFSSAuto + SetupSBR + SetupQ3D + SetupMaxwell + Setup + Setup3DLayout + SetupCircuit + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the Setup class + my_setup = app.setups[0] + + + # This call returns a Setup object + setup = app.create_setup("MySetup") + + ... + + +Sweep classes +============= +This section lists sweep classes and their default values: + +* ``SweepHFSS`` for HFSS +* ``SweepHFSS3DLayout`` for HFSS 3D Layout +* ``SweepMatrix`` for Q3D and 2D Extractor + +The ``Setup`` object is accessible through the methods available for sweep creation. + + +.. currentmodule:: ansys.aedt.core.modules.solve_sweeps + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SweepHFSS + SweepHFSS3DLayout + SweepMatrix diff --git a/doc/source/API/SetupTemplates.rst b/doc/source/API/SetupTemplates.rst new file mode 100644 index 00000000000..89a80c540c9 --- /dev/null +++ b/doc/source/API/SetupTemplates.rst @@ -0,0 +1,32 @@ +Setup templates +=============== + +This section lists all setup templates with their default values and keys. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + Launch AEDT 2023 R1 in non-graphical mode + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + +.. toctree:: + :maxdepth: 2 + + SetupTemplatesHFSS + SetupTemplates3DLayout + SetupTemplatesMaxwell + SetupTemplatesQ3D + SetupTemplatesIcepak + SetupTemplatesMechanical + SetupTemplatesCircuit + SetupTemplatesTwinBuilder + SetupTemplatesRmxprt diff --git a/doc/source/API/SetupTemplates3DLayout.rst b/doc/source/API/SetupTemplates3DLayout.rst new file mode 100644 index 00000000000..20007619039 --- /dev/null +++ b/doc/source/API/SetupTemplates3DLayout.rst @@ -0,0 +1,22 @@ +HFSS 3D Layout and arguments +============================ + +This section lists all setup templates with their default values and keys available in HFSS 3D Layout. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + Launch AEDT 2023 R1 in non-graphical mode + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSS3DLayout diff --git a/doc/source/API/SetupTemplatesCircuit.rst b/doc/source/API/SetupTemplatesCircuit.rst new file mode 100644 index 00000000000..32c3b59025b --- /dev/null +++ b/doc/source/API/SetupTemplatesCircuit.rst @@ -0,0 +1,26 @@ +Circuit templates and arguments +================================ + +This section lists all setup templates with their default values and keys available in Circuit. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximLNA +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximDC +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximQuickEye +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximVerifEye +.. pprint:: ansys.aedt.core.modules.setup_templates.NexximAMI + diff --git a/doc/source/API/SetupTemplatesHFSS.rst b/doc/source/API/SetupTemplatesHFSS.rst new file mode 100644 index 00000000000..e3e09901dc6 --- /dev/null +++ b/doc/source/API/SetupTemplatesHFSS.rst @@ -0,0 +1,25 @@ +HFSS templates and arguments +============================ + +This section lists all setup templates with their default values and keys available in HFSS. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenAuto +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSDrivenDefault +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.HFSSSBR + diff --git a/doc/source/API/SetupTemplatesIcepak.rst b/doc/source/API/SetupTemplatesIcepak.rst new file mode 100644 index 00000000000..30d623930e1 --- /dev/null +++ b/doc/source/API/SetupTemplatesIcepak.rst @@ -0,0 +1,24 @@ +Icepak templates and arguments +=============================== + +This section lists all setup templates with their default values and keys available in Icepak. +Note that Icepak parameters contain spaces. To use them as arguments of the ``"create_setup"`` method, these +same parameters have to be used without spaces. +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Icepak + + app = Icepak() + # Any property of this setup can be found on this page. + setup = app.create_setup(MaxIterations=5) + +Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``. + +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientFlowOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.TransientTemperatureAndFlow +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyFlowOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureOnly +.. pprint:: ansys.aedt.core.modules.setup_templates.SteadyTemperatureAndFlow diff --git a/doc/source/API/SetupTemplatesMaxwell.rst b/doc/source/API/SetupTemplatesMaxwell.rst new file mode 100644 index 00000000000..5ac02dcc9dc --- /dev/null +++ b/doc/source/API/SetupTemplatesMaxwell.rst @@ -0,0 +1,23 @@ +Maxwell templates and arguments +=============================== + + +This section lists all setup templates with their default values and keys available in Maxwell 2D and 3D. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Maxwell3d + + Maxwell3d = Maxwell3d () + # Any property of this setup can be found on this page. + setup = Maxwell3d.create_setup () + setup.props["MaximumPasses"] = 5 + setup.update () + +.. pprint:: ansys.aedt.core.modules.setup_templates.MaxwellTransient +.. pprint:: ansys.aedt.core.modules.setup_templates.Magnetostatic +.. pprint:: ansys.aedt.core.modules.setup_templates.Electrostatic +.. pprint:: ansys.aedt.core.modules.setup_templates.EddyCurrent +.. pprint:: ansys.aedt.core.modules.setup_templates.ElectricTransient diff --git a/doc/source/API/SetupTemplatesMechanical.rst b/doc/source/API/SetupTemplatesMechanical.rst new file mode 100644 index 00000000000..09b9adc824f --- /dev/null +++ b/doc/source/API/SetupTemplatesMechanical.rst @@ -0,0 +1,23 @@ +Mechanical templates and arguments +================================== + +This section lists all setup templates with their default values and keys available in Mechanical. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + + from ansys.aedt.core import Mechanical + + app = Mechanical() + # Any property of this setup can be found on this page. + setup = app.create_setup(MaxModes=6) + + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.MechTerm +.. pprint:: ansys.aedt.core.modules.setup_templates.MechModal +.. pprint:: ansys.aedt.core.modules.setup_templates.MechStructural + diff --git a/doc/source/API/SetupTemplatesQ3D.rst b/doc/source/API/SetupTemplatesQ3D.rst new file mode 100644 index 00000000000..838e2cd68b7 --- /dev/null +++ b/doc/source/API/SetupTemplatesQ3D.rst @@ -0,0 +1,24 @@ +Q3D templates and arguments +=========================== + + +This section lists all setup templates with their default values and keys available in Q3D and 2D Extractor. +Note that to use nested parameters, you can set a parameter using the "__" separator as shown in the following example. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + + from ansys.aedt.core import Q3d + + app = Q3d() + # Any property of this setup can be found on this page. + setup = app.create_setup(AC__MaxPasses=6) + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.Matrix +.. pprint:: ansys.aedt.core.modules.setup_templates.Close +.. pprint:: ansys.aedt.core.modules.setup_templates.Open + diff --git a/doc/source/API/SetupTemplatesRmxprt.rst b/doc/source/API/SetupTemplatesRmxprt.rst new file mode 100644 index 00000000000..57fb82b99af --- /dev/null +++ b/doc/source/API/SetupTemplatesRmxprt.rst @@ -0,0 +1,33 @@ +RMXprt templates and arguments +============================== + +This section lists all setup templates with their default values and keys available in RMXprt. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.GRM +.. pprint:: ansys.aedt.core.modules.setup_templates.DFIG +.. pprint:: ansys.aedt.core.modules.setup_templates.TPIM +.. pprint:: ansys.aedt.core.modules.setup_templates.TPSM +.. pprint:: ansys.aedt.core.modules.setup_templates.BLDC +.. pprint:: ansys.aedt.core.modules.setup_templates.ASSM +.. pprint:: ansys.aedt.core.modules.setup_templates.PMDC +.. pprint:: ansys.aedt.core.modules.setup_templates.SRM +.. pprint:: ansys.aedt.core.modules.setup_templates.LSSM +.. pprint:: ansys.aedt.core.modules.setup_templates.UNIM +.. pprint:: ansys.aedt.core.modules.setup_templates.DCM +.. pprint:: ansys.aedt.core.modules.setup_templates.CPSM +.. pprint:: ansys.aedt.core.modules.setup_templates.NSSM + diff --git a/doc/source/API/SetupTemplatesTwinBuilder.rst b/doc/source/API/SetupTemplatesTwinBuilder.rst new file mode 100644 index 00000000000..153c99fa365 --- /dev/null +++ b/doc/source/API/SetupTemplatesTwinBuilder.rst @@ -0,0 +1,21 @@ +Twin Builder templates and arguments +==================================== + + +This section lists all setup templates with their default values and keys available in Twin Builder. + +You can edit a setup after it is created. Here is an example: + +.. code:: python + + from ansys.aedt.core import Hfss + + hfss = Hfss() + # Any property of this setup can be found on this page. + setup = hfss.create_setup() + setup.props["AdaptMultipleFreqs"] = True + setup.update() + + + +.. pprint:: ansys.aedt.core.modules.setup_templates.TR diff --git a/doc/source/API/Stackup3D.rst b/doc/source/API/Stackup3D.rst new file mode 100644 index 00000000000..439502b773d --- /dev/null +++ b/doc/source/API/Stackup3D.rst @@ -0,0 +1,22 @@ +Stackup 3D components +===================== +This section lists ``stackup_3d`` classes for creating and editing a stackup and objects in the 3D tools. +This consists of a set of one or more parametrized layer objects and placing lines, patches, polygons, +and vias. + + + +.. currentmodule:: ansys.aedt.core.modeler.advanced_cad + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + stackup_3d.Stackup3D + stackup_3d.Layer3D + stackup_3d.Padstack + stackup_3d.PadstackLayer + stackup_3d.Patch + stackup_3d.Trace + stackup_3d.Polygon + stackup_3d.NamedVariable diff --git a/doc/source/API/Variables.rst b/doc/source/API/Variables.rst new file mode 100644 index 00000000000..168bdd55ea9 --- /dev/null +++ b/doc/source/API/Variables.rst @@ -0,0 +1,31 @@ +Variable +======== +This module provides all functionalities for creating and editing +design and project variables in the 3D tools. + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the VariableManager class + variable_manager = self.aedtapp._variable_manager + + # Set and get a variable + app["w"] = "10mm" + a = app["w"] + ... + + +.. currentmodule:: ansys.aedt.core.application.variables + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VariableManager + Variable + DataSet + CSVDataset diff --git a/doc/source/API/Visualization.rst b/doc/source/API/Visualization.rst new file mode 100644 index 00000000000..dd31524bbb6 --- /dev/null +++ b/doc/source/API/Visualization.rst @@ -0,0 +1,73 @@ +Visualization +============= + +This section outlines the available modules for creating and editing data within and outside AEDT. + +PyAEDT offers four primary levels of visualization: + +* **Reports** +* **Post-processing** +* **Graphics** +* **Advanced Visualization** + +Reports +~~~~~~~ + +AEDT provides extensive flexibility for generating reports. +PyAEDT includes dedicated classes to manipulate all report properties, offering full control over report customization. + +.. toctree:: + :maxdepth: 1 + + visualization/report + +.. image:: ../Resources/sparams.jpg + :width: 800 + :alt: S-Parameters + + +Post-processing +~~~~~~~~~~~~~~~ + +AEDT has different post-processing tools. +PyAEDT provides classes to interact with and modify any of these tools, +enhancing data analysis and visualization capabilities. + +.. toctree:: + :maxdepth: 1 + + visualization/post + +.. image:: ../Resources/field_plot.png + :width: 800 + :alt: Postprocessing features + + +Graphics +~~~~~~~~ + +Specialized plotting options. + +.. toctree:: + :maxdepth: 1 + + visualization/plot + +.. image:: ../Resources/pyvista_plot.jpg + :width: 800 + :alt: S-Parameters Matplotlib + + +Advanced Visualization +~~~~~~~~~~~~~~~~~~~~~~ + +High-level visualization tools. + +.. toctree:: + :maxdepth: 1 + + visualization/advanced + +.. image:: ../Resources/farfield.png + :width: 800 + :alt: Farfield pyvista diff --git a/doc/source/API/index.rst b/doc/source/API/index.rst new file mode 100644 index 00000000000..0d7dbde7ad4 --- /dev/null +++ b/doc/source/API/index.rst @@ -0,0 +1,104 @@ +============= +API reference +============= + +This section describes PyAEDT core classes, methods, and functions +for AEDT apps and modules. Use the search feature or click links +to view API documentation. +The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. +`AEDT `_ provides access to the Ansys gold-standard +electro-magnetics simulation solutions such as Ansys HFSS, +Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. +In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, +and Mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_2.png + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + +The PyAEDT API includes classes for apps and modules. You must initialize the +PyAEDT app to get access to all modules and methods. Available apps are: + +- `HFSS `_ +- `HFSS 3D Layout `_ +- `Maxwell 3D `_ +- `Maxwell 2D `_ +- `Maxwell Circuit `_ +- `Q3D `_ +- `Q2D Extractor `_ +- `Icepak `_ +- `Mechanical `_ +- RMXprt +- EMIT +- Circuit +- `TwinBuilder `_ +- `FilterSolutions `_ + + +All other classes and methods are inherited into the app class. +The desktop app is implicitly launched in any of the other applications. +Before accessing a PyAEDT app, the desktop app has to be launched and initialized. +The desktop app can be explicitly or implicitly initialized as shown in the following examples. + +Example with ``Desktop`` class explicit initialization: + +.. code:: python + + from ansys.aedt.core import launch_desktop, Circuit + d = launch_desktop(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here should be caught by the desktop app. + ... + d.release_desktop() + +Example with ``Desktop`` class implicit initialization: + +.. code:: python + + from ansys.aedt.core import Circuit + circuit = Circuit(specified_version="2023.1", + non_graphical=False, + new_desktop_session=True, + close_on_exit=True, + student_version=False): + circuit = Circuit() + ... + # Any error here should be caught by the desktop app. + ... + circuit.release_desktop() + + +.. toctree:: + :maxdepth: 2 + + Application + MaterialManagement + Primitives3D + Primitives2D + Primitive_Objects + Primitives3DLayout + PrimitivesCircuit + Boundaries + Mesh + Setup + Visualization + DesktopMessenger + Optimetrics + Variables + Constants + Configuration + SetupTemplates + CableModeling + + + + diff --git a/doc/source/API/visualization/advanced.rst b/doc/source/API/visualization/advanced.rst new file mode 100644 index 00000000000..39dbc5fc16b --- /dev/null +++ b/doc/source/API/visualization/advanced.rst @@ -0,0 +1,150 @@ +Advanced +======== + +You can use PyAEDT for postprocessing of AEDT results to display graphics object and plot data. + + +Touchstone +~~~~~~~~~~ + +TouchstoneData class is based on `scikit-rf `_ package and allows advanced +touchstone post-processing. +The following methods allows to read and check touchstone files. + +.. currentmodule:: ansys.aedt.core.visualization.advanced.touchstone_parser + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + TouchstoneData.get_insertion_loss_index + TouchstoneData.plot_insertion_losses + TouchstoneData.plot + TouchstoneData.plot_return_losses + TouchstoneData.get_mixed_mode_touchstone_data + TouchstoneData.get_return_loss_index + TouchstoneData.get_insertion_loss_index_from_prefix + TouchstoneData.get_next_xtalk_index + TouchstoneData.get_fext_xtalk_index_from_prefix + TouchstoneData.plot_next_xtalk_losses + TouchstoneData.plot_fext_xtalk_losses + TouchstoneData.get_worst_curve + read_touchstone + check_touchstone_files + find_touchstone_files + + +Here an example on how to use TouchstoneData class. + +.. code:: python + + from ansys.aedt.core.visualization.advanced.touchstone_parser import TouchstoneData + + ts1 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1234.s8p")) + assert ts1.get_mixed_mode_touchstone_data() + ts2 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1324.s8p")) + assert ts2.get_mixed_mode_touchstone_data(port_ordering="1324") + + assert ts1.plot_insertion_losses(plot=False) + assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False) + + +Farfield +~~~~~~~~ + +PyAEDT offers sophisticated tools for advanced farfield post-processing. +There are two complementary classes: ``FfdSolutionDataExporter`` and ``FfdSolutionData``. + +- FfdSolutionDataExporter: Enables efficient export and manipulation of farfield data. It allows users to convert simulation results into a standard metadata format for further analysis, or reporting. + +- FfdSolutionData: Focuses on the direct access and processing of farfield solution data. It supports a comprehensive set of postprocessing operations, from visualizing radiation patterns to computing key performance metrics. + + +.. currentmodule:: ansys.aedt.core.visualization.advanced.farfield_visualization + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FfdSolutionData + + +This code shows how you can get the farfield data and perform some post-processing: + +.. code:: python + + import ansys.aedt.core + from ansys.aedt.core.generic.farfield_visualization import FfdSolutionDataExporter + app = ansys.aedt.core.Hfss() + ffdata = app.get_antenna_data(frequencies=None, + setup="Setup1 : Sweep", + sphere="3D", + variations=None, + overwrite=False, + link_to_hfss=True, + export_touchstone=True) + incident_power = ffdata.incident_power + ffdata.plot_cut(primary_sweep="Theta", theta=0) + ffdata.plot_contour(polar=True) + ffdata.plot_3d(show_geometry=False) + app.release_desktop(False, False) + +If you exported the farfield data previously, you can directly get the farfield data: + +.. code:: python + + from ansys.aedt.core.generic.farfield_visualization import FfdSolutionData + input_file = r"path_to_ffd\pyaedt_antenna_metadata.json" + ffdata = FfdSolutionData(input_file) + incident_power = ffdata.incident_power + ffdata.plot_cut(primary_sweep="Theta", theta=0) + ffdata.plot_contour(polar=True) + ffdata.plot_3d(show_geometry=False) + app.release_desktop(False, False) + +The following diagram shows both classes work. You can use them independently or from the ``get_antenna_data`` method. + + .. image:: ../../_static/farfield_visualization_pyaedt.png + :width: 800 + :alt: Farfield data with PyAEDT + + +If you have existing farfield data, or you want to export it manually, you can still use FfdSolutionData class. + + .. image:: ../../_static/farfield_visualization_aedt.png + :width: 800 + :alt: Farfield data with AEDT + + +Heterogeneous data message +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Heterogeneous data message (HDM) is the file exported from SBR+ solver containing rays information. +The following methods allows to read and plot rays information. + +.. currentmodule:: ansys.aedt.core.visualization.advanced + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + hdm_plot.HDMPlotter + sbrplus.hdm_parser.Parser + + +Miscellaneous +~~~~~~~~~~~~~ + +PyAEDT has additional advanced post-processing features: + +.. currentmodule:: ansys.aedt.core.visualization.advanced.misc + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + convert_nearfield_data + parse_rdat_file + nastran_to_stl + simplify_stl + diff --git a/doc/source/API/visualization/plot.rst b/doc/source/API/visualization/plot.rst new file mode 100644 index 00000000000..a00e71715c3 --- /dev/null +++ b/doc/source/API/visualization/plot.rst @@ -0,0 +1,79 @@ +Graphics operations +=================== + +PyAEDT enables powerful post-processing of AEDT results, +allowing you to visualize graphics objects and plot data with ease. + +PyAEDT supports external report capabilities available with installed third-party +packages like `pyvista `_, `matplotlib `_, +`pandas `_, and `numpy `_. + + +There have three main categories: + +* **Three-dimensional visualization** +* **Graph visualization** +* **PDF** + + +Three-dimensional visualization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PyAEDT benefits of `pyvista `_ package and allows to generate +models and 3D plots. + +.. currentmodule:: ansys.aedt.core.visualization.plot.pyvista + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ModelPlotter + FieldClass + ObjClass + + +Graph visualization +~~~~~~~~~~~~~~~~~~~ + +PyAEDT benefits of `matplotlib `_ package and allows to generate 2D plots. + + +.. currentmodule:: ansys.aedt.core.visualization.plot.matplotlib + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ReportPlotter + is_notebook + + +PDF +~~~ + +PyAEDT benefits of `fpdf2 `_ package and allows to generate PDF files. + +.. currentmodule:: ansys.aedt.core.visualization.plot.pdf + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + AnsysReport.read_template + AnsysReport.header + AnsysReport.footer + AnsysReport.create + AnsysReport.add_project_info + AnsysReport.add_section + AnsysReport.add_chapter + AnsysReport.add_sub_chapter + AnsysReport.add_image + AnsysReport.add_caption + AnsysReport.add_empty_line + AnsysReport.add_page_break + AnsysReport.add_table + AnsysReport.add_text + AnsysReport.add_toc + AnsysReport.save_pdf + AnsysReport.add_chart diff --git a/doc/source/API/visualization/post.rst b/doc/source/API/visualization/post.rst new file mode 100644 index 00000000000..d8490fc6933 --- /dev/null +++ b/doc/source/API/visualization/post.rst @@ -0,0 +1,266 @@ +AEDT post-processing +==================== + +AEDT offers a wide range of powerful post-processing tools for advanced data analysis and visualization. +PyAEDT provides dedicated classes that allow you to seamlessly interact with and modify these tools, expanding the scope of your data insights + + +.. note:: + Some functionalities are available only when AEDT is running + in graphical mode. + + +Core +~~~~ + +The following classes grant access to the core post-processing functionalities of AEDT: + +* **PostProcessor3D**: This class is utilized across all 3D applications, including HFSS, HFSS 3D Layout, Maxwell 3D and 2D, Q3D Extractor, and Mechanical AEDT. + +* **PostProcessorIcepak**: A specialized class for Icepak, which extends the ``PostProcessor3D`` class by adding features tailored to thermal analysis. + +* **PostProcessorCircuit**: This class handles schematic post-processing, supporting Circuit and Twin Builder applications. + + +.. currentmodule:: ansys.aedt.core.visualization.post.post_common_3d + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessor3D + +.. currentmodule:: ansys.aedt.core.visualization.post.post_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessorIcepak + +.. currentmodule:: ansys.aedt.core.visualization.post.post_circuit + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + PostProcessorCircuit + + +You can access these classes directly from the design object: + +.. code:: python + + from ansys.aedt.core import Hfss + app = Hfss(specified_version="2023.1", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + + # This call returns the PostProcessor class + post = app.post + + # This call returns a FieldPlot object + plotf = post.create_fieldplot_volume(objects, quantity_name, setup_name, intrinsics) + + # This call returns a SolutionData object + my_data = post.get_solution_data(expressions=trace_names) + + # This call returns a new standard report object and creates one or multiple reports from it. + standard_report = post.reports_by_category.standard("db(S(1,1))") + report_standard.create() + sols = report_standard.get_solution_data() + + +User can get the properties of the default reports using the following class: + +.. currentmodule:: ansys.aedt.core.visualization.post.common + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Reports + +.. code:: python + + from ansys.aedt.core import Hfss + from ansys.aedt.core.visualization.post.common import Reports + app = Hfss(specified_version="2024.2", + non_graphical=False, new_desktop_session=True, + close_on_exit=True, student_version=False) + reports = Reports(app.post, app.design_type) + app.release_desktop(False, False) + + +AEDT data is returned in a structured format, providing organized and detailed results. +For a comprehensive overview of the data structure and its capabilities, refer to the class definition below: + + +.. currentmodule:: ansys.aedt.core.visualization.post.solution_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SolutionData + + +Field +~~~~~ + +AEDT offers additional specialized post-processing features for enhanced 3D field visualization and control. + + +The following classes manage all aspects of AEDT 3D post-processing and are utilized by the ``PostProcessor3D`` class: + +.. currentmodule:: ansys.aedt.core.visualization.post.field_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldPlot + +.. code:: python + + from ansys.aedt.core import Hfss + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = app.post.create_fieldplot_line(quantity="Mag_E", assignment=p1.name) + report.create() + app.release_desktop(False, False) + + +Additionally, the following classes control field overlay settings, +enabling precise adjustments to visualization parameters: + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + ColorMapSettings + AutoScale + MinMaxScale + Scale3DSettings + NumberFormat + MarkerSettings + ArrowSettings + FolderPlotSettings + +The ``fields_calculator`` module includes the ``FieldsCalculator`` class. +It provides methods to interact with AEDT Fields Calculator by adding, loading and deleting custom expressions. + +.. currentmodule:: ansys.aedt.core.visualization.post.fields_calculator + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldsCalculator + + +HFSS +~~~~ + +For HFSS solutions, there are two additionally features: virtual ray tracing and farfield exporter. + +To define and control virtual ray tracing (VRT) you can use: + +.. currentmodule:: ansys.aedt.core.visualization.post.vrt_data + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VRTFieldPlot + + +If you need to export HFSS far field data, then you can use the following feature to obtain the antenna metadata: + +.. currentmodule:: ansys.aedt.core.visualization.post.farfield_exporter + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FfdSolutionDataExporter + +.. code:: python + + from ansys.aedt.core import Hfss + + app = Hfss() + + antenna_data = app.post.get_antenna_data() + app.release_desktop(False, False) + + +Icepak +~~~~~~ + +The ``monitor_icepak`` module includes the classes listed below to add, modify, and manage monitors during simulations. +Retrieve monitor values for post-processing and analysis to gain insights into key simulation metrics. +Methods and properties are accessible through the ``monitor`` property of the ``Icepak`` class. + +.. currentmodule:: ansys.aedt.core.visualization.post.monitor_icepak + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + Monitor + + +The ``field_summary`` module includes the classes listed below to the ``Icepak`` field summary. + +.. currentmodule:: ansys.aedt.core.visualization.post.field_summary + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + FieldSummary + + +Additional tools +~~~~~~~~~~~~~~~~ + +Finally, users can use additional AEDT postprocessing tools like SPiSim: + +.. currentmodule:: ansys.aedt.core.visualization.post.spisim + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + SpiSim + + +.. currentmodule:: ansys.aedt.core.visualization.post.spisim_com_configuration_files.com_parameters + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + COMParameters + COMParametersVer3p4 + + +If you are looking for Virtual Compliance post processing, you should use this set of features: + +.. currentmodule:: ansys.aedt.core.visualization.post.compliance + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + VirtualComplianceGenerator + VirtualCompliance \ No newline at end of file diff --git a/doc/source/API/visualization/report.rst b/doc/source/API/visualization/report.rst new file mode 100644 index 00000000000..d922cd08990 --- /dev/null +++ b/doc/source/API/visualization/report.rst @@ -0,0 +1,81 @@ +Report management +================= + +AEDT provides extensive flexibility for generating reports. + + +PyAEDT includes dedicated classes to manipulate all report properties, +offering full control over report customization. + +.. note:: + Some functionalities are available only when AEDT is running + in graphical mode. + + +.. currentmodule:: ansys.aedt.core.visualization.report + +.. autosummary:: + :toctree: _autosummary + :nosignatures: + + standard.Standard + standard.Spectral + field.AntennaParameters + field.Fields + field.NearField + field.FarField + field.Emission + eye.EyeDiagram + eye.AMIConturEyeDiagram + eye.AMIEyeDiagram + emi.EMIReceiver + + +The following code shows how to use report modules in standalone mode. + +.. code:: python + + # Create `Mag_E` report in a polyline + + from ansys.aedt.core import Hfss + from ansys.aedt.core.visualization.report.field import Fields + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = Fields(app=app, report_category="Fields", + setup_name=setup.name + " : LastAdaptive", + expressions="Mag_E") + report.polyline = p1.name + report.create() + + app.release_desktop(False, False) + + +You can use these classes directly from the application object: + +.. code:: python + + # Create `Mag_E` report in a polyline + + from ansys.aedt.core import Hfss + + app = Hfss(specified_version="2024.2", + non_graphical=False, + new_desktop_session=False + ) + test_points = [["0mm", "0mm", "0mm"], ["100mm", "20mm", "0mm"], + ["71mm", "71mm", "0mm"], ["0mm", "100mm", "0mm"]] + p1 = app.modeler.create_polyline(test_points) + setup = app.create_setup() + + report = app.post.reports_by_category.fields("Mag_E", setup.name + " : LastAdaptive", p1.name) + report.create() + + app.release_desktop(False, False) diff --git a/doc/source/Getting_started/About.rst b/doc/source/Getting_started/About.rst new file mode 100644 index 00000000000..5f42b245b34 --- /dev/null +++ b/doc/source/Getting_started/About.rst @@ -0,0 +1,86 @@ +About PyAnsys and AEDT +====================== + +PyAnsys +------- + +PyAEDT is part of the larger `PyAnsys `_ +effort to facilitate the use of Ansys technologies directly from Python. + +PyAEDT is intended to consolidate and extend all existing +functionalities around scripting for AEDT to allow reuse of existing code, +sharing of best practices, and increased collaboration. + + +About AEDT +---------- + +`AEDT `_ is a platform that enables true +electronics system design. AEDT provides access to the Ansys gold-standard +electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell, +Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. + +In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid, +and mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_collage.jpg + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + + +PyAEDT is licensed under the `MIT License +`_. + +PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products: + +- HFSS and HFSS 3D Layout +- Icepak +- Maxwell 2D, Maxwell 3D, and RMXprt +- 2D Extractor and Q3D Extractor +- Mechanical +- Nexxim +- EDB +- Twin Builder + + +Dependencies +------------ +To run PyAEDT, you must have a local licensed copy of AEDT. +PyAEDT supports AEDT versions 2022 R2 and later. + +Student version +--------------- + +PyAEDT supports AEDT Student versions 2022 R2 and later. For more information, see the +`Ansys Electronics Desktop Student - Free Software Download `_ page on the Ansys website. + + +Why PyAEDT? +----------- +A quick and easy approach for automating a simple operation in the +AEDT UI is to record and reuse a script. However, here are some disadvantages of +this approach: + +- Recorded code is dirty and difficult to read and understand. +- Recorded scripts are difficult to reuse and adapt. +- Complex coding is required by many global users of AEDT. + +Here are the main advantages that PyAEDT provides: + +- Automatic initialization of all AEDT objects, such as desktop + objects like the editor, boundaries, and more +- Error management +- Log management +- Variable management +- Compatibility with IronPython (limited) and CPython +- Simplification of complex API syntax using data objects while + maintaining PEP8 compliance. +- Code reusability across different solvers +- Clear documentation on functions and API +- Unit tests of code to increase quality across different AEDT versions + diff --git a/doc/source/Getting_started/ClientServer.rst b/doc/source/Getting_started/ClientServer.rst new file mode 100644 index 00000000000..712a1bb6cb9 --- /dev/null +++ b/doc/source/Getting_started/ClientServer.rst @@ -0,0 +1,93 @@ +Client-server +============= +You can launch PyAEDT on a remote machine if these conditions are met: + +- AEDT and PyAEDT is installed on client and server machines. +- The same Python version is used on the client and server machines. (CPython 3.8+ + is embedded in the AEDT installation.) + +gRPC connection in AEDT 2022 R2 and later +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In AEDT 2022 R2 and later, PyAEDT fully supports the gRPC API (except for EDB): + +.. code:: python + + # Launch the latest installed version of AEDT in graphical mode. + from ansys.aedt.core import Hfss + from ansys.aedt.core import settings + settings.use_grpc_api=True + hfss = Hfss(machine="fullmachinename", port=portnumber) + +If the ``machine`` argument is provided and the machine is a remote machine, AEDT +must be up and running on the remote server listening on the specified port ``portnumber``. + +To start AEDT in listening mode on the remote machine: + +.. code:: + + path/to/ANSYSEM/v222/Win64/ansysedt.exe -grpcsrv portnumber #windows + path/to/ANSYSEM/v222/Lin64/ansysedt -grpcsrv portnumber #linux + +If the connection is local, the ``machine`` argument must be left empty. PyAEDT then +starts the AEDT session automatically. Machine and port arguments are available to +all applications except EDB. + + +PyAEDT remote service manager +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PyAEDT includes a service manager that can be run on the server machine and can be +launched on-demand in AEDT sessions and act as a file manager. +You can make a remote application call on a CPython server +or any Windows client machine in AEDT 2022 R2 and later. + +On a CPython Server run the ``pyaedt_service_manager`` service that listens on port 17878 +for incoming requests of connections from clients. The port is configurable. +Requirements: + +- Python 3.8+ Virtual Environment. +- pyaedt > 0.6.0 + +On Linux, in addition to the preceding requirements, these environments are needed: +- You can use the CPython version in the AEDT installation folder if you first +add the Python library folder to the ``LD_LIBRARY_PATH`` environment variable. +- You can use the Python 3.8 or later version that is installed. +- You can export ``ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64``. +- You can export ``LD_LIBRARY_PATH=$ANSYSEM_ROOT242/common/mono/Linux64/lib:$ANSYSEM_ROOT242/Delcross:$LD_LIBRARY_PATH``. + +On the server, the ``pyaedt_service_manager`` service listen for incoming connections: + +.. code:: python + + # Launch PyAEDT remote server on CPython + from ansys.aedt.core.common_rpc import pyaedt_service_manager + pyaedt_service_manager() + + +On any client machine, the user must establish the connection as shown in following example. +AEDT can be launched directly while creating the session or after the connection is established. + +.. code:: python + + from ansys.aedt.core.common_rpc import create_session + # User can establish the connection and start a new AEDT session + cl1 = create_session("server_name", launch_aedt_on_server=True, aedt_port=17880, non_graphical=True) + + # Optionally AEDT can be launched after the connection is established + cl2 = create_session("server_name", launch_aedt_on_server=False) + cl2.aedt(port=17880, non_graphical=True) + + +Once AEDT is started then user can connect an application to it. + +.. code:: python + + hfss = Hfss(machine=cl1.server_name, port=cl1.aedt_port) + # your code here + +The client can be used also to upload or download files from the server. + +.. code:: python + + cl1.filemanager.upload(local_path, remote_path) + file_content = cl1.open_file(remote_file) + diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst new file mode 100644 index 00000000000..b62237fa983 --- /dev/null +++ b/doc/source/Getting_started/Contributing.rst @@ -0,0 +1,206 @@ +.. _contributing_aedt: + +========== +Contribute +========== +Overall guidance on contributing to a PyAnsys repository appears in +`Contribute `_ +in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar +with this guide, paying particular attention to `Guidelines and Best Practices +`_, before attempting +to contribute to PyAEDT. + +The following contribution information is specific to PyAEDT. + +Clone the repository +-------------------- +To clone and install the latest version of PyAEDT in +development mode, run: + +.. code:: + + git clone https://github.com/ansys/pyaedt + cd pyaedt + python -m pip install --upgrade pip + pip install -e . + +Post issues +----------- +Use the `PyAEDT Issues `_ +page to submit questions, report bugs, and request new features. + +To reach the product support team, email `pyansys.core@ansys.com `_. + +View PyAEDT documentation +------------------------- +Documentation for the latest stable release of PyAEDT is hosted at +`PyAEDT Documentation `_. + +In the upper right corner of the documentation's title bar, there is an option +for switching from viewing the documentation for the latest stable release +to viewing the documentation for the development version or previously +released versions. + +Code style +---------- +PyAEDT complies with the `PyAnsys code style +`_. +`pre-commit `_ is applied within the CI/CD to ensure compliance. +The ``pre-commit`` Python package can be installed +and run as follows: + +.. code:: bash + + pip install pre-commit + pre-commit run --all-files + +You can also install this as a pre-commit hook with: + +.. code:: bash + + pre-commit install + +This way, it's not possible for you to push code that fails the style checks. +For example:: + + $ pre-commit install + $ git commit -am "Add my cool feature." + black....................................................................Passed + isort (python)...........................................................Passed + flake8...................................................................Passed + codespell................................................................Passed + debug statements (python)................................................Passed + trim trailing whitespace.................................................Passed + Validate GitHub Workflows................................................Passed + blacken-docs.............................................................Passed + +Naming conventions +~~~~~~~~~~~~~~~~~~ +Consistency of names helps improve readability and +ease of use. Starting with release 0.8 a concerted effort +has been made to +improve consistency of naming and adherence to +:ref:`PEP-8`_. + +For example, methods used to create or access entities in +AEDT require that a name be passed to the method or function +as an argument. +It is tempting to +include context as part of that variable name. For example, while it is tempting to use +``setupname`` +as an argument to :meth:`Hfss.create_setup`_, +the context "setup" is +explicitly defined by the method name. The variable ``name`` provides +a more compact +description of the variable in this context. + +In previous PyAEDT versions, you can also find both ``setup_name`` and ``setupname`` used +for various methods or classes. +Improving naming consistency improves maintainability and readability. + +The following table illustrates the recommended conventions: + +.. list-table:: Keywords and object names + :widths: 25 25 50 + :header-rows: 1 + + * - Old name + - New name + - Example + * - ``setupname``, ``setup_name``, ``sweepname`` + - ``name`` + - ``Hfss.create_setup()``, ``Hfss.create_linear_step_sweep()`` + * - ``usethickness`` + - ``thickness`` + - ``Hfss.assign_coating()`` + * - ``entities`` + - ``assignment`` + - ``Maxwell.assign_current_density()`` + * - ``entity_list`` + - ``assignment`` + - ``Maxwell.assign_symmetry()`` + +Take care to use descriptive names for +variables and classes that adhere to PEP-8 and are consistent with conventions already +used in PyAEDT. + +Log errors +~~~~~~~~~~ +PyAEDT has an internal logging tool named ``Messenger`` +and a log file that is automatically generated in the project +folder. + +The following examples demonstrate how ``Messenger`` is used to +write both to the internal AEDT message windows and the log file: + +.. code:: python + + self.logger.error("This is an error message.") + self.logger.warning("This is a warning message.") + self.logger.info("This is an info message.") + +These examples demonstrate how to write messages only to the log file: + +.. code:: python + + self.logger.error("This is an error message.") + self.logger.warning("This is a warning message.") + self.logger.info("This is an info message.") + + +Handle exceptions +~~~~~~~~~~~~~~~~~ +PyAEDT uses a specific decorator, ``@pyaedt_function_handler``, +to handle exceptions caused by methods and by the AEDT API. +This exception handler decorator makes PyAEDT fault tolerant +to errors that can occur in any method. + +For example: + +.. code:: python + + @pyaedt_function_handler() + def my_method(self, var): + pass + +Every method can return a value of ``True`` when successful or +``False`` when failed. When a failure occurs, the error +handler returns information about the error in both the console and +log file. + +Here is an example of an error: + +.. code:: + + ---------------------------------------------------------------------------------- + PyAEDT error on method create_box: General or AEDT error. Check again + the arguments provided: + position = [0, 0, 0] + dimensions_list = [0, 10, 10] + name = None + material = None + ---------------------------------------------------------------------------------- + + (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147024381), None) + File "C:\GIT\repos\AnsysAutomation\PyAEDT\Primitives.py", line 1930, in create_box + o.name = self.oeditor.createbox(vArg1, vArg2) + + ************************************************************ + Method Docstring: + + Create a box. + + Parameters + ---------- + ... + + +Hard-coded values +~~~~~~~~~~~~~~~~~~ +Do not write hard-coded values to the registry. Instead, use the Configuration service. + +Maximum line length +~~~~~~~~~~~~~~~~~~~ +Best practice is to keep the length at or below 120 characters for code, +and comments. Lines longer than this might not display properly on some terminals +and tools or might be difficult to follow. diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst new file mode 100644 index 00000000000..ff37cae9cc9 --- /dev/null +++ b/doc/source/Getting_started/Installation.rst @@ -0,0 +1,197 @@ +Installation +============ +PyAEDT consolidates and extends all existing capital around scripting for AEDT, +allowing re-use of existing code, sharing of best practices, and collaboration. + +This PyAnsys library has been tested on HFSS, Icepak, and Maxwell 3D. It also provides +basic support for EDB and Circuit (Nexxim). + +Requirements +~~~~~~~~~~~~ +In addition to the runtime dependencies listed in the installation information, PyAEDT +requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Version is also supported. + + +Install from PyAEDT installer +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following python script automatically installs PyAEDT from AEDT, +using the CPython interpreter included in the AEDT installation. + +In order to do that you can: + +- Download the following file: :download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>` + +- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. + +- Offline install is also possible using wheelhouses. + +.. note:: + A wheelhouse is a zip containing all needed packages that can be installed offline. + PyAEDT wheelhouse can be found at `Releases `_. + After downloading the wheelhouse zip specific for your distribution and Python release, + run the script from Electronics Desktop using the zip full path as argument. + Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2 + and higher requires the Python 3.10 wheelhouse. + +.. image:: ../Resources/wheelhouse_installation.png + :width: 800 + :alt: PyAEDT run script + +Starting from 2023R2, buttons are available in the Automation Tab as in the example below. + +.. image:: ../Resources/toolkits_ribbon.png + :width: 800 + :alt: PyAEDT toolkit buttons available in AEDT + + +Extension manager +~~~~~~~~~~~~~~~~~ +The user can install or uninstall automated workflows using the extension manager. +There are three options: + +- **Pre-installed extensions** already available in the PyAEDT library. + +- **Open source PyAEDT toolkits** described in the `PyAEDT Common Toolkit documentation `_. + +- **Custom PyAEDT extensions**. + +See `Extension Manager `_ for more information. + +.. image:: ../Resources/toolkit_manager_1.png + :width: 800 + :alt: PyAEDT toolkit manager 1 + +The user can select the AEDT application to install the specific workflow. + +.. image:: ../Resources/toolkit_manager_2.png + :width: 400 + :alt: PyAEDT toolkit manager 2 + +For additional information about AEDT extensions, +see `Extensions `_. + + +Install on CPython from PyPI +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +You can install PyAEDT on CPython from PyPI: + +.. code:: python + + pip install pyaedt + +You can also install PyAEDT from Conda-Forge: + +.. code:: python + + conda install -c conda-forge pyaedt + +To ensure you have all the necessary dependencies, including optional components, use the following command: + +.. code:: python + + pip install pyaedt[all] + +If you are not utilizing gRPC, you can install the required dotnet dependencies separately: + +.. code:: python + + pip install pyaedt[dotnet] + +If you want to install the PyAEDT panels in the AEDT Automation tab, use the following command: + +.. code:: python + + pip install pyaedt[installer] + +Finally, in the python console, run the following commands: + +.. code:: + + from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt + add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") + +You can also install the PyAEDT panels using the following steps, this is also useful if you have a centralized PyAEDT installation: + +- Download the following file: :download:`PyAEDT panel Installer Python file <../Resources/toolkit_installer_from_aedt.py>` + +- Define an environment variable called `PYAEDT_INTERPRETER` with the path of the python interpreter in which PyAEDT is installed. + +- Open an Electronics Desktop Session and click on Tools->Run Script and execute the file. You do not need the previous step if +you pass as an argument the path of the python interpreter. + + +Linux support +~~~~~~~~~~~~~ + +PyAEDT works with CPython 3.8 through 3.12 on Linux in AEDT 2022 R2 and later. +However, you must set up the following environment variables: + +.. code:: + + export ANSYSEM_ROOT222=/path/to/AedtRoot/AnsysEM/v222/Linux64 + export LD_LIBRARY_PATH=$ANSYSEM_ROOT222/common/mono/Linux64/lib64:$ANSYSEM_ROOT222/Delcross:$LD_LIBRARY_PATH + + +Install offline from a wheelhouse +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Using a wheelhouse can be helpful if you work for a company that restricts access to external networks. + +Wheelhouses for CPython 3.8, 3.9, 3.10, 3.11, and 3.12 are available in the releases for both Windows and Linux. +From the `Releases `_ +page in the PyAEDT repository, you can find the wheelhouses for a particular release in its +assets and download the wheelhouse specific to your setup. + +There are two kind of wheelhouses: `all` and `installer`. + +The `all` wheelhouse contains all PyAEDT dependencies. And the `installer` one includes `ipython` and `jupyter lab`. + +You can then install PyAEDT and all of its dependencies from one single entry point that can be shared internally, +which eases the security review of the PyAEDT package content. + +For example, on Windows with Python 3.10, install PyAEDT and all its dependencies from a wheelhouse with code like this: + +.. code:: + + pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[all] + +If you want to add the PyAEDT panels in the AEDT Automation tab, you need first to install the installer dependencies: + +.. code:: + + pip install --no-cache-dir --no-index --find-links=file:////PyAEDT-v-wheelhouse-Windows-3.10 pyaedt[installer] + +Finally, in the python console, run the following commands: + +.. code:: + + from ansys.aedt.core.workflows.installer.pyaedt_installer import add_pyaedt_to_aedt + add_pyaedt_to_aedt(“your_aedt_version", r“path_to_personalib") + + +Install PyAEDT in Conda virtual environment +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Create virtual environment + +.. code:: bash + + conda create --name pyaedt_py310 python=3.10 + +Activate virtual environment + +.. code:: bash + + conda activate pyaedt_py310 + +You can also install PyAEDT from Conda-Forge with this command: + +.. code:: bash + + conda install -c conda-forge pyaedt + + +Upgrade PyAEDT to the latest version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code:: bash + + pip install -U pyaedt diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst new file mode 100644 index 00000000000..1d62085640f --- /dev/null +++ b/doc/source/Getting_started/Troubleshooting.rst @@ -0,0 +1,201 @@ +Troubleshooting +=============== +This section contains common issues and suggestions related to installation and use of PyAEDT. + +Installation +~~~~~~~~~~~~ + +Error installing Python or Conda +-------------------------------- +Sometimes companies do not allow installation of a Python interpreter. +In this case, you can use the Python interpreter available in the AEDT installation. + +.. note:: + + Python 3.7 is available in AEDT 2023 R1 and earlier. Python 3.10 is available in AEDT 2023 R2. + +Here is the path to the Python 3.10 interpreter for the 2024 R2 installation: + +.. code:: python + + path\to\AnsysEM\v242\commonfiles\CPython\3_10\winx64\Release\python" + + +Error installing PyAEDT using pip +--------------------------------- +- **Proxy server**: If your company uses a proxy server, you may have to update proxy + settings at the command line. For more information, see the `Using a Proxy + Server `_ in the pip + documentation. +- **Install permission**: Make sure that you have write access to the directory where the + Python interpreter is + installed. The use of a `virtual environment `_ helps + mitigate this issue by placing the Python interpreter and dependencies in a location that is owned + by the user. +- **Firewall**: Some corporate firewalls may block pip. If you face this issue, you'll have to work with your IT + administrator to enable pip. The proxy server settings (described earlier) allow you to explicitly define + the ports used by pip. + +If downloads from `pypi `_ are not allowed, you may use a +`wheelhouse `_. +The wheelhouse file contains all dependencies for PyAEDT and allows full installation without a need to +download additional files. +The wheelhouse for PyAEDT can be found `here `_. +After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and +run the Python command: + +.. code:: python + + >>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyaedt + + +Another option to install PyAEDT from the wheelhouse is to download the following file +:download:`PyAEDT Installer Python file <../Resources/pyaedt_installer_from_aedt.py>`. +Run this script directly from AEDT and pass the wheelhouse file name as an argument. + + + + +Run PyAEDT +~~~~~~~~~~ + +COM and gRPC +------------ +Prior to the 2022 R2 release, CPython automation in AEDT used +`COM `_ , which +requires all interfaces to be registered in the Windows Registry. +Communication between Python and the AEDT API were translated through an intermediate layer using +`pywin32 `_ and `PythonNET `_. + +`gRPC `_ is a modern open source high performance Remote Procedure Call (RPC) +framework that can run in any environment and supports client/server remote calls. +Starting from 2022R2 the AEDT API has replaced the COM interface with a gRPC interface. + + +.. list-table:: *gRPC Compatibility:* + :widths: 65 65 65 + :header-rows: 1 + + * - < 2022 R2 + - 2022 R2 + - > 2022 R2 + * - Only ``Python.NET`` + - | ``Python.NET``: *Default* + | Enable gRPC: ``ansys.aedt.core.settings.use_grpc_api = True`` + - | gRPC: *Default* + | Enable ``Python.NET``: ``ansys.aedt.core.settings.use_grpc_api = False`` + +The options shown here apply only to the Windows platform. +On Linux, the Python interface to AEDT uses gRPC for all versions. + +.. _GRPC ref: + +Check the AEDT API configuration +-------------------------------- +Run the following command to start AEDT as a gRPC server: + +*Windows:* + +.. code:: console + + path\to\AnsysEM\v231\Win64\ansysedt.exe -grpcsrv 50001 + +**On Linux:** + +.. code:: console + + path\to\AnsysEM\v231\Lin64\ansysedt -grpcsrv 50352 + +The server port number is used by AEDT to listen and receive +commands from the PyAEDT client. This configuration +supports multiple sessions of AEDT running on a single server +and listening on the same port. + +Check the gRPC interface +------------------------ +The native Electronics Desktop API can be used to launch +AEDT from the command line. +PyAEDT is not required to verify the setup for the server and ensure that +all environment +variables have been defined correctly. + +.. code:: python + + import sys + sys.path.append(r"ANSYSEM_ROOT231\PythonFiles\DesktopPlugin") + import ScriptEnv + print(dir()) + ScriptEnv.Initialize("", False, "", 50051) + print(dir()) + + + +Failure connecting to the gRPC server +------------------------------------- +On Linux, PyAEDT may fail to initialize a new instance of the gRPC server +or connect to an existing server session. +This may be due to: + +- Firewall +- Proxy +- Permissions +- License +- Scheduler (for example if the gRPC server was started from LSF or Slurm) + +For issues related to use of a proxy server, you may set the following environment variable to +disable the proxy server for the *localhost*. + +.. code:: console + + export no_proxy=localhost,127.0.0.1 + +Run your PyAEDT script. + +If it still fails, you can disable the proxy server: + +.. code:: console + + export http_proxy= + +Run your PyAEDT script. If the errors persist, perform these steps: + +1. Check that AEDT starts correctly from the command line by + starting the :ref:`gRPC server`. +2. Enable debugging. + +.. code:: console + + export ANSOFT_DEBUG_LOG=/tmp/testlogs/logs/lg + export ANSOFT_DEBUG_LOG_SEPARATE=1 + export ANSOFT_DEBUG_LOG_TIMESTAMP=1 + export ANSOFT_DEBUG_LOG_THREAD_ID=1 + export ANSOFT_DEBUG_MODE=3 + + +Enable the gRPC trace on the server: + +.. code:: console + + export GRPC_VERBOSITY=DEBUG + export GRPC_TRACE=all + +Then run ansysedt.exe as a gRPC server and redirect the output. + +.. code:: console + + ansysedt -grpcsrv 50051 > /path/to/file/server.txt + +The preceding command redirects the gRPC trace +to the file ``server.txt``. + +Open another terminal window to trace the +gRPC calls on the client where the Python script is to be run. + +.. code:: console + + export GRPC_VERBOSITY=DEBUG + export GRPC_TRACE=all + +Now run the PyAEDT script, (making sure it connects to the same port as the gRPC server - 50051). +Capture the output in a file. For example *client.txt*. Then send all the logs +to `Ansys Support `_. diff --git a/doc/source/Getting_started/index.rst b/doc/source/Getting_started/index.rst new file mode 100644 index 00000000000..a981d1a5f83 --- /dev/null +++ b/doc/source/Getting_started/index.rst @@ -0,0 +1,132 @@ +Getting started +=============== + +.. grid:: 2 + + .. grid-item-card:: About PyAnsys and AEDT + :link: About + :link-type: doc + :margin: 2 2 0 0 + + Learn more about PyAnsys and AEDT. + + .. grid-item-card:: Installation + :link: Installation + :link-type: doc + :margin: 2 2 0 0 + + Learn how to install PyAEDT from PyPi or Conda. + + .. grid-item-card:: User guide + :link: ../User_guide/index + :link-type: doc + :margin: 2 2 0 0 + + This section provides in-depth information on PyAEDT key concepts. + + .. grid-item-card:: Client-Server + :link: ClientServer + :link-type: doc + :margin: 2 2 0 0 + + Launch PyAEDT on a client machine and control Electronics Desktop + on a remote server. + + .. grid-item-card:: Versions and interfaces + :link: versioning + :link-type: doc + :margin: 2 2 0 0 + + Discover the compatibility between PyAEDT and Ansys AEDT versions. + + .. grid-item-card:: Troubleshooting + :link: Troubleshooting + :link-type: doc + :margin: 2 2 0 0 + + Any questions? Refer to Q&A before submitting an issue. + + +What is PyAEDT? +--------------- +PyAEDT is a Python library that interacts directly with the API for +Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture +for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, +and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides +support for Circuit tools like Nexxim and system simulation tools like +Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout +tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures +simplify operation while reusing information as much as possible across +the API. + +To run PyAEDT, you must have a licensed copy of Ansys Electronics +Desktop (AEDT) installed. + +The Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design. +`AEDT `_ provides access to the Ansys gold-standard +electro-magnetics simulation solutions such as Ansys HFSS, +Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and +Mechanical CAD (MCAD) workflows. +In addition, it includes direct links to the complete Ansys portfolio of thermal, fluid, +and Mechanical solvers for comprehensive multiphysics analysis. +Tight integration among these solutions provides unprecedented ease of use for setup and +faster resolution of complex simulations for design and optimization. + +.. image:: ../Resources/aedt_3.png + :width: 800 + :alt: AEDT Applications + :target: https://www.ansys.com/products/electronics + +For more information, see `Ansys Electronics `_ +on the Ansys website. + +PyAEDT cheat sheets +------------------- + +PyAEDT cheat sheets introduce the basics that you need to use PyAEDT. +These one-page references providing syntax rules and commands +for using PyAEDT API and EDB API: + +**PyAEDT cheat sheet:** `PyAEDT API `_ + +**EDB cheat sheet:** `EDB API `_ + + +Get help +-------- + +**Development issues:** For PyAEDT development-related matters, see the +`PyAEDT Issues `_ page. +You can create issues to report bugs and request new features. + +**User questions:** The best way to get help is to post your question on the `PyAEDT Discussions +`_ page or the `Discussions `_ +page on the Ansys Developer portal. You can post questions, share ideas, and get community feedback. + + +License +------- +PyAEDT is licensed under the MIT license. + +PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the +functionality of AEDT by adding a Python interface to AEDT without changing the +core behavior or license of the original software. The use of PyAEDT requires a +legally licensed local copy of AEDT. + +To get a copy of AEDT, see the `Ansys Electronics `_ +page on the Ansys website. + + + +.. toctree:: + :hidden: + :maxdepth: 2 + + Installation + Troubleshooting + ../User_guide/index + ClientServer + versioning + Contributing + About + diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst new file mode 100644 index 00000000000..f0c872ffa64 --- /dev/null +++ b/doc/source/Getting_started/versioning.rst @@ -0,0 +1,78 @@ +.. _versions_and_interfaces: + +======================= +Versions and interfaces +======================= + +The PyAEDT project attempts to maintain compatibility with legacy +versions of AEDT while allowing for support of faster and better +interfaces with the latest versions of AEDT. + +There are two interfaces PyAEDT can use to connect to AEDT. +You can see a table with the AEDT version and the supported interfaces +in `Table of supported versions `_ + + +gRPC interface +============== + +This is the default and preferred interface to connect to AEDT. +Ansys 2022 R2 and later support the latest gRPC interface, allowing +for remote management of AEDT with rapid streaming of mesh, results, +and files from the AEDT service. + + +Legacy interfaces +================= + +COM interface +-------------- + +AnsysEM supports the legacy COM interface, enabled with the settings option. + +This interface works only on Windows and uses .NET COM objects. + + +.. code:: python + + + from ansys.aedt.core import settings + + settings.use_grpc_api = False + + + +Compatibility between AEDT and interfaces +========================================= + +The following table shows the supported versions of Ansys EDT and the recommended interface for each one of them in PyAEDT. + + +**Table of supported versions** + +.. _table_versions: + ++---------------------------+------------------------+-----------------------------------------------+ +| Ansys Version | Recommended interface | Support | +| | +-----------------------+-----------------------+ +| | | gRPC | COM | ++===========================+========================+=======================+=======================+ +| AnsysEM 2024 R1 | gRPC | YES | NO* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2023 R2 | gRPC | YES | YES* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2023 R1 | gRPC | YES | YES* | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2022 R2 | gRPC | YES* | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2022 R1 | gRPC | NO | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ +| AnsysEM 2021 R2 | gRPC | NO | YES | ++---------------------------+------------------------+-----------------------+-----------------------+ + +Where: + +* YES means that the interface is supported and recommended. +* YES* means that the interface is supported, but not recommended. Their support might be dropped in the future. +* NO means that the interface is not supported. +* NO* means that the interface is still supported but it is deprecated. diff --git a/doc/source/index.rst b/doc/source/index.rst index 746275cd105..32528e3a1a9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,12 +24,32 @@ enabling straightforward and efficient automation in your workflow. .. grid:: 2 + .. grid-item-card:: Getting started :fa:`person-running` + :link: Getting_started/index + :link-type: doc + + New to PyAEDT? This section provides the information that you need to get started with PyAEDT. + .. grid-item-card:: User guide :fa:`book-open-reader` :link: User_guide/index :link-type: doc This section provides in-depth information on PyAEDT key concepts. +.. grid:: 2 + + .. grid-item-card:: API reference :fa:`book-bookmark` + :link: API/index + :link-type: doc + + This section contains descriptions of the functions and modules included in PyAEDT. + It describes how the methods work and the parameters that can be used. + + .. grid-item-card:: Examples :fa:`scroll` + :link: https://examples.aedt.docs.pyansys.com/ + + Explore examples that show how to use PyAEDT to perform different types of simulations. + .. grid:: 2 .. grid-item-card:: Contribute :fa:`people-group` @@ -43,5 +63,7 @@ enabling straightforward and efficient automation in your workflow. :hidden: + Getting_started/index User_guide/index + API/index Examples From ac898c8cf16c668655d219a5c59b35998500abe2 Mon Sep 17 00:00:00 2001 From: Samuelopez-ansys Date: Tue, 19 Nov 2024 15:41:50 +0100 Subject: [PATCH 7/8] Fix cheatsheet --- doc/source/cheatsheet/cheat_sheet.qmd | 46 +++++++++++++++++---------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd index 211652d17b2..1ddeffc5607 100644 --- a/doc/source/cheatsheet/cheat_sheet.qmd +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -33,35 +33,42 @@ jupyter: name: python3 --- -# Launch PyAEDT +# Launch AEDT -Open a Desktop session and run HFSS +Open a Desktop session in graphical mode, open a project and connect to an active design: +```{python} +#| eval: false +from ansys.aedt.core import Desktop +desktop = Desktop(version="2024.2", new_desktop=True, non_graphical=False, close_on_exit=True) +app = desktop.load_project(project_file="project_path") +``` + +Open a Desktop session in non-graphical mode and create a new HFSS design: ```{python} #| eval: false from ansys.aedt.core import Desktop, Hfss -desktop = Desktop(version="2024.2", close_on_exit=True) -hfss = Hfss(new_desktop=False, project="project_name", design="design_name") +desktop = Desktop(version="2024.2", new_desktop=True, non_graphical=True, close_on_exit=True) +app = Hfss() ``` -Connect to a running application with given project name and design name +Connect to a running application with given project name and design name: ```{python} #| eval: false from ansys.aedt.core.generic.design_types import get_pyaedt_app app = get_pyaedt_app(project_name="project_name", design="design_name") ``` -Launch an application directly +Launch an application directly: ```{python} #| eval: false -from ansys.aedt.core import Hfss -# Run the application in non graphical mode -hfss = Hfss(non_graphical=True, project="project_name", design="design_name") +from ansys.aedt.core import Maxwell3d +app = Maxwell3d() ``` # Close the active AEDT session ```{python} #| eval: false -hfss.release_desktop(close_projects=True, close_on_exit=True) +app.release_desktop(close_projects=True, close_on_exit=True) ``` # Work with variables @@ -92,11 +99,11 @@ material.permeability = 1.5 ``` # Create and manipulate your geometry -Create a box from an anchor and edge sizes: +Create a box and get object name: ```{python} #| eval: false box = hfss.modeler.create_box([1,1,1], [5,2,5], name="box", material="FR4_epoxy") -rectangle = hfss.modeler.create_rectangle([1,1,1], [5,2], name="rectangle", material="Copper") +box.name ``` Access edges or vertices data: @@ -134,7 +141,6 @@ Analyze the solution setup hfss.analyze(cores=4) ``` - # Post processing Post processing can be performed within and outside AEDT. @@ -158,19 +164,25 @@ field_plot = hfss.post.create_fieldplot_volume( image_path = field_plot.export_image( r"C:\\workdir\\my_image.png") ``` -Generate 2D/3D plots or PDF files using third-party packages + +Generate 2D/3D plots using third-party packages ```{python} #| eval: false -# Plot the box hfss.post.plot_model_obj(objects=["box"], show_grid=True) +``` -# Plot solution data +Get solution data +```{python} +#| eval: false plot_data = hfss.get_traces_for_plot() report = hfss.post.create_report(plot_data) solution = report.get_solution_data() plt = solution.plot(solution.expressions) +``` -# Save postprocessing output in PDF file +Generate PDF files using third-party packages +```{python} +#| eval: false from ansys.aedt.core.visualization.plot.pdf import AnsysReport pdf_report = AnsysReport( project_name=hfss.project_name, From 7577b39c60d685a27518d118339cd3de4b07c91f Mon Sep 17 00:00:00 2001 From: Samuelopez-ansys Date: Wed, 20 Nov 2024 14:33:01 +0100 Subject: [PATCH 8/8] Fix cheatsheet --- doc/source/cheatsheet/cheat_sheet.qmd | 37 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd index 1ddeffc5607..d45473e2fa5 100644 --- a/doc/source/cheatsheet/cheat_sheet.qmd +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -35,20 +35,29 @@ jupyter: # Launch AEDT +Launch an AEDT application directly: + +```{python} +#| eval: false +from ansys.aedt.core import Hfss +app = Hfss() +``` + Open a Desktop session in graphical mode, open a project and connect to an active design: + ```{python} #| eval: false from ansys.aedt.core import Desktop desktop = Desktop(version="2024.2", new_desktop=True, non_graphical=False, close_on_exit=True) -app = desktop.load_project(project_file="project_path") +app = desktop.load_project( project_file="project_path") ``` -Open a Desktop session in non-graphical mode and create a new HFSS design: +Open a Desktop session in non-graphical mode and create a new Maxwell 3D design: ```{python} #| eval: false -from ansys.aedt.core import Desktop, Hfss +from ansys.aedt.core import Desktop, Maxwell3d desktop = Desktop(version="2024.2", new_desktop=True, non_graphical=True, close_on_exit=True) -app = Hfss() +app = Maxwell3d() ``` Connect to a running application with given project name and design name: @@ -58,20 +67,15 @@ from ansys.aedt.core.generic.design_types import get_pyaedt_app app = get_pyaedt_app(project_name="project_name", design="design_name") ``` -Launch an application directly: -```{python} -#| eval: false -from ansys.aedt.core import Maxwell3d -app = Maxwell3d() -``` - # Close the active AEDT session + ```{python} #| eval: false app.release_desktop(close_projects=True, close_on_exit=True) ``` # Work with variables + Create a variable that only applies to this design: ```{python} #| eval: false @@ -89,6 +93,7 @@ hfss.variable_manager.variables ``` # Handle your materials + Add a new material with custom properties: ```{python} #| eval: false @@ -98,12 +103,12 @@ material.conductivity = 450000 material.permeability = 1.5 ``` -# Create and manipulate your geometry +# Create and manipulate geometry Create a box and get object name: ```{python} #| eval: false box = hfss.modeler.create_box([1,1,1], [5,2,5], name="box", material="FR4_epoxy") -box.name +print(box.name) ``` Access edges or vertices data: @@ -122,19 +127,21 @@ for vertex in box.vertices: #| eval: false setup = hfss.create_setup("MySetup") setup.props["Frequency"] = "50MHz" -setup["MaximumPasses"] = 10 -hfss.create_linear_count_sweep("my_setup", "MHz", 0.1, 100, num_of_freq_points=100, name="sweep1", sweep_type="Interpolating", save_fields=False) +setup.props["MaximumPasses"] = 10 ``` + Access the parametric sweep: ```{python} #| eval: false hfss.parametrics ``` + Access the optimizations: ```{python} #| eval: false hfss.optimizations ``` + Analyze the solution setup ```{python} #| eval: false