RhinoObject
Represents an object in the document.
RhinoObjects should only ever be creatable by the RhinoDoc.
Inheritance Hierarchy
System.Object
Rhino.Runtime.CommonObject
Rhino.DocObjects.ModelComponent
Rhino.DocObjects.RhinoObject
Namespace: Rhino.DocObjects
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public class RhinoObject : ModelComponent
The RhinoObject type exposes the following members.
Properties
Name
Description
Public Property
Attributes
Gets or sets the object attributes.
Public Property
ComponentStatus
Gets or sets the component status of the model component.
(Inherited from ModelComponent.)
Public Property
ComponentType
Returns ModelGeometry.
(Overrides
ModelComponent.ComponentType
.)Public Property
DeletedName
Gets the name of a component that is deleted.
(Inherited from ModelComponent.)
Public Property
Disposed
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
(Inherited from CommonObject.)
Public Property
Document
Gets the document that owns this object.
Public Property
Geometry
Gets the underlying geometry for this object.
All rhino objects are composed of geometry and attributes.
Public Property
GripsOn
Gets or sets the activation state of object default editing grips.
Public Property
GripsSelected
true if grips are turned on and at least one is selected.
Public Property
GroupCount
Number of groups object belongs to.
Public Property
HasDynamicTransform
True if the object has a dynamic transformation
Public Property
HasId
Returns a value indicating whether the component has an ID.
(Inherited from ModelComponent.)
Public Property
HasIndex
Returns a value indicating whether the component has an Index.
(Inherited from ModelComponent.)
Public Property
HasName
Returns a value indicating whether the component has a Name.
(Inherited from ModelComponent.)
Public Property
HasSubobjectMaterials
Will be true if the object contains sub object meshes with materials that are different than the top level object.
Public Property
HasUserData
Gets true if this class has any custom information attached to it through UserData.
(Inherited from CommonObject.)
Public Property
Id
Every object has a Guid (globally unique identifier, also known as UUID, or universally unique identifier). The default value is Guid.Empty.
When an object is added to a model, the value is checked. If the value is Guid.Empty, a new Guid is created. If the value is not null but it is already used by another object in the model, a new Guid is created. If the value is not Guid.Empty and it is not used by another object in the model, then that value persists. When an object is updated, by a move for example, the value of ObjectId persists.
This value is the same as the one returned by this.Attributes.ObjectId.
(Overrides
ModelComponent.Id
.)Public Property
IdIsLocked
Returns a value indicating whether the component ID is already locked.
(Inherited from ModelComponent.)
Public Property
Index
Gets or sets the model component index attribute.
(Inherited from ModelComponent.)
Public Property
IndexIsLocked
Returns a value indicating whether the component Index is already locked.
(Inherited from ModelComponent.)
Public Property
InstanceDefinitionModelSerialNumber
When a component is in a model as part of the information required for a linked instance definition, this value identifies the linked instance definition reference model.
(Overrides ModelComponent.InstanceDefinitionModelSerialNumber.)
Public Property
IsComponentStatusLocked
The component status itself can be locked. This returns an indication.
(Inherited from ModelComponent.)
Public Property
IsDeletable
Some objects cannot be deleted, like grips on lights and annotation objects.
Public Property
IsDeleted
true if the object is deleted. Deleted objects are kept by the document for undo purposes. Call RhinoDoc.UndeleteObject to undelete an object.
(Overrides
ModelComponent.IsDeleted
.)Public Property
IsDocumentControlled
If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to “IsReadOnly” will throw a NotSupportedException.
(Inherited from CommonObject.)
Public Property
IsHidden
An object must be in one of three modes: normal, locked or hidden. If an object is in normal mode, then the object’s layer controls visibility and selectability. If an object is locked, then the object’s layer controls visibility by the object cannot be selected. If the object is hidden, it is not visible and it cannot be selected.
Public Property
IsInstanceDefinitionGeometry
true if the object is used as part of an instance definition.
Public Property
IsLocked
An object must be in one of three modes: normal, locked or hidden. If an object is in normal mode, then the object’s layer controls visibility and selectability. If an object is locked, then the object’s layer controls visibility by the object cannot be selected. If the object is hidden, it is not visible and it cannot be selected.
Public Property
IsNormal
An object must be in one of three modes: normal, locked or hidden. If an object is in normal mode, then the object’s layer controls visibility and selectability. If an object is locked, then the object’s layer controls visibility by the object cannot be selected. If the object is hidden, it is not visible and it cannot be selected.
Public Property
IsPictureFrame
Returns true if the object is a picture frame. A picture frame object is an object that displays a texture map in all views.
Public Property
IsReference
Gets a value indicating if an object is a reference object. An object from a work session reference model is a reference object and cannot be modified. An object is a reference object if, and only if, it is on a reference layer.
(Overrides
ModelComponent.IsReference
.)Public Property
IsSolid
Returns true if object is a closed solid, otherwise false.
Public Property
IsSystemComponent
True if this model component is a system constant.
An incomplete list of system constant model components is below:
-
ON_ModelComponent::Unset
-
ON_InstanceDefinition::Empty
-
ON_Linetype::Unset
-
ON_Linetype::Continuous
-
ON_Linetype::ByLayer
-
ON_Linetype::ByParent
-
ON_Layer::Unset
-
ON_Layer::Default
-
ON_TextStyle::Unset
-
ON_TextStyle::Default
-
ON_TextStyle::ByLayer
-
ON_TextStyle::ByParent
-
ON_DimStyle::Unset
-
ON_DimStyle::Default
-
ON_DimStyle::DefaultInchDecimal
-
ON_DimStyle::DefaultInchFractional
-
ON_DimStyle::DefaultFootInchArchitecture
-
ON_DimStyle::DefaultMillimeterSmall
-
ON_DimStyle::DefaultMillimeterLarge
-
ON_DimStyle::DefaultMillimeterArchitecture
(Inherited from ModelComponent.)
Public Property
IsValid
Tests an object to see if it is valid.
(Inherited from CommonObject.)
Public Property
ModelSerialNumber
A value identifying the model that manages this component.
(Inherited from ModelComponent.)
Public Property
Name
Rhino objects have optional text names. More than one object in a model can have the same name and some objects may have no name.
(Overrides
ModelComponent.Name
.)Public Property
NameIsLocked
Returns a value indicating whether the component Name is already locked.
(Inherited from ModelComponent.)
Public Property
Static Member
NextRuntimeSerialNumber
Gets the runtime serial number that will be assigned to the next Rhino Object that is created.
Public Property
ObjectType
Gets the Rhino-based object type.
Public Property
ReferenceModelSerialNumber
When a component is in a model for reference, this value identifies the reference model.
(Overrides ModelComponent.ReferenceModelSerialNumber.)
Public Property
RenderMaterial
Gets the render material associated with this object or null if there is none. This does not pay attention to the material source and will not check parent objects or layers for a RenderMaterial.
Public Property
RuntimeSerialNumber
Gets the objects runtime serial number.
Public Property
SubobjectMaterialComponents
Public Property
UserData
List of custom information that is attached to this class.
(Inherited from CommonObject.)
Public Property
UserDictionary
Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
(Inherited from CommonObject.)
Public Property
Visible
Gets the object visibility.
Methods
Name
Description
Public Method
ClearId
Resets the HasId property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public Method
ClearIndex
Resets the HasIndex property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public Method
ClearName
Resets the HasName property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public Method
Code Example
CommitChanges
Moves changes made to this RhinoObject into the RhinoDoc.
Protected Method
ConstructConstObject
Assigns a parent object and a sub-object index to this.
(Inherited from CommonObject.)
Public Method
CopyHistoryOnReplace
Gets the setting of the CopyOnReplace field in this object’s history
Public Method
CreateMeshes
Create meshes used to render and analyze surface and polysurface objects.
Public Method
CustomRenderMeshesBoundingBox
Returns the bounding box of custom render primitives for this object .
Public Method
DataCRC
Increments the Cyclic Redundancy Check value by this instance.
(Inherited from ModelComponent.)
Public Method
Description
Get a brief description of a object, including it’s attributes and geometry.
Public Method
Dispose.
Actively reclaims unmanaged resources that this instance uses.
(Inherited from CommonObject.)
Protected Method
Dispose(Boolean)
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.
(Inherited from CommonObject.)
Public Method
Code Example
DuplicateGeometry
Constructs a deep (full) copy of the geometry.
Public Method
EnableCustomGrips
Turns on/off the object’s editing grips.
Public Method
EnableVisualAnalysisMode
Used to turn analysis modes on and off.
Public Method
EnsurePrivateCopy
If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
(Inherited from CommonObject.)
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected Method
Finalize
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
(Inherited from CommonObject.)
Public Method
Static Member
FromRuntimeSerialNumber
Get a Rhino object for a unique runtime serial number
Public Method
GetActiveVisualAnalysisModes
Gets a list of currently enabled analysis modes for this object.
Protected Method
GetBoundingBox
Called when Rhino wants the bounding box of this object. Viewpoert can be null. This is the default base class version that will go through to the C++ base class if it is called from the custom object
Public Method
GetCustomRenderMeshParameter
Query the object for the value of a given named custom render mesh parameter.
Public Method
GetDynamicTransform
While an object is being dynamically transformed (dragged, rotated, …), the current transformation can be retrieved and used for creating dynamic display.
Public Method
Static Member
GetFillSurfaces(RhinoObject, ClippingPlaneObject)
Return list of fill surfaces if any for object and clipping plane.
Public Method
Static Member
GetFillSurfaces(RhinoObject, IEnumerable.ClippingPlaneObject.)
Return list of fill surfaces if any for object and clipping plane. Fills are trimmed by clipping planes that did not generate them.
Public Method
Static Member
GetFillSurfaces(RhinoObject, IEnumerable.ClippingPlaneObject., Boolean)
Return list of fill surfaces if any for object and clipping plane.
Public Method
GetGrips
Returns grips for this object If grips are enabled. If grips are not enabled, returns null.
Public Method
GetGroupList
Allocates an array of group indices of length GroupCount. If
GroupCount
is 0, then this method returns null.Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
GetHighlightedSubObjects
Gets a list of all highlighted sub-objects.
Public Method
GetMaterial(Boolean)
Gets material that this object uses based on it’s attributes and the document that the object is associated with. In the rare case that a document is not associated with this object, null will be returned.
Public Method
GetMaterial(ComponentIndex)
Get the Material associated with the sub object identified by componentIndex if the component index is set to ComponentIndex.Unset then the top level material is returned.
Public Method
GetMaterial(ComponentIndex, Guid)
Get the Material associated with the sub object identified by componentIndex if the component index is set to ComponentIndex.Unset then the top level material is returned.
Public Method
GetMaterial(ComponentIndex, Guid, ObjectAttributes)
Get the Material associated with the sub object identified by componentIndex if the component index is set to ComponentIndex.Unset then the top level material is returned.
Public Method
GetMeshes
Get existing meshes used to render and analyze surface and polysurface objects.
Public Method
GetObjectData
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
(Inherited from CommonObject.)
Public Method
GetRenderMaterial(Boolean)
Gets the RenderMaterial that this object uses based on it’s attributes and the document that the object is associated with. If there is no RenderMaterial associated with this object then null is returned. If null is returned you should call GetMaterial to get the material used to render this object.
Public Method
GetRenderMaterial(ComponentIndex)
Gets the RenderMaterial associated with this object if there is one. If there is no RenderMaterial associated with this object then null is returned. If null is returned you should call GetMaterial to get the material used to render this object.
Public Method
GetRenderMaterial(ComponentIndex, Guid)
Gets the RenderMaterial associated with this object if there is one. If there is no RenderMaterial associated with this object then null is returned. If null is returned you should call GetMaterial to get the material used to render this object.
Public Method
GetRenderMaterial(ComponentIndex, Guid, ObjectAttributes)
Gets the RenderMaterial associated with this object if there is one. If there is no RenderMaterial associated with this object then null is returned. If null is returned you should call GetMaterial to get the material used to render this object.
Public Method
Static Member
GetRenderMeshes
Obsolete.
Gets the render meshes of some objects.
Public Method
Static Member
GetRenderMeshesWithUpdatedTCs
Obsolete.
Gets the render meshes of some objects.
Public Method
GetRenderMeshParameters.
Returns the meshing parameters that this object uses for generating render meshes. If this object does not have per-object meshing parameters, then the document’s meshing parameters are returned.
Public Method
GetRenderMeshParameters(Boolean)
Returns the meshing parameters that this object uses for generating render meshes.
Public Method
GetRenderPrimitiveList(ViewportInfo, DisplayPipelineAttributes)
Obsolete.
Build custom render mesh(es) for this object.
Public Method
GetRenderPrimitiveList(ViewportInfo, Boolean)
Obsolete.
Build custom render mesh(es) for this object.
Public Method
GetSelectedSubObjects
Get a list of all selected sub-objects.
Public Method
GetSubObjects
Explodes the object into sub-objects. It is up to the caller to add the returned objects to the document.
Public Method
GetTextureChannels
Get a list of the texture mapping channel Id’s associated with object.
Public Method
GetTextureMapping(Int32)
Public Method
GetTextureMapping(Int32, Transform.)
Get objects texture mapping
Public Method
Static Member
GetTightBoundingBox(IEnumerable.RhinoObject., BoundingBox.)
Gets a world XY-plane aligned tight bounding box from a collection of Rhino objects.
Protected Method
GetTightBoundingBox(BoundingBox., Boolean, Transform)
Get tight bounding box of this Rhino object. The Rhino object is not modified.
Public Method
Static Member
GetTightBoundingBox(IEnumerable.RhinoObject., Plane, BoundingBox.)
Gets a plane aligned tight bounding box from a collection of Rhino objects.
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
HasCustomRenderMeshes
Returns true if the object will has a set of custom render primitives - ie, CustomRenderMeshes will return non-null.
Public Method
HasHistoryRecord
Returns whether this object has a history record
Public Method
HasTextureMapping
Returns true if this object has a texture mapping form any source (pluginId)
Public Method
Highlight
Modifies the highlighting of the object.
Public Method
HighlightSubObject
Highlights a sub-object.
Public Method
HistoryChildren
Gets the ids of the child Rhino objects of this object.
Public Method
HistoryParents
Gets the ids of the parent Rhino objects of this object.
Public Method
InVisualAnalysisMode.
Reports if any visual analysis mode is currently active for an object.
Public Method
InVisualAnalysisMode(VisualAnalysisMode)
Reports if a visual analysis mode is currently active for an object.
Public Method
IsActiveInViewport
Determine if this object is active in a particular viewport.
Public Method
IsHighlighted
Check highlight state.
Public Method
IsMeshable
Returns true if the object is capable of having a mesh of the specified type
Public Method
IsSelectable.
Reports if an object can be selected.
Public Method
IsSelectable(Boolean, Boolean, Boolean, Boolean)
Reports if an object can be selected.
Public Method
IsSelected
Check selection state.
Public Method
IsSubObjectHighlighted
Determines if a sub-object is highlighted.
Public Method
IsSubObjectSelectable
Reports if a sub-object can be selected.
Public Method
IsSubObjectSelected
Check sub-object selection state.
Public Method
IsValidWithLog
Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
(Inherited from CommonObject.)
Public Method
LockId
Locks the component Id property.
(Inherited from ModelComponent.)
Public Method
LockIndex
Locks the component Index property.
(Inherited from ModelComponent.)
Public Method
LockName
Locks the component Name property.
(Inherited from ModelComponent.)
Protected Method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public Method
MemoryEstimate
Computes an estimate of the number of bytes that this object is using in memory. Note that this is a runtime memory estimate and does not directly compare to the amount of space take up by the object when saved to a file.
Public Method
MeshCount
RhinoObjects can have several different types of meshes and different numbers of meshes. A b-rep can have a render and an analysis mesh on each face. A mesh object has a single render mesh and no analysis mesh. Curve, point, and annotation objects have no meshes.
Public Method
Static Member
MeshObjects(IEnumerable.RhinoObject., MeshingParameters, .Mesh.., .ObjectAttributes..)
Meshes Rhino objects.
Public Method
Static Member
MeshObjects(IEnumerable.RhinoObject., MeshingParameters, .Mesh.., .ObjectAttributes.., Boolean)
Meshes Rhino objects.
Public Method
Static Member
MeshObjects(IEnumerable.RhinoObject., MeshingParameters., Boolean., .Mesh.., .ObjectAttributes..)
Meshes Rhino objects.
Public Method
Static Member
MeshObjects(IEnumerable.RhinoObject., MeshingParameters., Int32., Transform, .Mesh.., .ObjectAttributes..)
Meshes Rhino objects.
Protected Method
NonConstOperation
For derived classes implementers.
Defines the necessary implementation to free the instance from being constant.
(Inherited from CommonObject.)
Public Method
ObjectFrame.
Public Method
ObjectFrame(RhinoObject.ObjectFrameFlags)
Protected Method
OnAddToDocument
This call informs an object it is about to be added to the list of active objects in the document.
Protected Method
OnDeleteFromDocument
This call informs an object it is about to be deleted. Some objects, like clipping planes, need to do a little extra cleanup before they are deleted.
Protected Method
OnDraw
Called when Rhino wants to draw this object
Protected Method
OnDuplicate
Called when this a new instance of this object is created and copied from an existing object
Protected Method
OnPick
Called to determine if this object or some sub-portion of this object should be picked given a pick context.
Protected Method
OnPicked
Called when this object has been picked
Protected Method
OnSelectionChanged
Called when the selection state of this object has changed
Protected Method
OnSpaceMorph
Called when a space morph has been applied to the geometry. Currently this only works for CustomMeshObject instances
Protected Method
OnSwitchToNonConst
Is called when a non-constant operation first occurs.
(Inherited from CommonObject.)
Protected Method
OnTransform
Called when a transformation has been applied to the geometry
Public Method
RenderMeshes
Returns a set of custom render primitives for this object.
Public Method
Code Example
Select(Boolean)
Selects an object.
Public Method
Select(Boolean, Boolean)
Selects an object.
Public Method
Select(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Selects an object.
Public Method
SelectSubObject(ComponentIndex, Boolean, Boolean)
Reports if an object can be selected.
Public Method
SelectSubObject(ComponentIndex, Boolean, Boolean, Boolean)
Reports if an object can be selected.
Public Method
SetCopyHistoryOnReplace
If this object has a history record, the CopyOnReplace field is set When an object is replaced in a document and the old object has a history record with this field set, the history record is copied and attached to the new object. That allows a descendant object to continue the history linkage after it is edited.
Public Method
SetCustomRenderMeshParameter
Set the named custom render mesh parameter value for this object.
Public Method
SetHistory
For expert use only. Sets the history record that describes how this object was created. This information is used to update this object when Rhino history is enabled and an input object changes.
Public Method
SetObjectFrame(Plane)
Public Method
SetObjectFrame(Transform)
Public Method
SetRenderMeshParameters
Sets the per-object meshing parameters for this object. When set, this object will use these meshing parameters when generating a render mesh, instead of those provided by the document.
Public Method
SetTextureMapping(Int32, TextureMapping)
Public Method
SetTextureMapping(Int32, TextureMapping, Transform)
Sets texture mapping and mapping object transform for a channel
Public Method
ShortDescription
Gets a localized short descriptive name of the object.
Public Method
ShortDescriptionWithClosedStatus
Gets a localized short descriptive name of the object, along with it’s open/closed status.
Public Method
SupportsRenderPrimitiveList(ViewportInfo, DisplayPipelineAttributes)
Obsolete.
Determines if custom render meshes will be built for a particular object.
Public Method
SupportsRenderPrimitiveList(ViewportInfo, Boolean)
Obsolete.
Determines if custom render meshes will be built for a particular object.
Public Method
ToJSON
Create a JSON string representation of this object
(Inherited from CommonObject.)
Public Method
ToString
Returns the name of the model component type, and then its name and index.
(Inherited from ModelComponent.)
Public Method
TryGetGumballFrame
If a Rhino object has been manipulated by Rhino’s gumball, and the gumball is not in its default position, then the object’s repositioned gumball frame is returned.
Public Method
TryGetRenderPrimitiveBoundingBox(ViewportInfo, DisplayPipelineAttributes, BoundingBox.)
Obsolete.
Get the bounding box for the custom render meshes associated with this object.
Public Method
TryGetRenderPrimitiveBoundingBox(ViewportInfo, Boolean, BoundingBox.)
Obsolete.
Get the bounding box for the custom render meshes associated with this object.
Public Method
UnhighlightAllSubObjects
Removes highlighting from all sub-objects.
Public Method
UnselectAllSubObjects
Removes selection from all sub-objects.
Inheritance Hierarchy
System.Object
Rhino.Runtime.CommonObject
Rhino.DocObjects.ModelComponent
Rhino.DocObjects.RhinoObject
Rhino.DocObjects.AnnotationObjectBase
Rhino.DocObjects.BrepObject
Rhino.DocObjects.ClippingPlaneObject
Rhino.DocObjects.CurveObject
Rhino.DocObjects.DetailViewObject
Rhino.DocObjects.ExtrusionObject
Rhino.DocObjects.GripObject
Rhino.DocObjects.HatchObject
Rhino.DocObjects.InstanceObject
Rhino.DocObjects.LightObject
Rhino.DocObjects.MeshObject
Rhino.DocObjects.MorphControlObject
Rhino.DocObjects.NamedViewWidgetObject
Rhino.DocObjects.PointCloudObject
Rhino.DocObjects.PointObject
Rhino.DocObjects.ProxyObject
Rhino.DocObjects.SubDObject
Rhino.DocObjects.SurfaceObject
Rhino.DocObjects.TextDotObject