Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/requirements"
schedule:
interval: "daily"
labels:
- "maintenance"
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "maintenance"
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
\end{center}

\begin{center}
\small{\textbf{Version: 0.11 (stable)}} \\
\small{\textbf{Version: \input{scripts/generated_scripts/pymechanical_version.txt} (stable)}} \\
\end{center}

\AddToShipoutPicture*
Expand Down
7 changes: 2 additions & 5 deletions cheat_sheets/pymechanical_cheat_sheet/pymechanical_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
app = App(version=242)
print(app)
# BREAK BLOCK

# Extract the global API entry points (available from built-in Mechanical scripting)
# Merge them into your Python global variables
app.update_globals(globals())
Expand All @@ -83,13 +82,11 @@
Model # Application.DataModel.Project.Model
Tree # Application.DataModel.Tree
Graphics # Application.ExtAPI.Graphics

# BREAK BLOCK
file = r"D:\\Workdir\\bracket.mechdb"
app.open(file)
allbodies = DataModel.Project.Model.GetChildren(
Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory.Body,
True)
app.update_globals(globals())
allbodies = Model.GetChildren(DataModelObjectCategory.Body, True)
print(allbodies.Count)
# BREAK BLOCK
import logging
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ansys.mechanical.core==0.11.1
numpydoc==1.5.0
Sphinx==6.1.3
sphinx-copybutton==0.5.2
Expand Down
8 changes: 8 additions & 0 deletions scripts/generate_code_snippet.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ def generate_code_examples(file_path):
with open(file_path, "w") as file:
file.write(example.strip())

def version_fetch_pymechanical():
import ansys.mechanical.core as pymech
version = pymech.__version__
file_name = f"pymechanical_version.txt"
file_path = os.path.join(OUTPUT_PATH, file_name)
with open(file_path, "w") as file:
file.write(version)

if __name__ == "__main__":
parser = argparse.ArgumentParser(
Expand All @@ -40,3 +47,4 @@ def generate_code_examples(file_path):
args = parser.parse_args()

generate_code_examples(args.file_path)
version_fetch_pymechanical()