Skip to content

Commit

Permalink
Add extension documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Jun 26, 2024
1 parent cfdea10 commit 2e2a3b7
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ The user can select the AEDT application to install the specific workflow.
:width: 400
:alt: PyAEDT toolkit manager 2

For more extension information, see `Extensions <https://aedt.docs.pyansys.com/version/stable/User_guide/extensions.html>`_.


Install on CPython from PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Binary file modified doc/source/Resources/toolkits_ribbon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions doc/source/User_guide/extensions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Extensions
==========

PyAEDT extensions provide a simplified interface to perform automated workflows.
The user can install or uninstall these extensions using the extension manager.
For more information, see `Extension Manager <https://aedt.docs.pyansys.com/version/stable/Getting_started/Installation.html#extension-manager>`_.

Depending on the application, the user can find different extensions, the following sections describe each of them.

Extensions can be launched in standalone mode from the console or from a python script. This is described on each extension section.

Project extensions
==================

Project extension apply to all extensions that are visible to all kind of AEDT applications.

.. grid:: 2

.. grid-item-card:: Import Nastran
:link: pyaedt_extensions_doc/project
:link-type: doc

Import Nastran or STL file in any 3D modeler application.

.. toctree::
:hidden:
:maxdepth: 2

pyaedt_extensions_doc/project

HFSS extensions
===============


HFSS 3D Layout extensions

Check warning on line 35 in doc/source/User_guide/extensions.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/extensions.rst#L35

[Google.Headings] 'HFSS 3D Layout extensions' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'HFSS 3D Layout extensions' should use sentence-style capitalization.", "location": {"path": "doc/source/User_guide/extensions.rst", "range": {"start": {"line": 35, "column": 1}}}, "severity": "WARNING"}
=========================
8 changes: 8 additions & 0 deletions doc/source/User_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ For end-to-end examples, see `Examples <https://aedt.docs.pyansys.com/version/st

How to launch AEDT and create a project.

.. grid-item-card:: Extensions
:link: extensions
:link-type: doc
:margin: 2 2 0 0

How to use PyAEDT extensions.

.. grid-item-card:: Modeler
:link: modeler
:link-type: doc
Expand Down Expand Up @@ -72,6 +79,7 @@ For end-to-end examples, see `Examples <https://aedt.docs.pyansys.com/version/st
:maxdepth: 2

intro
extensions
modeler
mesh
setup
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions doc/source/User_guide/pyaedt_extensions_doc/project.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Import Nastran

Check warning on line 1 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L1

[Google.Headings] 'Import Nastran' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Import Nastran' should use sentence-style capitalization.", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}

Check failure on line 1 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L1

[Vale.Spelling] Did you really mean 'Nastran'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Nastran'?", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 1, "column": 8}}}, "severity": "ERROR"}
==============

Import Nastran or STL file in any 3D modeler application. The user can also preview the imported file and decimate it before import it.

Check failure on line 4 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L4

[Vale.Spelling] Did you really mean 'Nastran'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Nastran'?", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 4, "column": 8}}}, "severity": "ERROR"}

User can access the extension from the icon created in the Automation tab through the extension manager.
The following image is the extension user interface:

.. image:: import_nastran_ui.png
:width: 800
:alt: Import nastran UI

Check failure on line 11 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L11

[Vale.Spelling] Did you really mean 'nastran'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'nastran'?", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 11, "column": 16}}}, "severity": "ERROR"}

User can launch the user interface from the terminal:

.. code::
SET PYAEDT_SCRIPT_PORT=50051
SET PYAEDT_SCRIPT_VERSION=2024.1
python.exe path/to/pyaedt/workflows/project/import_nastran.py
The available arguments are: file_path, planar, lightweight, and decimate. These arguments can be obtained from the help:

Check failure on line 21 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L21

[Vale.Spelling] Did you really mean 'file_path'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'file_path'?", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 21, "column": 30}}}, "severity": "ERROR"}

.. code::
python.exe path/to/pyaedt/workflows/project/import_nastran.py --help
For example, you can pass the input file as an argument, and in this case the user interface is not launched:

.. code::
export PYAEDT_SCRIPT_PORT=50051
export PYAEDT_SCRIPT_VERSION=2024.1
python.exe path/to/pyaedt/workflows/project/import_nastran.py --file_path="my_file.stl"
Fianlly, the extension can be used in a python script without the user interface with the following code:

Check failure on line 35 in doc/source/User_guide/pyaedt_extensions_doc/project.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/User_guide/pyaedt_extensions_doc/project.rst#L35

[Vale.Spelling] Did you really mean 'Fianlly'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Fianlly'?", "location": {"path": "doc/source/User_guide/pyaedt_extensions_doc/project.rst", "range": {"start": {"line": 35, "column": 1}}}, "severity": "ERROR"}

.. code:: python
import pyaedt
import os
from pyaedt.workflows.project.import_nastran import main
file_path = "my_file.stl"
hfss = pyaedt.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
# Launch extension
main({"file_path": file_path, "lightweight": True, "decimate": 0.0, "planar": True, "is_test": False})

0 comments on commit 2e2a3b7

Please sign in to comment.