UnitFormatUtils.TryParse
Description:
Parses a formatted string into a number with units if possible.
Parses a formatted string into a number with units if possible.
Overloads (8):
TryParse(Units,UnitType,String,Double)
-
unitsThe units formatting settings, typically obtained from Document.GetUnits().
-
unitTypeThe target unit type for the value.
-
StringstringToParseThe string to parse.
-
Double%valueThe parsed value, in Revit's internal units. Ignore this value if the function returns false.
Return Value
bool
True if the string can be parsed, false otherwise.
-
unitType is an invalid unit type. See UnitUtils.IsValidUnitType() and UnitUtils.GetValidUnitTypes().
-
A non-optional argument was NULL
-
A value passed for an enumeration argument is not a member of that enumeration