01.09.2014 Views

WM Basic™ User's Manual - Classes

WM Basic™ User's Manual - Classes

WM Basic™ User's Manual - Classes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1 What is Working Model Basic? 21<br />

<strong>WM</strong>Output object<br />

<strong>WM</strong>Constraint object<br />

<strong>WM</strong>Point object<br />

<strong>WM</strong>Input object<br />

<strong>WM</strong>Body object<br />

<strong>WM</strong>Document object<br />

Most objects in <strong>WM</strong> Basic are direct equivalents of physical objects in Working Model, and<br />

they feature very similar, if not identical, functionality. For example, most menu commands<br />

are implemented as part of a <strong>WM</strong>Document object, which represents a Working Model<br />

document. Likewise, all the entries in Properties, Geometry, and Appearance windows are<br />

available to a <strong>WM</strong>Body object which represents a body in Working Model.<br />

Properties of an Object<br />

A property describes a state of the object. A <strong>WM</strong>Body object, for example, has mass as one of<br />

its properties.<br />

To access the information contained in the properties, you need to specify the object name<br />

and add a period (.) followed by the name of the property. For example, if you want to<br />

access the mass property of the <strong>WM</strong>Body object called Wheel, type:<br />

Wheel.Mass.Value<br />

Most of the properties can be modified as well, for example, in an assignment statement. If<br />

you want to change the mass of the Wheel to 10, simply type:<br />

Wheel.Mass.Value = 10<br />

(The quantity 10 is interpreted in the current unit system.) Note that the result of this<br />

assignment statement is equivalent to that of typing the number "10" in the mass field of the<br />

Properties utility window.<br />

Methods of an Object<br />

Besides having properties, objects also know how to perform certain actions. These actions<br />

are called methods. A <strong>WM</strong>Document object, for example, has a method called Run, which runs<br />

the Working Model simulation.<br />

As with properties, if you want to use methods associated with an object, you need to specify<br />

the object and add a period (.), followed by the name of the method. For example, suppose

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!