Properties

ActiveCount

#Since v5.0
Returns number of linetypes in the linetypes table, excluding deleted linetypes.
public int ActiveCount { get; }

ByLayerLinetypeName

#Since v5.0
Returns the text name of the by-layer linetype.
public string ByLayerLinetypeName { get; }

ByParentLinetypeName

#Since v6.0
Returns the text name of the by-parent linetype.
public string ByParentLinetypeName { get; }

ComponentType

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

ContinuousLinetypeName

#Since v5.0
Returns the text name of the continuous linetype.
public string ContinuousLinetypeName { get; }

Count

#Since v5.0
Returns number of linetypes in the linetypes table, including deleted linetypes.
public int Count { get; }

CurrentLinetype

#Since v5.0
Returns reference to the current linetype. Note that this reference may become invalid after a call to AddLinetype().
public Linetype CurrentLinetype { get; }
Remarks: At all times, there is a "current" linetype. Unless otherwise specified, new objects are assigned to the current linetype. The current linetype is never deleted.

CurrentLinetypeIndex

#Since v5.0
At all times, there is a "current" linetype. Unless otherwise specified, new objects are assigned to the current linetype. If the current linetype source is LinetypeFromLayer the object's layer's linetype is used instead.
public int CurrentLinetypeIndex { get; }

CurrentLinetypeSource

#Since v5.0
Source used by an object to determine its current linetype to be used by new objects.
public ObjectLinetypeSource CurrentLinetypeSource { get; set; }

Document

#Since v5.0
Document that owns this table.
public RhinoDoc Document { get; }

LinetypeScale

#Since v5.0
For display in Rhino viewports, the linetypes are scaled by a single scale factor for all viewports. This is not used for printing, where all linetype patterns are scaled to print in their defined size 1:1 on the paper.
public double LinetypeScale { get; set; }

Indexers

this[]

#
Conceptually, the linetype table is an array of linetypes. The operator[] can be used to get individual linetypes. A linetype is either active or deleted and this state is reported by Linetype.IsDeleted.
public Linetype this[
index
zero based array index.
] { get; }
Remarks: Detaching a worksession reference model, or purging a linked instance definition, removes its linetypes but leaves the table slots they occupied empty; the slots cannot be closed up, because table indices are persistent references that objects store. Count spans the empty slots and they accumulate for the life of the document. An index that lands on one returns the continuous line pattern rather than throwing, and nothing about it says it is a stand-in except its index, which is -1 and never the index you asked for - so test index == Linetypes[index].Index before treating an entry as real. Enumerating the table with foreach goes through the document manifest rather than the raw table array, so it does not visit empty slots at all. See RH-97389.
Reference to the linetype. If index is out of range, the current linetype is returned. Note that this reference may become invalid after AddLinetype() is called.

Methods

Add

#Since v5.0
Adds a new linetype with specified definition to the linetype table.
public int Add(
linetype
Definition of new linetype. The information in linetype is copied. If linetype.Name is empty then a unique name of the form "Linetype 01" will be automatically created.
)
Index of newline type or -1 on error.

Add

#Since v5.0
Adds a new linetype with specified definition to the linetype table.
public int Add(
name,
A name for the new linetype.
segmentLengths
Positive values are dashes, negative values are gaps.
)
Index of new linetype or -1 on error.

AddReferenceLinetype

#Since v5.0
Adds a reference linetypes that will not be saved in files.
public int AddReferenceLinetype(
linetype
Definition of new linetype. The information in linetype is copied. If linetype.Name is empty then a unique name of the form "Linetype 01" will be automatically created.
)
Index of new linetype or -1 on error.

Clear

Marks all items as deleted.
public void Clear()
inherited fromCommonComponentTable<T>

Delete

#Since v5.0
Deletes multiple linetypes.
public bool Delete(
indices,
An array, a list or any enumerable instance of linetype indices.
quiet
If true, no warning message box appears if a linetype the linetype cannot be deleted because it is the current linetype or it contains active geometry.
)
true if operation succeeded.

Delete

#Since v5.0
Deletes linetype.
public bool Delete(
index,
zero based index of linetype to delete.
quiet
If true, no warning message box appears if a linetype the linetype cannot be deleted because it is the current linetype or it contains active geometry.
)
true if successful. false if linetypeIndex is out of range or the linetype cannot be deleted because it is the current linetype or because it linetype is referenced by active geometry.

Delete

#Since v6.0
public override bool Delete()

Find

#Since v5.0
Finds a linetype with a matching ID.
public int Find(
id,
The ID of the line type to be found.
ignoreDeletedLinetypes
If true, deleted linetypes are not checked.
)
If the linetype was found, the linetype index, >=0, is returned. If the linetype was not found, -1 is returned. Note, the linetype index of -1 denotes the default, or "Continuous" linetype.

Find

#Since v5.0 Obsolete v6.0
Obsolete. Use the other overload.
[EditorBrowsable(EditorBrowsableState.Never)] public int Find(
name,
search ignores case.
ignoreDeletedLinetypes
If true, deleted linetypes are not checked.
)
obsoleteignoreDeletedLinetypes is now ignored. Items are removed permanently now. Remove the second method argument.
>=0 index of the linetype with the given name -1 no linetype has the given name.

Find

#Since v6.0
Finds the linetype with a given name.
public int Find(
name
The name of the linetype to find. The search ignores case.
)
If the linetype was found, the linetype index, >=0, is returned. If the linetype was not found, -1 is returned. Note, the linetype index of -1 denotes the default, or "Continuous" linetype.

FindId

Uses the guid to find a model component. Deleted objects cannot be found by id. The guid is the value that is stored in the .Id property. In a single document, no two active objects have the same guid. If an object is replaced with a new object, then the guid persists. For example, if the _Move command moves an object, then the moved object inherits its guid from the starting object. If the Copy command copies an object, then the copy gets a new guid. This guid persists through file saving/opening operations. This function will not find grip objects.
public virtual T FindId(
id
ID of model component to search for.
)
inherited fromCommonComponentTable<T>
Reference to the rhino object with the objectId or null if no such object could be found.
FindId

FindIndex

#Since v6.0
Retrieves a Linetype object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
public Linetype FindIndex(
index
The index to search for.
)
A Linetype object, or null if none was found.

FindName

#Since v6.0
Finds the linetype with a given name.
public Linetype FindName(
name
he name of the linetype to find.
)
The linetype. If the linetype was not found, then the default, or "Continuous" linetype is returned.

GetEnumerator

#Since v5.0
public override IEnumerator<Linetype> GetEnumerator()

GetUnusedLinetypeName

#Since v6.0
Gets unused linetype name used as default when creating new linetypes.
public string GetUnusedLinetypeName()
The unused linetype name.

GetUnusedLinetypeName

#Since v5.0 Obsolete v6.0
Obsolete. Use the other overload. Gets unused linetype name used as default when creating new linetypes.
public string GetUnusedLinetypeName(
ignoreDeleted
If this is true then a name used by a deleted linetype is allowed.
)
obsoleteignoreDeleted is now ignored. Items are removed permanently now. Remove the second method argument.
The unused linetype name.

LinetypeIndexForObject

#Since v5.0
Returns the effective linetype index to be used to find the linetype definition to draw an object. If an object's linetype source is LinetypeFromObject, the linetype index in the object's attributes is used. If an object's linetype source is LinetypeFromLayer the linetype index from the object's layer is used.
public int LinetypeIndexForObject(
rhinoObject
The Rhino object to use in the query.
)
The effective linetype index.

LoadDefaultLinetypes

#Since v6.0
Fills in the linetype table with any default linetypes not already included.
public int LoadDefaultLinetypes()
Remarks: New documents only contain the continuous linetype. Other default linetypes are added, on demand, when the user needs them. Calling this function ensures that the linetype table is populated with the default linetypes.
The number of default linetypes added to the linetype table.

LoadDefaultLinetypes

#Since v8.0
Fills in the linetype table with any default linetypes not already included.
public int LoadDefaultLinetypes(
ignoreDeleted
Ignore default linetypes that have been deleted.
)
Remarks: New documents only contain the continuous linetype. Other default linetypes are added, on demand, when the user needs them. Calling this function ensures that the linetype table is populated with the default linetypes.
The number of default linetypes added to the linetype table.

Modify

#Since v5.0
Modify linetype settings.
public bool Modify(
linetype,
New linetype settings. This information is copied.
index,
Zero based index of linetype to set.
quiet
if true, information message boxes pop up when illegal changes are attempted.
)
true if successful. false if linetype_index is out of range or the settings attempt to lock or hide the current linetype.

PurgeUnused

#Since v9.0
Purges any unused linetypes.
public int PurgeUnused()
The number of unused linetypes that were purged.

SetCurrentLinetypeIndex

#Since v5.0
At all times, there is a "current" linetype. Unless otherwise specified, new objects are assigned to the current linetype. The current linetype is never deleted.
public bool SetCurrentLinetypeIndex(
linetypeIndex,
Value for new current linetype. 0 <= linetypeIndex < LinetypeTable.Count.
quiet
if true, then no warning message box pops up if the current linetype request can't be satisfied.
)
true if current linetype index successfully set.
Explicit

ICollection<Linetype>.Add

#Since v5.0
void ICollection<Linetype>.Add()

Undelete

#Since v5.0
Restores a linetype that has been deleted.
public bool Undelete(
index
A linetype index to be undeleted.
)
true if successful.

UndoModify

#Since v5.0
If the linetype has been modified and the modification can be undone, then UndoModify() will restore the linetype to its previous state.
public bool UndoModify(
index
Zero based index of linetype for which to undo changes.
)
true if this linetype had been modified and the modifications were undone.