Properties

ComponentStatus

#Since v6.0
Gets or sets the component status of the model component.
public virtual ComponentStatus ComponentStatus { get; set; }

ComponentType

#Since v6.0
Gets the ModelComponentType for this object. Useful in switch statements.
public abstract ModelComponentType ComponentType { get; }

DeletedName

#Since v6.2
Gets the name of a component that is deleted.
public string DeletedName { get; }

Disposed

Indicates if this object has been disposed or the document it originally belonged to has been disposed.
public bool Disposed { get; }
inherited fromCommonObject

HasId

#Since v6.0
Returns a value indicating whether the component has an ID.
public bool HasId { get; }

HasIndex

#Since v6.0
Returns a value indicating whether the component has an Index.
public bool HasIndex { get; }

HasName

#Since v6.0
Returns a value indicating whether the component has a Name.
public bool HasName { get; }

HasUserData

Gets true if this class has any custom information attached to it through UserData.
public bool HasUserData { get; }
inherited fromCommonObject

Id

#Since v6.0
Gets or sets the ID of the current instance.
public virtual Guid Id { get; set; }
InvalidOperationExceptionWhen setting the ID failed. This usually happened because the instance ID is already locked.

IdIsLocked

#Since v6.0
Returns a value indicating whether the component ID is already locked.
public bool IdIsLocked { get; }

Index

#Since v6.0
Gets or sets the model component index attribute.
public virtual int Index { get; set; }
InvalidOperationExceptionWhen setting the Index failed. This usually happens because the instance Index is already locked.

IndexIsLocked

#Since v6.0
Returns a value indicating whether the component Index is already locked.
public bool IndexIsLocked { get; }

InstanceDefinitionModelSerialNumber

#Since v6.12
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.
[CLSCompliant(false)] public virtual uint InstanceDefinitionModelSerialNumber { get; }
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

IsComponentStatusLocked

#Since v6.0
The component status itself can be locked. This returns an indication.
public bool IsComponentStatusLocked { get; }

IsDeleted

#Since v8.0
true if the component is deleted. Deleted components are kept by the document for undo purposes.
public virtual bool IsDeleted { get; }

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.
public virtual bool IsDocumentControlled { get; }
inherited fromCommonObject

IsReference

#Since v8.0
Gets a value indicting whether this component is a referenced component. Referenced components are part of referenced documents.
public virtual bool IsReference { get; }

IsSystemComponent

#Since v6.0
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
public bool IsSystemComponent { get; }

IsValid

Tests an object to see if it is valid.
public virtual bool IsValid { get; }
inherited fromCommonObject

ModelSerialNumber

#Since v6.12
A value identifying the model that manages this component.
[CLSCompliant(false)] public virtual uint ModelSerialNumber { get; }
Remarks: If the component is being managed by a model, this value identifies the model. In Rhino, this value is the document runtime serial number. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

Name

#ExampleSince v6.0
Gets or sets the name
public virtual string Name { get; set; }
InvalidOperationExceptionWhen setting the Name failed. This usually happens because the instance Name is already locked.

NameIsLocked

#Since v6.0
Returns a value indicating whether the component Name is already locked.
public bool NameIsLocked { get; }

NamePathSeparator

#Since v8.0
Returns the string "::". This is the string Rhino uses in layer full path names to separate the names of individual layers.
public static string NamePathSeparator { get; }

ReferenceModelSerialNumber

#Since v6.12
When a component is in a model for reference, this value identifies the reference model.
[CLSCompliant(false)] public virtual uint ReferenceModelSerialNumber { get; }
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.

UserData

List of custom information that is attached to this class.
public UserDataList UserData { get; }
inherited fromCommonObject

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.
public ArchivableDictionary UserDictionary { get; }
inherited fromCommonObject

Methods

ClearId

#Since v6.0
Resets the HasId property of the model component to false, if possible.
public void ClearId()
InvalidOperationExceptionIf the ID is locked.

ClearIndex

#Since v6.0
Resets the HasIndex property of the model component to false, if possible.
public void ClearIndex()
InvalidOperationExceptionIf the index is locked.

ClearName

#Since v6.0
Resets the HasName property of the model component to false, if possible.
public void ClearName()
InvalidOperationExceptionIf the name is locked.

ConstructConstObject

Assigns a parent object and a sub-object index to this.
protected void ConstructConstObject(
parentObject,
The parent object.
subobjectIndex
The sub-object index.
)
inherited fromCommonObject

DataCRC

#Since v6.0
Increments the Cyclic Redundancy Check value by this instance.
[CLSCompliant(false)] public uint DataCRC(
currentRemainder
The current remainder value.
)
The updated remainder value.

Dispose

Actively reclaims unmanaged resources that this instance uses.
public void Dispose()
inherited fromCommonObject

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.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)
inherited fromCommonObject

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.
public void EnsurePrivateCopy()
inherited fromCommonObject

GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)
inherited fromCommonObject

IsValidComponentName

#Since v6.15
Tests for a valid model component name.
public static bool IsValidComponentName(
name
The string to validate.
)
true if the string is a valid model component name, false otherwise.

IsValidWithLog

Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
public bool IsValidWithLog(
out string
log
A textual log. This out parameter is assigned during this call.
)
inherited fromCommonObject
true if this object is valid; false otherwise.

LockId

#Since v6.0
Locks the component Id property.
public void LockId()

LockIndex

#Since v6.0
Locks the component Index property.
public void LockIndex()

LockName

#Since v6.0
Locks the component Name property.
public void LockName()

ModelComponentTypeIgnoresCase

#Since v6.0
Informs the developer if a particular model component type will require case-ignoring searching within a document. This is currently true with groups; false otherwise.
public static bool ModelComponentTypeIgnoresCase(
type
True if the component ignores case.
)

ModelComponentTypeIncludesParent

#Since v6.0
Informs the developer if a particular model component type will include the hash of the parent.
public static bool ModelComponentTypeIncludesParent(
type
True if the component includes parent hash.
)

ModelComponentTypeRequiresUniqueName

#Since v6.0
Informs the developer if a particular model component type will require uniqueness within a document. This is currently true with render materials and model geometry; false otherwise.
public static bool ModelComponentTypeRequiresUniqueName(
type
The type to check.
)
true with render materials and model geometry; false otherwise.

NonConstOperation

For derived classes implementers.

Defines the necessary implementation to free the instance from being constant.

protected virtual void NonConstOperation()
inherited fromCommonObject

OnSwitchToNonConst

Is called when a non-constant operation first occurs.
protected virtual void OnSwitchToNonConst()
inherited fromCommonObject

ToJSON

Create a JSON string representation of this object
public string ToJSON()
inherited fromCommonObject

ToString

#
Returns the name of the model component type, and then its name and index.
public override string ToString()
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Object.ToString