Properties
Returns number of linetypes in the linetypes table, excluding deleted linetypes.
Returns the text name of the by-layer linetype.
Returns the text name of the by-parent linetype.
Overrides: CommonComponentTable<T>.ComponentType
Returns the text name of the continuous linetype.
Returns number of linetypes in the linetypes table, including deleted linetypes.
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.
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.
Source used by an object to determine its current linetype to be used by new objects.
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.
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.
Parameters:
| index (int) | zero based array index. |
Returns: 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
Adds a new linetype with specified definition to the linetype table.
Parameters:
| 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. |
Returns: Index of newline type or -1 on error.
Adds a new linetype with specified definition to the linetype table.
Parameters:
| name (string) | A name for the new linetype. |
| segmentLengths (IEnumerable<double>) | Positive values are dashes, negative values are gaps. |
Returns: Index of new linetype or -1 on error.
Adds a reference linetypes that will not be saved in files.
Parameters:
| 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. |
Returns: Index of new linetype or -1 on error.
Clear
public void Clear()
Marks all items as deleted.
Deletes multiple linetypes.
Parameters:
| 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. |
Returns: true if operation succeeded.
Deletes linetype.
Parameters:
| 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. |
Returns: 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.
Parameters:
| item (Linetype) |
Overrides: CommonComponentTable<T>.Delete
Finds a linetype with a matching ID.
Parameters:
| id (Guid) | The ID of the line type to be found. |
| ignoreDeletedLinetypes (bool) | If true, deleted linetypes are not checked. |
Returns: 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.
[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.
Finds the linetype with a given name.
Parameters:
| name (string) | The name of the linetype to find. The search ignores case. |
Returns: 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.
Retrieves a Linetype object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
Parameters:
| index (int) | The index to search for. |
Returns: A Linetype object, or null if none was found.
Finds the linetype with a given name.
Parameters:
| name (string) | he name of the linetype to find. |
Returns: The linetype. If the linetype was not found, then the default, or "Continuous" linetype is returned.
Overrides: CommonComponentTable<T>.GetEnumerator
Gets unused linetype name used as default when creating new linetypes.
Returns: The unused linetype name.
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.
Parameters:
| ignoreDeleted (bool) | If this is true then a name used by a deleted linetype is allowed. |
Returns: The unused linetype name.
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.
Parameters:
| rhinoObject (RhinoObject) | The Rhino object to use in the query. |
Returns: The effective linetype index.
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.
Returns: The number of default linetypes added to the linetype table.
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.
Parameters:
| ignoreDeleted (bool) | Ignore default linetypes that have been deleted. |
Returns: The number of default linetypes added to the linetype table.
Modify linetype settings.
Parameters:
| 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. |
Returns: true if successful. false if linetype_index is out of range or the settings attempt to lock or hide the current linetype.
Purges any unused linetypes.
Returns: The number of unused linetypes that were purged.
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.
Parameters:
| item (Linetype) |
Restores a linetype that has been deleted.
Parameters:
| index (int) | A linetype index to be undeleted. |
Returns: true if successful.
If the linetype has been modified and the modification can be undone, then UndoModify() will restore the linetype to its previous state.
Parameters:
| index (int) | Zero based index of linetype for which to undo changes. |
Returns: true if this linetype had been modified and the modifications were undone.