Use when pre-processing FE models via Altair HyperMesh -- CAD geometry import (STEP/IGES/CATIA/NX), surface and volume meshing (automesh/tetmesh/batchmesh), element quality checks (aspect/skew/jacobian), material/property/load assignment, and solver deck export (OptiStruct/Nastran/Abaqus/LS-DYNA/Radioss) through the hm Python API in batch mode.
You are connected to HyperMesh via sim-cli.
HyperMesh is Altair's high-performance FE pre-processor. It is sim's heavyweight meshing and model-building tool for crash, NVH, durability, and CFD pre-processing.
Scripts use the hm Python API. Executed via
sim run script.py --solver hypermesh (one-shot batch via hw -b -script).
| Field | Value |
|---|---|
| Solver | Altair HyperMesh (HyperWorks Desktop) |
| Execution mode | One-shot batch () |
hw -b -script script.py| Session type | None (Phase 1) |
| SDK | hm Python API (bundled with HyperWorks Desktop) |
| Script language | Python |
| Input formats | .hm, .hma, STEP, IGES, CATIA, NX, SolidWorks, Creo, JT, Parasolid, Nastran, Abaqus, LS-DYNA |
| Output | JSON on stdout (last line), solver deck files (.fem/.bdf/.inp/.k/.rad) |
In scope:
Out of scope:
HyperMesh is NOT pip-installable. Requires Altair HyperWorks Desktop installed with a valid license (Altair Units or node-locked).
Scripts run inside HyperMesh's Python interpreter. The hm module is
only available within hw -b -script or the HyperMesh GUI console.
Don't assume pip packages are available.
Always start with model = hm.Model(). Every script must create a Model
instance as the entry point for all operations.
Use Collections for entity selection, not IDs. The Python API uses
hm.Collection(model, ent.EntityType) instead of Tcl-style ID marks.
Collections are persistent and composable.
Never use InteractiveSelection in batch scripts.
CollectionByInteractiveSelection, EntityByInteractiveSelection, and
PlaneByInteractiveSelection require GUI interaction and will fail in
batch mode (hw -b).
Check hwReturnStatus.status for errors. All model methods return a
status object. status == 0 means success; non-zero means failure.
The .message attribute contains details.
Use hm.setoption(block_redraw=1) for batch performance. Suppress
GUI updates in batch scripts to avoid overhead. Also disable
command_file_state=0 and entity_highlighting=0.
JSON result on last stdout line. All snippets must
print(json.dumps({...})) as the final output.
| Path | Content |
|---|---|
base/reference/hm_api_overview.md | Core hm API: Model, Session, Collection, entity classes |
base/reference/meshing.md | Meshing operations: automesh, tetmesh, batchmesh, quality checks |
base/reference/entities_and_collections.md | Entity manipulation patterns, FilterBy classes, CollectionSet |
base/reference/import_export.md | CAD import, FE import/export, solver deck generation |
base/snippets/01_smoke_test.py | Minimal: create model, material, property, report |
base/snippets/02_import_and_mesh.py | Import geometry, automesh, count elements |
base/snippets/03_quality_check.py | Element quality checks (aspect, skew, jacobian) |
base/snippets/04_export_deck.py | Export solver deck (OptiStruct/Nastran) |
base/known_issues.md | Discovered failure modes and workarounds |
| Path | Content |
|---|---|
sdk/2025/notes.md | Python API changes, new entity classes |
sim check hypermesh
Confirm HyperMesh is installed and version is known.
| Input | Category | Action |
|---|---|---|
| CAD file path | A | Must be provided by user |
| Material properties (E, Nu, Rho) | A | Must ask -- do not guess |
| Element type (shell/solid) | A | Must ask |
| Mesh size | A | Must ask |
| Quality criteria | A | Must ask -- "jacobian > 0.3, aspect < 5" |
| Solver format | A | Must ask -- OptiStruct/Nastran/Abaqus/LS-DYNA |
| Element order (1st/2nd) | B | Default 1st order, disclose |
| Performance options (block_redraw) | B | Default on, disclose |
model.readfile(filename="model.hm", load_cad_geometry_as_graphics=0)
# or for CAD:
model.geomimport(filename="part.step")
mat = ent.Material(model)
mat.name = "Steel"
mat.cardimage = "MAT1"
mat.E = 2.1e5
mat.Nu = 0.3
Generate mesh, run quality checks, report metrics.
Export solver deck. Validate against user-specified quality criteria.
exit_code == 0 alone is NOT sufficient.