This is the same as InstanceDefinitionGeometry, but in a Rhino document.

Properties

ArchiveFileStatus

#Since v5.2
Returns the archive file status of a linked instance definition.
public InstanceDefinitionArchiveFileStatus ArchiveFileStatus { get; }

ComponentStatus

Gets or sets the component status of the model component.
public virtual ComponentStatus ComponentStatus { get; set; }
inherited fromModelComponent

ComponentType

#Since v6.0
public override ModelComponentType ComponentType { get; }

DeletedName

Gets the name of a component that is deleted.
public string DeletedName { get; }
inherited fromModelComponent

Description

Gets or sets the description of the definition.
public string Description { get; set; }
inherited fromInstanceDefinitionGeometry

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

Returns a value indicating whether the component has an ID.
public bool HasId { get; }
inherited fromModelComponent

HasIndex

Returns a value indicating whether the component has an Index.
public bool HasIndex { get; }
inherited fromModelComponent

HasName

Returns a value indicating whether the component has a Name.
public bool HasName { get; }
inherited fromModelComponent

HasUserData

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

Id

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

IdIsLocked

Returns a value indicating whether the component ID is already locked.
public bool IdIsLocked { get; }
inherited fromModelComponent

Index

#Since v5.0
Index of this instance definition in the index definition table.
public override int Index { get; }

IndexIsLocked

Returns a value indicating whether the component Index is already locked.
public bool IndexIsLocked { get; }
inherited fromModelComponent

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.
[CLSCompliant(false)] public virtual uint InstanceDefinitionModelSerialNumber { get; }
inherited fromModelComponent
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

The component status itself can be locked. This returns an indication.
public bool IsComponentStatusLocked { get; }
inherited fromModelComponent

IsDeleted

#ExampleSince v5.0
Returns true if this instance definition is deleted. Deleted object are not saved to a file archive.
public override 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

IsLinkedType

Returns true if this instance definition is linked to an external source archive, that is, if its InstanceDefinitionGeometry.UpdateType is InstanceDefinitionUpdateType.Linked or InstanceDefinitionUpdateType.LinkedAndEmbedded.
public bool IsLinkedType { get; }
inherited fromInstanceDefinitionGeometry

IsReference

#ExampleSince v5.0
An object from a work session reference model is reference a reference object and cannot be modified. An object is a reference object if, and only if, it is on a reference layer.
public override bool IsReference { get; }

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
public bool IsSystemComponent { get; }
inherited fromModelComponent

IsTenuous

#Since v5.0
True if this instance definition is from a linked file. It will be saved only if it is referenced by an instance reference object that is in the active geometry list and is being saved. Note that there can be multiple linked instance definitions with references to tenuous instance definitions.
public bool IsTenuous { get; }

IsValid

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

LayerStyle

#Since v7.8
Specifies how model components (layers, materials, dimension styles, etc.) from linked instance definition files appear in the active model.
public InstanceDefinitionLayerStyle LayerStyle { get; set; }

ModelSerialNumber

A value identifying the model that manages this component.
[CLSCompliant(false)] public virtual uint ModelSerialNumber { get; }
inherited fromModelComponent
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

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

NameIsLocked

Returns a value indicating whether the component Name is already locked.
public bool NameIsLocked { get; }
inherited fromModelComponent

ObjectCount

#Since v5.0
Number of objects this definition uses. This counts the objects that are used to define the geometry. This does NOT count the number of references to this instance definition.
public int ObjectCount { get; }

ReferenceModelSerialNumber

When a component is in a model for reference, this value identifies the reference model.
[CLSCompliant(false)] public virtual uint ReferenceModelSerialNumber { get; }
inherited fromModelComponent
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.

SkipNestedLinkedDefinitions

#Since v7.8
This property applies when an instance definition is linked. If true, when reading the file that defines the content of the linked instance definition, skip any linked instance definitions found in that file. If false, when reading the file that defines the content of the linked instance definition, recursively load linked instance definitions found in that file.
public bool SkipNestedLinkedDefinitions { get; set; }

SourceArchive

#Since v5.0
Gets the full file path for linked instance definitions.
public string SourceArchive { get; }

SourceArchiveRelativePath

Gets the source archive path for linked instance definitions relative to the file that contains this definition. Empty if the definition is not linked or no relative path is stored.
public string SourceArchiveRelativePath { get; }
inherited fromInstanceDefinitionGeometry

UnitSystem

#Since v7.0
Gets the unit system of the instance definition. If the instance definition was imported from another 3dm file, the unit system may differ from that of the document.
public UnitSystem UnitSystem { get; set; }

UpdateType

#Since v5.0
public InstanceDefinitionUpdateType UpdateType { get; }

Url

Gets or sets the URL or hyperlink of the definition.
public string Url { get; set; }
inherited fromInstanceDefinitionGeometry

UrlDescription

Gets or sets the description of the URL or hyperlink of the definition.
public string UrlDescription { get; set; }
inherited fromInstanceDefinitionGeometry

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

UserStringCount

Gets the amount of user strings.
public int UserStringCount { get; }
inherited fromInstanceDefinitionGeometry

Methods

ClearId

Resets the HasId property of the model component to false, if possible.
public void ClearId()
inherited fromModelComponent
InvalidOperationExceptionIf the ID is locked.

ClearIndex

Resets the HasIndex property of the model component to false, if possible.
public void ClearIndex()
inherited fromModelComponent
InvalidOperationExceptionIf the index is locked.

ClearName

Resets the HasName property of the model component to false, if possible.
public void ClearName()
inherited fromModelComponent
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

CreatePreviewBitmap

#Since v6.0
Creates a preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
definedViewportProjection,
The view projection.
displayMode,
The display mode.
bitmapSize,
The bitmap size in pixels.
applyDpiScaling
Specify true to apply DPI scaling (Windows-only).
)
The preview bitmap if successful, null otherwise.

CreatePreviewBitmap

#Since v5.0
Creates a preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
definedViewportProjection,
The view projection.
displayMode,
The display mode.
bitmapSize
The bitmap size in pixels.
)
The preview bitmap if successful, null otherwise.

CreatePreviewBitmap

#Since v6.0
Creates a wireframe preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
definedViewportProjection,
The view projection.
bitmapSize,
The bitmap size in pixels.
applyDpiScaling
Specify true to apply DPI scaling (Windows-only).
)
The preview bitmap if successful, null otherwise.

CreatePreviewBitmap

#Since v5.0
Creates a wireframe preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
definedViewportProjection,
The view projection.
bitmapSize
The bitmap size in pixels.
)
The preview bitmap if successful, null otherwise.

CreatePreviewBitmap

#Since v6.21
Creates a preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
definitionObjectId,
Id of one of this definition's objects to draw selected.
viewportProjection,
The view projection.
displayMode,
The display mode.
bitmapSize,
The bitmap size in pixels.
applyDpiScaling
Specify true to apply DPI scaling (Windows-only).
)
The preview bitmap if successful, null otherwise.

CreatePreviewBitmap

#Since v8.10
Creates a preview bitmap of the instance definition.
public Bitmap CreatePreviewBitmap(
displayModeId,
The id of the display mode to draw with.
viewportProjection,
The view projection.
isometricCamera,
The isometric camera angle.
drawDecorations,
Specify true to draw viewport decorations, such as grid and axes.
bitmapSize,
The bitmap size in pixels.
applyDpiScaling
Specify true to apply DPI scaling (Windows-only).
)
The preview bitmap if successful, null otherwise.

DataCRC

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

DeleteAllUserStrings

Deletes all user strings attached to this geometry.
public void DeleteAllUserStrings()
inherited fromInstanceDefinitionGeometry

DeleteUserString

Deletes the user string with the specified key from this geometry.
public bool DeleteUserString(
key
The key of the user string to delete.
)
inherited fromInstanceDefinitionGeometry
True if the user string was deleted or did not exist; otherwise, false.

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

Equals

#
Equality is checked against InstanceDefinition.Id
public override bool Equals(
obj
)
True if obj.Id equals Id
Object.Equals

GetContainers

#Since v5.0
Gets a list of all the InstanceDefinitions that contain a reference this InstanceDefinition.
public InstanceDefinition[] GetContainers()
An array of instance definitions. The returned array can be empty, but not null.

GetHashCode

#
Use Id.GetHashCode()
public override int GetHashCode()

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

GetObjectIds

Returns the unique identifiers of all objects that are part of this instance definition's geometry table.
[ConstOperation] public Guid[] GetObjectIds()
inherited fromInstanceDefinitionGeometry
An array of Guid values representing the object IDs in the instance geometry table.

GetObjects

#ExampleSince v5.0
Gets an array with the objects that belong to this instance definition.
public RhinoObject[] GetObjects()
An array of Rhino objects. The returned array can be empty, but not null.

GetReferences

#Since v5.0
Gets a list of the CRhinoInstanceObjects (inserts) that contains a reference this instance definition.
public InstanceObject[] GetReferences(
wheretoLook

0 = get top level references in active document.

1 = get top level and nested references in active document.

2 = check for references from other instance definitions.

)
An array of instance objects. The returned array can be empty, but not null.

GetUserString

Gets user string from this geometry.
public string GetUserString(
key
id used to retrieve the string.
)
inherited fromInstanceDefinitionGeometry
string associated with the key if successful. null if no key was found.

GetUserStrings

Gets a copy of all (user key string, user value string) pairs attached to this geometry.
public NameValueCollection GetUserStrings()
inherited fromInstanceDefinitionGeometry
A new collection.

InUse

#Since v5.0
Determines whether the instance definition is referenced.
public bool InUse(
wheretoLook

0 = check for top level references in active document.

1 = check for top level and nested references in active document.

2 = check for references in other instance definitions.

)
true if the instance definition is used; otherwise false.

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

Locks the component Id property.
public void LockId()
inherited fromModelComponent

LockIndex

Locks the component Index property.
public void LockIndex()
inherited fromModelComponent

LockName

Locks the component Name property.
public void LockName()
inherited fromModelComponent

NonConstOperation

For derived classes implementers.

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

protected virtual void NonConstOperation()
inherited fromCommonObject

Object

#Since v5.0
returns an object used as part of this definition.
public RhinoObject Object(
index
0 <= index < ObjectCount.
)
Returns an object that is used to define the geometry. Does NOT return an object that references this definition.count the number of references to this instance.

OnSwitchToNonConst

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

SetUserString

Attach a user string (key,value combination) to this geometry.
public bool SetUserString(
key,
id used to retrieve this string.
value
string associated with key.
)
inherited fromInstanceDefinitionGeometry
true on success.

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()
inherited fromModelComponent
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Object.ToString

UseCount

#Since v7.4
Returns the number of references of this instance definition in the model. Both top-level references and nested instances are included in the count.
public int UseCount()
The number of references of this instance definition in the model.

UseCount

#Since v7.4
Returns the number of references of this instance definition in the model. Both top-level references and nested instances are included in the count.
public int UseCount(
out int
topLevelReferenceCount,
The number of top-level references.
out int
nestedReferenceCount
The number of nested instances.
)
The number of references of this instance definition in the model.

UsesDefinition

#Since v5.0
Determines if this instance definition contains a reference to another instance definition.
public int UsesDefinition(
otherIdefIndex
index of another instance definition.
)
0 no 1 other_idef_index is the index of this instance definition >1 This InstanceDefinition uses the instance definition and the returned value is the nesting depth.

UsesLayer

#Since v8.7
Returns true if some object in the instance definition is on the layer with the specified layer index.
public bool UsesLayer(
layerIndex
The index of layer to search for.
)
True if there is an object in the instance definition that is on the layer.

UsesLinetype

#Since v8.7
Returns true if some object in the instance definition references the linetype with the specified linetype index.
public bool UsesLinetype(
linetypeIndex
The index of linetype to search for.
)
True if there is an object in the instance definition that references that linetype.