GetGeometryObjectFromReference Method

Retrieve one geometric primitive contained in the element given a reference.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: (
Since: 2012


public GeometryObject GetGeometryObjectFromReference(
	Reference reference
Visual Basic
Public Function GetGeometryObjectFromReference ( _
	reference As Reference _
) As GeometryObject
Visual C++
GeometryObject^ GetGeometryObjectFromReference(
	Reference^ reference


Type: Autodesk.Revit.DB Reference
The geometric object referenced by this instance will be retrieved from the model.

Return Value

The geometric object referenced by the input reference.


It will return the last geometric object in the path. a null reference ( Nothing in Visual Basic) will be returned if related geometric object could not be found in the model.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException The id of this element is not same as that referenced by reference
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException The element id held by the input reference is not same as the id of this element. The geometric information could not be taken for this element.

See Also