UnitsAttribute Class |
Because Tedds calculations are ‘dimensionally aware’ Add-In methods must specify the units of each argument, and the units of any return value.
This is done using the Units Attribute.
Inheritance Hierarchy
Namespace: Tekla.Structural.ExpressoAddIn
Assembly: Tedds.ExprInterop (in Tedds.ExprInterop.dll) Version: 26.0.0.0
Syntax
Constructors
Name | Description | |
---|---|---|
UnitsAttribute(String) |
Units of variable passed into/out of Tedds
| |
UnitsAttribute(Double, String) |
Units of variable passed into/out of Tedds
|
Remarks
For numerical input parameters, Tedds will first verify that the argument passed in to the method has the correct dimensions for the specified units.
For example, if the parameter has a Units attribute of “m”, any length value (e.g. feet or millimetres) could be passed to the method.
If a numerical parameter does not have a units attribute then the argument passed in must be dimensionless.
Once dimensional equality has been verified Tedds will divide the argument passed to the method by the factor and units to create a dimensionless value which will be passed into the .Net method.
For example, if you pass a value of 1 foot into a method that has been decorated with a Units Attribute of 10 millimetres [UnitsAttribute(10, “mm”)] then the .Net method will receive the value 30.48.
For return values, Tedds will multiply the return value by the factor and units to create a dimensioned value which can be used in subsequent Tedds calculations.
See Also