ansys / pymechanical

Pythonic interface to Ansys Mechanical ™
https://mechanical.docs.pyansys.com/
MIT License
36 stars 18 forks source link

FEAT: Add an App method to print project tree for embedding scenario #779

Closed dipinknair closed 3 months ago

dipinknair commented 3 months ago

This will help to visualize the hierarchical project structure inside mechanical since embedding is without UI

>>> import ansys.mechanical.core as mech
>>> app = mech.App()
>>> app.update_globals(globals())
>>> app.print_tree(DataModel.Project)
... ├── Project
... |  ├── Model
... |  |  ├── Geometry Imports
... |  |  ├── Geometry
... |  |  ├── Materials
... |  |  ├── Coordinate Systems
... |  |  |  ├── Global Coordinate System
... |  |  ├── Remote Points
... |  |  ├── Mesh

>>> app.print_tree(DataModel.Project, 1)
... ├── Project
... ... truncating after 1 lines
codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.30%. Comparing base (98708c9) to head (d7b3168). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #779 +/- ## ========================================== + Coverage 81.23% 81.30% +0.07% ========================================== Files 32 32 Lines 2046 2065 +19 ========================================== + Hits 1662 1679 +17 - Misses 384 386 +2 ```