Properties

ActiveCount

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

ByLayerLinetypeName

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

ByParentLinetypeName

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

ComponentType

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

ContinuousLinetypeName

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

Count

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

CurrentLinetype

#Since v5.0
public Linetype CurrentLinetype { get; }
Returns reference to the current linetype. Note that this reference may become invalid after a call to AddLinetype().
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
public int CurrentLinetypeIndex { get; }
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.

CurrentLinetypeSource

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

Document

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

LinetypeScale

#Since v5.0
public double LinetypeScale { get; set; }
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.

Indexers

this[]

#
public Linetype this[int index] { get; }
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.
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.
index (int)zero based array index.
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
public int Add(Linetype linetype)
Adds a new linetype with specified definition to the linetype table.
linetype (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
public int Add(string name, IEnumerable<double> segmentLengths)
Adds a new linetype with specified definition to the linetype table.
name (string)A name for the new linetype.
segmentLengths (IEnumerable<double>)Positive values are dashes, negative values are gaps.
Index of new linetype or -1 on error.

AddReferenceLinetype

#Since v5.0
public int AddReferenceLinetype(Linetype linetype)
Adds a reference linetypes that will not be saved in files.
linetype (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

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

Delete

#Since v5.0
public bool Delete(IEnumerable<int> indices, bool quiet)
Deletes multiple linetypes.
indices (IEnumerable<int>)An array, a list or any enumerable instance of linetype indices.
quiet (bool)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
public bool Delete(int index, bool quiet)
Deletes linetype.
index (int)zero based index of linetype to delete.
quiet (bool)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(Linetype item)
item (Linetype)

Find

#Since v5.0
public int Find(Guid id, bool ignoreDeletedLinetypes)
Finds a linetype with a matching ID.
id (Guid)The ID of the line type to be found.
ignoreDeletedLinetypes (bool)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
[EditorBrowsable(EditorBrowsableState.Never)] public int Find(string name, bool ignoreDeletedLinetypes)
obsoleteignoreDeletedLinetypes is now ignored. Items are removed permanently now. Remove the second method argument.
Obsolete. Use the other overload.
name (string)search ignores case.
ignoreDeletedLinetypes (bool)If true, deleted linetypes are not checked.
>=0 index of the linetype with the given name -1 no linetype has the given name.

Find

#Since v6.0
public int Find(string name)
Finds the linetype with a given name.
name (string)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

public virtual T FindId(Guid id)
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.
inherited fromCommonComponentTable<T>
id (Guid)ID of model component to search for.
Reference to the rhino object with the objectId or null if no such object could be found.
FindId

FindIndex

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

FindName

#Since v6.0
public Linetype FindName(string name)
Finds the linetype with a given name.
name (string)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
public string GetUnusedLinetypeName()
Gets unused linetype name used as default when creating new linetypes.
The unused linetype name.

GetUnusedLinetypeName

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

LinetypeIndexForObject

#Since v5.0
public int LinetypeIndexForObject(RhinoObject rhinoObject)
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.
rhinoObject (RhinoObject)The Rhino object to use in the query.
The effective linetype index.

LoadDefaultLinetypes

#Since v6.0
public int LoadDefaultLinetypes()
Fills in the linetype table with any default linetypes not already included.
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
public int LoadDefaultLinetypes(bool ignoreDeleted)
Fills in the linetype table with any default linetypes not already included.
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.
ignoreDeleted (bool)Ignore default linetypes that have been deleted.
The number of default linetypes added to the linetype table.

Modify

#Since v5.0
public bool Modify(Linetype linetype, int index, bool quiet)
Modify linetype settings.
linetype (Linetype)New linetype settings. This information is copied.
index (int)Zero based index of linetype to set.
quiet (bool)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
public int PurgeUnused()
Purges any unused linetypes.
The number of unused linetypes that were purged.

SetCurrentLinetypeIndex

#Since v5.0
public bool SetCurrentLinetypeIndex(int linetypeIndex, bool quiet)
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.
linetypeIndex (int)Value for new current linetype. 0 <= linetypeIndex < LinetypeTable.Count.
quiet (bool)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(Linetype item)
item (Linetype)

Undelete

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

UndoModify

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