ReferenceParseFromStableRepresentation Method |
Converts a stable String representation of a reference to a Reference object.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static Reference ParseFromStableRepresentation(
Document document,
string representation
)
Public Shared Function ParseFromStableRepresentation (
document As Document,
representation As String
) As Reference
public:
static Reference^ ParseFromStableRepresentation(
Document^ document,
String^ representation
)
static member ParseFromStableRepresentation :
document : Document *
representation : string -> Reference Parameters
- document Document
- The document.
- representation String
- The reference representation.
Return Value
Reference
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | One or more arguments was . |
| ArgumentException | Reference representation could not be successfully parsed, or element id obtained
from reference representation could not be found in this document. |
RemarksUse
ConvertToStableRepresentation(Document) to obtain the representation.
The Reference will have only the following information set:
You will also be able to pass the reference to Document.GetElement(reference) and Element.GetGeometryObjectFromReference(reference)
to obtain the element and geometry object referred to.
Examplepublic Reference ParseReference(Document doc, String str)
{
Reference reference = Reference.ParseFromStableRepresentation(doc, str);
if (null == reference)
{
TaskDialog.Show("ParseReference", "Reference is Null.");
}
return reference;
}Public Function ParseReference(doc As Document, str As [String]) As Reference
Dim reference__1 As Reference = Reference.ParseFromStableRepresentation(doc, str)
If reference__1 Is Nothing Then
TaskDialog.Show("ParseReference", "Reference is Null.")
End If
Return reference__1
End FunctionNo code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also