Unit objects are used to establish a unit system within a project. A project can have one or more unit systems. If no Unit object is defined, the entire project is assumed to be in a single unit system.
The first Unit object must be named 'Internal' and is used to define the internal unit system of the project. Having a consistent internal unit system makes it easier to write parametric expressions.
Once an internal unit system is defined, it's possible to create additional unit systems to make input easier for the end user. For example, the author of the project can create multiple unit systems named 'Section', 'Coordinate', 'Displacement' etc. Any parameter that has a unit category that matches the name of the Unit object will use that particular Unit system for end-user input. The Unit object named 'Internal' will be used for internal computation.
If a Unit object named 'Default' exists in the project, all parameters that do not have a defined unit category are assumed to be in the 'Default' unit category.
Example Syntax
... <O T="Unit"> ... ... </O>
Example:
<O N="Unit_Object1" T="Project" Category="Core Objects"> <!-- created by ParamML Examples on 27.01.2023 --> <O N="Internal" T="Unit" Length="Millimeter" Force="Newton" Angle="Radian" Temperature="Fahrenheit" /> <O N="Geometry" T="Unit" Length="Meter" Force="Newton" Angle="Degree" Temperature="Fahrenheit" /> <O N="Property" T="Unit" Length="Centimeter" Force="Newton" Angle="Degree" Temperature="Fahrenheit" /> | |
Once three "Unit" objects have been created in the project as described above, we can assign a specific parameter to a created parameter by specifying its Unit Category (UC) and Unit Type (UT). The Unit Category (UC) specifies the name that the parameter will be assigned to, while the Unit Type (UT) indicates what the parameter represents. If the Unit Category (UC) matches the name of one of the "Unit" objects, the parameter will use the unit system that it matches. | |
<O N="Unit_Object1" T="Project" Category="Core Objects"> <!-- created by ParamML Examples on 27.01.2023 --> <O N="Internal" T="Unit" Length="Millimeter" Force="Newton" Angle="Radian" Temperature="Fahrenheit" /> <O N="Geometry" T="Unit" Length="Meter" Force="Newton" Angle="Degree" Temperature="Fahrenheit" /> <O N="Property" T="Unit" Length="Centimeter" Force="Newton" Angle="Degree" Temperature="Fahrenheit" /> <O N="Inputs" T="Group"> <P N="A" V="-1000" Role="Input" Category="Inputs" UT="Length" UC="Property" /> <P N="B" V="100" Role="Input" Category="Inputs" UT="Length" UC="Geometry" /> <P N="C" V="50" Role="Input" Category="Inputs" UT="Angle" UC="Internal" /> </O> </O> | |
Parameter A will specify a length (UT) and its unit will be centimeters.
|
Add Comment