-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHORE: Add template extension - get started (#5538)
- Loading branch information
Showing
12 changed files
with
380 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
doc/source/User_guide/pyaedt_extensions_doc/templates/getting_started.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Extension template | ||
================== | ||
|
||
Template to help the user create an extension from scratch. | ||
|
||
The extension provides a graphical user interface for configuration, or it can be used in batch mode via command line arguments. | ||
|
||
The following image shows the extension user interface: | ||
|
||
.. image:: ../../../_static/extensions/extension_template.png | ||
:width: 800 | ||
:alt: Extension template UI | ||
|
||
|
||
Features | ||
-------- | ||
|
||
- Create a sphere providing information such as the origin coordinates and radius. | ||
- Allow users to browse and select an **.aedt** file to load in AEDT. | ||
- Display name of the active project. | ||
- Support of light and dark themes for the GUI. | ||
|
||
Run the extension | ||
----------------- | ||
|
||
The extension can be run from a Python script in the following way: | ||
|
||
.. code:: python | ||
import ansys.aedt.core | ||
import os | ||
from ansys.aedt.core.workflows.templates.template_get_started import main | ||
hfss = ansys.aedt.core.Hfss() | ||
# Specify the AEDT session to connect | ||
os.environ["PYAEDT_SCRIPT_PORT"] = str(hfss.desktop_class.port) | ||
os.environ["PYAEDT_SCRIPT_VERSION"] = hfss.desktop_class.aedt_version_id | ||
main({"origin_x": 2, "radius": 6, "is_test": True}) | ||
Command line | ||
------------ | ||
|
||
The extension can also be run directly via the command line for batch processing. | ||
|
||
The script accepts the following arguments: | ||
- ``**origin_x**`` : x origin coordinate. | ||
- ``**origin_y**`` : y origin coordinate. | ||
- ``**origin_z**`` : z origin coordinate. | ||
- ``**radius**`` : radius. | ||
- ``**file_path**`` : file path to the **.aedt** file. | ||
|
||
Use the following syntax to run the extension: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
../commandline |
11 changes: 11 additions & 0 deletions
11
doc/source/User_guide/pyaedt_extensions_doc/templates/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Extension templates | ||
=================== | ||
|
||
.. grid:: 2 | ||
|
||
.. grid-item-card:: Extension getting started | ||
:link: getting_started | ||
:link-type: doc | ||
:margin: 2 2 0 0 | ||
|
||
Simple extension template to get started. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 0 additions & 71 deletions
71
src/ansys/aedt/core/workflows/templates/extension_template.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.