All of the hatch pattern definitions contained in a rhino document.

Properties

ComponentType

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

Count

public virtual int Count { get; }
Returns the count of all items, including deleted ones.
inherited fromCommonComponentTable<T>

CurrentHatchPatternIndex

#ExampleSince v5.0
public int CurrentHatchPatternIndex { get; set; }
At all times, there is a "current" hatch pattern. Unless otherwise specified, new objects are assigned to the current hatch pattern. The current hatch pattern is never locked, hidden, or deleted.

Document

public RhinoDoc Document { get; }
Document that owns this table.
inherited fromRhinoDocCommonTable<T>

Indexers

this[]

#
public HatchPattern this[int index] { get; }
Conceptually, the hatch pattern table is an array of hatch patterns. The operator[] can be used to get individual hatch patterns. A hatch pattern is either active or deleted and this state is reported by HatchPattern.IsDeleted.
Remarks: Detaching a worksession reference model, or purging a linked instance definition, removes its hatch patterns 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 default hatch 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 == HatchPatterns[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.
If index is out of range, the current hatch pattern is returned.

Methods

Add

#Since v5.0
public int Add(HatchPattern pattern)
Adds a new hatch pattern with specified definition to the table.
pattern (HatchPattern)definition of new hatch pattern. The information in pattern is copied. If pattern.Name is empty the a unique name of the form "HatchPattern 01" will be automatically created.
>=0 index of new hatch pattern -1 not added because a hatch pattern with that name already exists or some other problem occurred.

Clear

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

Delete

#Since v6.0
public bool Delete(HatchPattern item, bool quiet)
Deletes a hatch pattern from the table.
item (HatchPattern)The hatch pattern to delete.
quiet (bool)If true, no warning message box appears if hatch pattern cannot be deleted.
true if successful, false otherwise.

Delete

#Since v6.0
public override bool Delete(HatchPattern item)
Deletes a hatch pattern from the table.
item (HatchPattern)The hatch pattern to delete.
true if successful, false otherwise.

Delete

#Since v7.0
public bool Delete(int hatchPatternIndex, bool quiet)
Deletes a hatch pattern from the table.
hatchPatternIndex (int)The index of the hatch pattern to delete.
quiet (bool)If true, no warning message box appears if hatch pattern cannot be deleted.
true if successful, false otherwise.

Delete

#Since v7.0
public bool Delete(int hatchPatternIndex)
Deletes a hatch pattern from the table.
hatchPatternIndex (int)The index of the hatch pattern to delete.
true if successful, false otherwise.

Delete

#Since v9.0
public int Delete(IEnumerable<int> hatchPatternIndices, bool quiet)
Delete multiple hatch patterns.
hatchPatternIndices (IEnumerable<int>)An enumeration of hatch pattern indices.
quiet (bool)If true, no warning message box appears if a hatch pattern is in use.
The number of hatch patterns that were deleted.

Find

#ExampleSince v5.0 Obsolete v6.0
public int Find(string name, bool ignoreDeleted)
obsoleteignoreDeleted is now ignored. Items are removed permanently now. Use FindName.
Finds the hatch pattern with a given name. Search ignores case.
name (string)The name of the hatch pattern to be found.
ignoreDeleted (bool)true means don't search deleted hatch patterns.
Index of the hatch pattern with the given name. -1 if no hatch pattern found.

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 HatchPattern FindIndex(int index)
Retrieves a HatchPattern 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 HatchPattern object, or null if none was found.

FindName

#ExampleSince v6.0
public HatchPattern FindName(string name)
Finds the hatch pattern with a given name. Search ignores case.
name (string)The name of the hatch pattern to be found.
Hatch pattern with the given name. Null if no hatch pattern found.

FindNameHash

#Since v6.0
public HatchPattern FindNameHash(NameHash nameHash)
Finds a HatchPattern given its name hash.
nameHash (NameHash)The name hash of the HatchPattern to be searched.
An Linetype, or null on error.

GetEnumerator

public virtual IEnumerator<T> GetEnumerator()
Returns the enumerator that yields all items.
inherited fromCommonComponentTable<T>

GetUnusedHatchPatternName

#Since v9.0
public string GetUnusedHatchPatternName()
Gets unused hatchpattern name used as default when creating new hatchpatterns.
The unused hatchpattern name.

Modify

#Since v8.0
public bool Modify(HatchPattern hatchPattern, int hatchPatternIndex, bool quiet)
Modify hatch pattern settings.
hatchPattern (HatchPattern)Definition of new hatch pattern. The information in the hatch pattern is copied.
hatchPatternIndex (int)Zero based index of the hatch pattern to modify.
quiet (bool)If true, information message boxes pop up when illegal changes are attempted.
True if successful, or false if hatchPatternIndex is out of range.

PurgeUnused

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

Rename

#Since v7.0
public bool Rename(HatchPattern item, string hatchPatternName)
Renames a hatch pattern in the table.
item (HatchPattern)The hatch pattern to rename
hatchPatternName (string)The new hatch pattern name.
true if successful, false otherwise.

Rename

#Since v7.0
public bool Rename(int hatchPatternIndex, string hatchPatternName)
Renames a hatch pattern in the table.
hatchPatternIndex (int)The index of the hatch pattern to rename.
hatchPatternName (string)The new hatch pattern name.
true if successful, false otherwise.
Explicit

ICollection<HatchPattern>.Add

#Since v5.0
item (HatchPattern)