Constructors
public HatchPattern()
Properties
Hatchpattern patterns are typically interpreted as distances on the printed output when printing. In this case AlwaysModelDistances is false (default). When set to true, the hatch pattern will be interpreted as being in world distances.
ComponentStatus
Gets or sets the component status of the model component.
Returns ModelComponentType.HatchPattern.
Overrides: ModelComponent.ComponentType
Gets and sets a short description of the pattern.
Disposed
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
HasUserData
Gets true if this class has any custom information attached to it through UserData.
Get the number of HatchLines in the pattern.
Exceptions:
| InvalidOperationException | When setting the ID failed. This usually happened because the instance ID is already locked. |
IdIsLocked
Returns a value indicating whether the component ID is already locked.
Index in the hatch pattern table for this pattern. -1 if not in the table.
Overrides: ModelComponent.Index
IndexIsLocked
Returns a value indicating whether the component Index is already locked.
InstanceDefinitionModelSerialNumber
When a component is in a model as part of the information required for a linked instance definition, this value identifies the linked instance definition reference model.
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.
Returns true if the hatch pattern is in use by a Rhino object, a layer, an instance definition, or a section style.
IsComponentStatusLocked
The component status itself can be locked. This returns an indication.
Deleted hatch patterns are kept in the runtime hatch pattern table so that undo will work with hatch patterns. Call IsDeleted to determine to determine if a hatch pattern is deleted.
Overrides: ModelComponent.IsDeleted
IsDocumentControlled
If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
Rhino allows multiple files to be viewed simultaneously. Hatch patterns in the document are "normal" or "reference". Reference hatch patterns are not saved.
Overrides: ModelComponent.IsReference
IsSystemComponent
True if this model component is a system constant.
An incomplete list of system constant model components is below:
- ON_ModelComponent::Unset
- ON_InstanceDefinition::Empty
- ON_Linetype::Unset
- ON_Linetype::Continuous
- ON_Linetype::ByLayer
- ON_Linetype::ByParent
- ON_Layer::Unset
- ON_Layer::Default
- ON_TextStyle::Unset
- ON_TextStyle::Default
- ON_TextStyle::ByLayer
- ON_TextStyle::ByParent
- ON_DimStyle::Unset
- ON_DimStyle::Default
- ON_DimStyle::DefaultInchDecimal
- ON_DimStyle::DefaultInchFractional
- ON_DimStyle::DefaultFootInchArchitecture
- ON_DimStyle::DefaultMillimeterSmall
- ON_DimStyle::DefaultMillimeterLarge
- ON_DimStyle::DefaultMillimeterArchitecture
ModelSerialNumber
A value identifying the model that manages this component.
Remarks: If the component is being managed by a model, this value identifies the model. In Rhino, this value is the document runtime serial number. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.
Exceptions:
| InvalidOperationException | When setting the Name failed. This usually happens because the instance Name is already locked. |
NameIsLocked
Returns a value indicating whether the component Name is already locked.
Hatchpattern patterns are typically defined as distances on the printed output when printing. In this case PatternUnitSystem is UnitSystem.None (default). When set to any other unit system, the hatch pattern will be scaled acordingly.
ReferenceModelSerialNumber
When a component is in a model for reference, this value identifies the reference model.
Remarks: Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is not saved in .3dm archives.
UserData
List of custom information that is attached to this class.
UserDictionary
Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
Methods
Add a HatchLine to the pattern.
Parameters:
| hatchLine (HatchLine) | The hatch line to add. |
Returns: The index of newly added hatch line, or -1 on failure.
ClearId
public void ClearId()
Resets the HasId property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the ID is locked. |
ClearIndex
public void ClearIndex()
Resets the HasIndex property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the index is locked. |
ClearName
public void ClearName()
Resets the HasName property of the model component to false, if possible.
Exceptions:
| InvalidOperationException | If the name is locked. |
ConstructConstObject
Assigns a parent object and a sub-object index to this.
Creates preview line segments of the hatch pattern.
DataCRC
Increments the Cyclic Redundancy Check value by this instance.
Parameters:
| currentRemainder (uint) | The current remainder value. |
Returns: The updated remainder value.
public void DeleteAllUserStrings()
Dispose
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
Dispose
For derived class implementers.
This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.
You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.
Also, you must call the base virtual method within your overriding method.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
EnsurePrivateCopy
public void EnsurePrivateCopy()
If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
Gets Rhino default hatch patterns. These patterns are not in the document hatch pattern table.
Returns: An array of hatch patterns.
GetObjectData
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Parameters:
| info (SerializationInfo) | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| context (StreamingContext) | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Gets user string from this geometry.
Parameters:
| key (string) | id used to retrieve the string. |
Returns: string associated with the key if successful. null if no key was found.
Gets a copy of all (user key string, user value string) pairs attached to this geometry.
Returns: A new collection.
Gets a HatchLine at an index.
Parameters:
| hatchLineIndex (int) | The index of the hatch line. |
Returns: The hatch line, or null on failure.
IsValidWithLog
Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
Parameters:
| log (out string) | A textual log. This out parameter is assigned during this call. |
Returns: true if this object is valid; false otherwise.
LockId
public void LockId()
Locks the component Id property.
LockIndex
public void LockIndex()
Locks the component Index property.
LockName
public void LockName()
Locks the component Name property.
NonConstOperation
protected virtual void NonConstOperation()
For derived classes implementers.
Defines the necessary implementation to free the instance from being constant.
OnSwitchToNonConst
#protected override void OnSwitchToNonConst()
Overrides: CommonObject.OnSwitchToNonConst
Reads hatch pattern definitions from a file.
public void RemoveAllHatchLines()
Remove all of the hatch line from the pattern.
Remove a hatch line from the pattern.
Parameters:
| hatchLineIndex (int) | The index of the hatch line to remove. |
Returns: True if successful, false if index is out of range.
Set all of the hatch lines at once. Existing hatch lines are deleted.
Parameters:
| hatchLines (IEnumerable<HatchLine>) | An enumeration of hatch lines. |
Returns: The number of hatch lines added.
Attach a user string (key,value combination) to this geometry.
ToJSON
Create a JSON string representation of this object
Parameters:
| options (SerializationOptions) |
ToString
Returns the name of the model component type, and then its name and index.
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Overrides: Object.ToString
Writes a hatch pattern defintion to a file.
Remarks: Output file is in AutoCAD .PAT format.
Parameters:
| filename (string) | Name of file to create. If file exists, it will be overwritten. |
| hatchPattern (HatchPattern) | The hatch pattern to write. |
Returns: True if successful, false otherwise.
Writes one or more hatch pattern defintions to a file.
Remarks: Output file is in AutoCAD .PAT format.
Parameters:
| filename (string) | Name of file to create. If file exists, it will be overwritten. |
| hatchPatterns (IEnumerable<HatchPattern>) | The enumeration of hatch patterns to write. |
Returns: True if successful, false otherwise.