Constructors
obsoleteUse version that takes a document.
Initializes a new object reference from a guid and component index. The component index is used to specify a "piece" of the geometry
Parameters:
| id (Guid) | The object's Id |
| ci (ComponentIndex) | a portion of the object |
obsoleteUse version that takes a document.
Initializes a new object reference from a globally unique identifier (Guid).
Parameters:
| id (Guid) | The ID. |
Initializes a new object reference from a guid and component index. The component index is used to specify a "piece" of the geometry
Parameters:
| doc (RhinoDoc) | The Rhino document |
| id (Guid) | The object's Id |
| ci (ComponentIndex) | a portion of the object |
Initializes a new object reference from a globally unique identifier (Guid).
Initialized a new object reference from a Rhino object and pick context
Parameters:
| rhinoObject (RhinoObject) | |
| pickContext (PickContext) |
Initializes a new object reference from a Rhino object.
Parameters:
| rhinoObject (RhinoObject) | The Rhino object. |
Finalizer
~ObjRef
#~ObjRef()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
Properties
Gets the document that owns this object reference.
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.
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
Gets the brep if this reference geometry is one.
Returns: A boundary representation; or null on error.
Gets the clipping plane surface if this reference targeted one.
Returns: A clipping plane surface, or null if this reference targeted something else.
Gets the curve if this reference targeted one.
Returns: A curve, or null if this reference targeted something else.
If the reference geometry is a curve or edge with a selection point, then this gets the parameter of the selection point.
Remarks: If a curve was selected and CurveParameter is called and the SelectionMethod() is not 1 (point pick on object), the curve will be returned and parameter will be set to the start parameter of the picked curve. This can be misleading so it may be necessary to call SelectionMethod() first, before calling CurveParameter to get the desired information.
Parameters:
| parameter (out double) | The parameter of the selection point. |
Returns: If the selection point was on a curve or edge, then the curve/edge is returned, otherwise null.
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
Dispose
#For derived class implementers.
This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.
You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.
Also, you must call the base virtual method within your overriding method.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
Gets the edge if this reference geometry is one.
Returns: A boundary representation edge; or null on error.
If the referenced geometry is a brep face, a brep with one face, or a surface, this returns the brep face.
Returns: A boundary representation face; or null on error.
Gets the geometry linked to the object targeted by this reference.
Returns: The geometry.
Gets the hatch if the referenced geometry is one.
Returns: A hatch; or null if the referenced object is not a hatch
If sub-object selection is enabled and a piece of an instance reference is selected, this will return the selected piece.
public Light Light()
Gets the light if the referenced geometry is one.
Returns: A light; or null if the referenced object is not a light, or on error.
public Mesh Mesh()
Gets the mesh if the referenced geometry is one.
Returns: A mesh; or null if the referenced object is not a mesh, or on error.
Gets the point if the referenced geometry is one.
Returns: A point; or null if the referenced object is not a point, or on error.
Gets the point cloud if the referenced geometry is one.
Returns: A point cloud; or null if the referenced object is not a point cloud, or on error.
Gets the method used to select this object.
Returns: The method used to select this object.
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.
Returns: The point where the selection occurred or Point3d.Unset on failure.
If the object was interactively selected in a particular viewport, then SelectionView() returns the view where the object was selected.
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.
When an object is selected by picking a sub-object, SetSelectionComponent may be used to identify the sub-object.
Parameters:
| componentIndex (ComponentIndex) |
Gets the SubD if the referenced geometry is one.
Returns: A SubD; or null if the referenced object is not a SubD, or on error.
Gets the SubDEdge if the referenced geometry is one.
Returns: A SubDEdge; or null if the referenced object is not a SubDEdge, or on error.
Gets the SubDFace if the referenced geometry is one.
Returns: A SubDFace; or null if the referenced object is not a SubDFace, or on error.
Gets the SubDVertex if the referenced geometry is one.
Returns: A SubDVertex; or null if the referenced object is not a SubDVertex, or on error.
Gets the surface if the referenced geometry is one.
Returns: A surface; or null if the referenced object is not a surface, or on error.
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.
Gets the text dot if the referenced geometry is one.
Returns: A text dot; or null if the referenced object is not a text dot, or on error.
Gets the text entity if the referenced geometry is one.
Returns: A text entity; or null if the referenced object is not a text entity, or on error.
If the referenced geometry is an edge of a surface, this returns the associated brep trim.
Returns: A boundary representation trim; or null on error
If the referenced geometry is a brep vertex, this returns the brep vertex.
Returns: A boundary representation vertex; or null if the referenced geometry is not a brep vertex, or on error.