RVTDocs.com

UnitFormatUtils.TryParse(Units, ForgeTypeId, String, Double, String)

Method
Description:
Parses a formatted string into a number with units if possible.
Syntax
public static bool TryParse(
	Units units,
	ForgeTypeId specTypeId,
	string stringToParse,
	out double value,
	out string message
)
Parameters
Parameter Type Description
units Units The units formatting settings, typically obtained from <a href="9ed56178-e9ae-b4bc-1c0e-e6a867ae3557.htm">Document.GetUnits()</a>.
specTypeId ForgeTypeId Identifier of the target spec for the value.
stringToParse String The string to parse.
value Double The parsed value. Ignore this value if the function returns false.
message String A localized message that, if the parsing fails, explains the reason for failure.
Return Value
Type Description
Boolean True if the string can be parsed, false otherwise.
Exceptions
Exception Condition
ArgumentException specTypeId is not a measurable spec identifier. See UnitUtils.IsMeasurableSpec(ForgeTypeId).
ArgumentNullException A non-optional argument was null