Momentum Scripting v2
Loading...
Searching...
No Matches
Algoryx Momentum Scripting API

Introduction

Use the Algoryx Momentum v2 scripting API to inspect models and control simulations in Algoryx Momentum.

Getting started

Import v2 and obtain the active simulation:

from Momentum import v2
simulation = v2.getSimulation()

Analysis scripts can read simulation data. Methods that modify the simulation are documented as available only in simulation mode.

Documentation

Browse the v2 namespace for classes, utility functions, and constants.

Work with Reference
The simulation and model objects v2::Simulation
Bodies and geometry v2::RigidBody, v2::Geometry
Joints and springs v2::Joint, v2::SpringJoint
Motor control v2::LinearMotor, v2::AngularMotor
Materials and contact behavior v2::Material, v2::MaterialPair

For springs along a joint's free directions, use v2::PrismaticJoint::getSpring() or v2::HingeJoint::getSpring(). A cylindrical joint has both v2::CylindricalJoint::getLinearSpring() and v2::CylindricalJoint::getAngularSpring(). Configure the spring and enable it with setEnabled(True); obtaining it does not enable it.

Parameter names and units

  • Spring stiffness uses N/m for translation and N m/rad for rotation.
  • Physical spring damping uses N s/m for translation and N m s/rad for rotation.
  • Material-pair attenuation is a dimensionless number of integration steps.

Use v2::convertDampingTimeToAttenuation() to convert a material-pair setter input from seconds using the active simulation timestep. Material-pair getters return dimensionless attenuation, not seconds; review calculations using their results when migrating from v1. See v2::MaterialPair for examples.

License

Copyright 2007-2026. Algoryx Simulation AB.

All Algoryx Momentum code, intellectual property, documentation, sample code, tutorials, scene files and technical white papers, are copyrighted, proprietary and confidential material of Algoryx Simulation AB. You may not download, read, store, distribute, publish, copy or otherwise disseminate, use or expose this material unless having a written signed agreement with Algoryx Simulation AB, or having been advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a valid commercial license from Algoryx Simulation AB.

Algoryx Simulation AB disclaims all responsibilities for loss or damage caused from using this software, unless otherwise stated in written agreements with Algoryx Simulation AB.

The integrity of this Software is protected by technical protection measures (TPM) so that the intellectual property rights, including copyright, in the Software of AGX are not misappropriated. You must not attempt in any way to remove or circumvent any such TPM, nor apply or manufacture for sale or hire, import, distribute, sell or let for hire, offer or expose for sale or hire, advertise for sale or hire or have in your possession for private or commercial purposes any means the sole intended purpose of which is to facilitate the unauthorized removal or circumvention of such TPM.