TextFieldsTryFormat Method (String, RhinoDoc, String) |
Formats the contents of a text string with field expressions
and returns the result.
The text is evaluated with no object context, which suits fields that read only the
document, such as Date or ModelUnits. Fields that read the object itself or the block
instance enclosing it - user text, for example - cannot resolve this way and will come
back empty; use the overload that takes the object and its parents for those.
Namespace:
Rhino.Runtime
Assembly:
RhinoCommon (in RhinoCommon.dll)
Since: 8.0
Syntaxpublic static bool TryFormat(
string text,
RhinoDoc doc,
out string result
)
Public Shared Function TryFormat (
text As String,
doc As RhinoDoc,
<OutAttribute> ByRef result As String
) As Boolean
Parameters
- text
- Type: SystemString
The text formula to format
- doc
- Type: RhinoRhinoDoc
The Rhino document to evaluate
- result
- Type: SystemString
The result of the formatted expression. Otherwise, if the text is null
or the evaluation process fails, the result will be empty.
Return Value
Type:
Boolean
Returns True if the expression is formatted properly; Otherwise False.
See Also