Conventions

The MotionSolve API statements adhere to the following style conventions.

Note: Python is case sensitive, and so is the MotionSolve Python Interface. Thus, you will see the following behavior:
>>>
>>>from math import sin, pi
>>>sin(pi/2)
1.0

>>>Sin(pi/2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Sin' is not defined

MotionSolve Classes

All MotionSolve classes use Upper Camel Case for capitalization, which means the first letter is always a capital letter. If the class name consists of two or more meaningful words joined together, the first letter of the subsequent words are also capitalized. All other letters are lower case. The examples below explain.

Valid Class Name Invalid Variations of the Class Name
Part PART, part, pART, etc.
Joint JOINT, joint, jOiNt, etc.
SpringDamer Springdamper, SPRINGDAMPER, springdamper, etc.
>>> from msolve import *
>>>
>>> jupiter = PaRT(MASS=1.89E27) # Incorrect capitalization
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'PaRT' is not defined

>>> jupiter = Part (mass=1.89813E27) # Correct capitalization
>>> jupiter.mass
1.89813e+27

MotionSolve Class Attributes

Attributes are always lower-case. The table below illustrates.
Valid Attribute Names Invalid Attribute Names
id ID, Id, iD
label Label, labeL, etc.
variables Variables, VARiables, etc.