public sealed class HatchPatternTable : RhinoDocCommonTable<HatchPattern>, ICollection<HatchPattern>
All of the hatch pattern definitions contained in a rhino document.
Properties
Overrides: CommonComponentTable<T>.ComponentType
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.
Indexers
this[]
#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.
Parameters:
| index (int) | zero based array index. |
Returns: If index is out of range, the current hatch pattern is returned.
Methods
Adds a new hatch pattern with specified definition to the table.
Parameters:
| 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. |
Returns: >=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.
Deletes a hatch pattern from the table.
Parameters:
| item (HatchPattern) | The hatch pattern to delete. |
| quiet (bool) | If true, no warning message box appears if hatch pattern cannot be deleted. |
Returns: true if successful, false otherwise.
Deletes a hatch pattern from the table.
Parameters:
| item (HatchPattern) | The hatch pattern to delete. |
Returns: true if successful, false otherwise.
Overrides: CommonComponentTable<T>.Delete
Deletes a hatch pattern from the table.
Deletes a hatch pattern from the table.
Parameters:
| hatchPatternIndex (int) | The index of the hatch pattern to delete. |
Returns: true if successful, false otherwise.
Delete multiple hatch patterns.
Parameters:
| 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. |
Returns: The number of hatch patterns that were deleted.
obsoleteignoreDeleted is now ignored. Items are removed permanently now. Use FindName.
Finds the hatch pattern with a given name. Search ignores case.
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 HatchPattern 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 HatchPattern object, or null if none was found.
Finds the hatch pattern with a given name. Search ignores case.
Parameters:
| name (string) | The name of the hatch pattern to be found. |
Returns: Hatch pattern with the given name. Null if no hatch pattern found.
Finds a HatchPattern given its name hash.
Parameters:
| nameHash (NameHash) | The name hash of the HatchPattern to be searched. |
Returns: An Linetype, or null on error.
GetEnumerator
Returns the enumerator that yields all items.
Gets unused hatchpattern name used as default when creating new hatchpatterns.
Returns: The unused hatchpattern name.
Modify hatch pattern settings.
Parameters:
| 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. |
Returns: True if successful, or false if hatchPatternIndex is out of range.
Purges any unused hatch patterns.
Returns: The number of unused hatch patterns that were purged.
Renames a hatch pattern in the table.
Parameters:
| item (HatchPattern) | The hatch pattern to rename |
| hatchPatternName (string) | The new hatch pattern name. |
Returns: true if successful, false otherwise.
Renames a hatch pattern in the table.
Parameters:
| item (HatchPattern) |