# ObjRef class

Namespace: [Rhino.DocObjects](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.docobjects.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public class ObjRef : IDisposable
```

Represents a reference to a Rhino object.

## Constructors

- [ObjRef](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/ctor.md): (7 overloads) Initializes a new object reference from a guid and component index. The component index is used to specify a "piece" of the geometry

## Finalizer

- [~ObjRef](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/finalize.md): Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

## Properties

- [Document](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/document.md): Gets the document that owns this object reference.
- [GeometryComponentIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/geometrycomponentindex.md): Gets the component index of the referenced (sub) geometry. Some objects have sub-objects that are valid pieces of geometry. For example, breps have edges and faces that are valid curves and surfaces. Each sub-object has a component index that is > 0. The parent geometry has a component index = -1.
- [ObjectId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/objectid.md): Returns the id of the referenced Rhino object.
- [RuntimeSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/runtimeserialnumber.md): If > 0, then this is the value of a Rhino object's serial number field. The serial number is used instead of the pointer to prevent crashes in cases when the RhinoObject is deleted but an ObjRef continues to reference the Rhino object. The value of RuntimeSerialNumber is not saved in archives because it generally changes if you save and reload an archive.

## Methods

- [Brep](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/brep.md): Gets the brep if this reference geometry is one.
- [ClippingPlaneSurface](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/clippingplanesurface.md): Gets the clipping plane surface if this reference targeted one.
- [Curve](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/curve.md): Gets the curve if this reference targeted one.
- [CurveParameter](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/curveparameter.md): If the reference geometry is a curve or edge with a selection point, then this gets the parameter of the selection point.
- [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/dispose.md): (2 overloads) Actively reclaims unmanaged resources that this instance uses.
- [Edge](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/edge.md): Gets the edge if this reference geometry is one.
- [Face](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/face.md): If the referenced geometry is a brep face, a brep with one face, or a surface, this returns the brep face.
- [Geometry](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/geometry.md): Gets the geometry linked to the object targeted by this reference.
- [Hatch](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/hatch.md): Gets the hatch if the referenced geometry is one.
- [InstanceDefinitionPart](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/instancedefinitionpart.md): If sub-object selection is enabled and a piece of an instance reference is selected, this will return the selected piece.
- [Light](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/light.md): Gets the light if the referenced geometry is one.
- [Mesh](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/mesh.md): Gets the mesh if the referenced geometry is one.
- [Object](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/object.md): Returns the referenced Rhino object.
- [Point](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/point.md): Gets the point if the referenced geometry is one.
- [PointCloud](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/pointcloud.md): Gets the point cloud if the referenced geometry is one.
- [SelectionMethod](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/selectionmethod.md): Gets the method used to select this object.
- [SelectionPoint](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/selectionpoint.md): If the object was selected by picking a point on it, then SelectionPoint() returns the point where the selection occurred, otherwise it returns Point3d.Unset.
- [SelectionView](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/selectionview.md): If the object was interactively selected in a particular viewport, then SelectionView() returns the view where the object was selected.
- [SelectionViewDetailSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/selectionviewdetailserialnumber.md): If the object was interactively selected in a page space detail view, then SelectionViewDetailSerialNumber() returns the CRhinoObject serial number of the detail view object. Use SelectionView() to get the page view that contains the detail view object. If SelectionViewDetailSerialNumber() returns 0, then the selection did not happen in a detail view.
- [SetSelectionComponent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/setselectioncomponent.md): When an object is selected by picking a sub-object, SetSelectionComponent may be used to identify the sub-object.
- [SubD](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/subd.md): Gets the SubD if the referenced geometry is one.
- [SubDEdge](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/subdedge.md): Gets the SubDEdge if the referenced geometry is one.
- [SubDFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/subdface.md): Gets the SubDFace if the referenced geometry is one.
- [SubDVertex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/subdvertex.md): Gets the SubDVertex if the referenced geometry is one.
- [Surface](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/surface.md): Gets the surface if the referenced geometry is one.
- [SurfaceParameter](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/surfaceparameter.md): If the reference geometry is a surface, brep with one face, or surface edge with a selection point, then this gets the surface parameters of the selection point.
- [TextDot](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/textdot.md): Gets the text dot if the referenced geometry is one.
- [TextEntity](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/textentity.md): Gets the text entity if the referenced geometry is one.
- [Trim](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/trim.md): If the referenced geometry is an edge of a surface, this returns the associated brep trim.
- [Vertex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.objref/vertex.md): If the referenced geometry is a brep vertex, this returns the brep vertex.
