The Multiframe user interface allows the user to customise the units used to display and input quantities into the application. The same units settings also govern the input and output of values from the automation interface. The Preferences object provides several methods and properties for working with units. The unit set used within Multiframe to display quantities is specified by the UnitSet property. This is an enumerated value of type mfUnitSets that has values corresponding to one of predefined sets of units (Australian, Japanese, American, etc.). To use the American unit set, the following line would be added to a script
mfApp.Preferences.UnitSet = mfUnitsetAmerican
The individual units within the unit set selected within the application may be determined using the GetUnit method. This method is very useful in constructing VBA forms or fields for inputting information as it provides a means of communicating the current units of measure. The GetUnit method returns a string containing the abbreviated name of the unit as specified by the single parameter of the method that identifies the type of unit (length, force, angle, etc). The individual units of measure are identified using an enumerated value of type mfUnitType. As an example, a string containing the name of the current units of length would be obtained as follows
Dim s As String
s = mfApp.Preferences.GetUnit (Multiframe.mfUnitLength)
The units used within the current unit set can be changed using the SetUnit method of the Preferences object. This method takes two parameters; the first is an enumerated value of type mfUnitType that identifies the units to be changed. The second parameter is a string that specifies the name of the units to be used. For example, to change the units of length to feet would require the following line of code
mfApp.Preferences.SetUnits(mfUnitLength,”ft”)
Allowable values of the unit names for each of the unit types are those listed in Multiframes Units dialog. A summary of the different units of measurement that can be set within Multiframe is listed in the table below.
|
Unit |
Constant |
Value |
|
Dimensionless value |
mfUnitNone |
0 |
|
Length |
mfUnitLength |
1 |
|
Angle |
mfUnitAngle |
2 |
|
Displacement |
mfUnitDisplacement |
3 |
|
Angular Displacement |
mfUnitAngularDisplacement |
4 |
|
Force |
mfUnitForce |
5 |
|
Moment |
mfUnitMoment |
6 |
|
Force Per Unit Length |
mfUnitUdl |
7 |
|
Stress |
mfUnitStress |
8 |
|
Mass |
mfUnitMass |
9 |
|
Mass Per Unit Length |
mfUnitMassPerLength |
10 |
|
Area |
mfUnitArea |
11 |
|
Moment of Inertia |
mfUnitInertia |
12 |
|
Density |
mfUnitDensity |
13 |
|
Elastic Modulus |
mfUnitModulus |
14 |
|
Spring stiffness |
mfUnitSpring |
15 |
|
Torsional Spring Stiffness |
mfUnitTorsionSpring |
16 |
|
Temperature |
mfUnitTemperature |
17 |
|
Coefficient of Thermal Expansion |
mfUnitTemperatureCoeff |
18 |
|
Rotational Mass |
mfUnitRotationalMass |
19 |
|
Velocity |
mfUnitVelocity |
20 |
|
Acceleration |
mfUnitAcceleration |
21 |
|
Warping Constant |
mfUnitWarping |
22 |