Running Analysis
Analysis in the SPACE GASS API is asynchronous — when you start an analysis, the API returns immediately with a run ID. You then poll for progress until the run completes. This guide covers the common patterns from simple scripting to advanced multi-run monitoring.
How It Works
- Start an analysis — returns an
AnalysisRunwith arunIdand initial status - Poll the run status using the
runIdat regular intervals - Check for a terminal status:
Completed,Failed, orCancelled - Query results once completed
Simple Script — Wait for Completion
Most scripts just need to run an analysis and wait. Here is a simple helper that polls until the analysis finishes, then returns the final status:
The WaitForCompletion helper turns the async polling into a simple
blocking call — your script just waits until the analysis is done
before moving on. This is the pattern you will use most often in
scripts.
Running Multiple Analyses in Sequence
The API processes analysis runs in a queue. You can start multiple analyses and they will execute in order. Poll the last run ID to know when all analyses are complete:
Monitoring Progress
For longer analyses you may want to display progress as it runs.
The AnalysisRun.Progress object provides step labels, iteration
percentages, and load case status:
Cancelling a Run
You can cancel a running or queued analysis by calling DELETE on
the run:
The run transitions to Cancelling and then Cancelled once the
solver has stopped.
Analysis Run Lifecycle
| Status | Description |
|---|---|
Queued | Run is waiting in the queue |
Running | Analysis is actively executing |
Cancelling | Cancellation requested, waiting for solver to stop |
Completed | Analysis finished successfully — results are available |
Failed | Analysis encountered an error — check errorMessage |
Cancelled | Analysis was cancelled before completion |
Advanced: Real-Time Monitoring Application
For a full example of an interactive monitoring application that tracks multiple concurrent runs with live progress bars, elapsed timers, and error/warning display, see the AnalysisMonitor WPF example in the repository.

