Specifications

176
The first example is a rather basic application of time-varying forces to the well-known 2-D arm model. The
example shows forces defined directly as a mathematical function of time and forces interpolated between a
set of measured values.
The second example illustrates the difference between locally and globally defined forces and how forces
acting on a segment can be summed up.
Advanced script features
AnyScript is a powerful programming language designed particularly to make life easy for body modelers.
Generality and versatility, however, often come at the cost of complexity, and there are some advanced
topics you must grasp to fully realize the potential of the language. This section presents some of those
topics.
This tutorial consists of the following lessons:
Lesson 1: Using References
Lesson 2: Using Include Files
Lesson 3: Mathematical Expressions
We shall begin with Lesson 1: Using references
.
Lesson 1: Using References
AnyScript is really a programming language, and just like any other programming language you can define
variables and assign values to them. For instance, you may write
AnyVar a = 10.0;
AnyVar b = a;
Folders are also variables, and a folder definition can go like this:
AnyFolder MyFolder = {
// A whole lot of stuff inside
};
However, folders cannot be assigned like a and b above, so the following is illegal:
AnyFolder MyFolderCopy = MyFolder;
In general, you can only do direct assignment of value variables, i.e. variables containing numbers or
collection of numbers. This assignment is allowed:
AnyVector aa = {1,2,3};
AnyVector bb = aa;
But folder assignments are not allowed. So how can you refer to large portions of the model in just one
assignment operation? The answer is that you can refer by reference, and just about any assignment
between variables of compatible type will work:
AnyFolder &MyFolderCopy = MyFolder;