Constructors

HatchPattern

#Since v5.0
public HatchPattern()

HatchPattern

#Since v8.15
public HatchPattern(
HatchPattern
other
)

Properties

AlwaysModelDistances

#Since v9.0
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.
public bool AlwaysModelDistances { get; set; }

ComponentStatus

Gets or sets the component status of the model component.
public virtual ComponentStatus ComponentStatus { get; set; }
inherited fromModelComponent

ComponentType

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

DeletedName

Gets the name of a component that is deleted.
public string DeletedName { get; }
inherited fromModelComponent

Description

#Since v5.0
Gets and sets a short description of the pattern.
public string Description { get; set; }

Disposed

Indicates if this object has been disposed or the document it originally belonged to has been disposed.
public bool Disposed { get; }
inherited fromCommonObject

FillType

#Since v5.0
Gets the pattern's fill type.
public HatchPatternFillType FillType { get; set; }

HasId

Returns a value indicating whether the component has an ID.
public bool HasId { get; }
inherited fromModelComponent

HasIndex

Returns a value indicating whether the component has an Index.
public bool HasIndex { get; }
inherited fromModelComponent

HasName

Returns a value indicating whether the component has a Name.
public bool HasName { get; }
inherited fromModelComponent

HasUserData

Gets true if this class has any custom information attached to it through UserData.
public bool HasUserData { get; }
inherited fromCommonObject

HatchLineCount

#Since v8.0
Get the number of HatchLines in the pattern.
public int HatchLineCount { get; }

HatchLines

#Since v8.0
Gets all the hatch lines.
public IEnumerable<HatchLine> HatchLines { get; }

Id

Gets or sets the ID of the current instance.
public virtual Guid Id { get; set; }
inherited fromModelComponent
InvalidOperationExceptionWhen 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.
public bool IdIsLocked { get; }
inherited fromModelComponent

Index

#Since v5.0
Index in the hatch pattern table for this pattern. -1 if not in the table.
public override int Index { get; set; }

IndexIsLocked

Returns a value indicating whether the component Index is already locked.
public bool IndexIsLocked { get; }
inherited fromModelComponent

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.
[CLSCompliant(false)] public virtual uint InstanceDefinitionModelSerialNumber { get; }
inherited fromModelComponent
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.

InUse

#Since v8.15
Returns true if the hatch pattern is in use by a Rhino object, a layer, an instance definition, or a section style.
public bool InUse { get; }

IsComponentStatusLocked

The component status itself can be locked. This returns an indication.
public bool IsComponentStatusLocked { get; }
inherited fromModelComponent

IsDeleted

#Since v5.0
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.
public override bool IsDeleted { get; }

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.
public virtual bool IsDocumentControlled { get; }
inherited fromCommonObject

IsReference

#Since v5.0
Rhino allows multiple files to be viewed simultaneously. Hatch patterns in the document are "normal" or "reference". Reference hatch patterns are not saved.
public override bool IsReference { get; }

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
public bool IsSystemComponent { get; }
inherited fromModelComponent

IsValid

Tests an object to see if it is valid.
public virtual bool IsValid { get; }
inherited fromCommonObject

ModelSerialNumber

A value identifying the model that manages this component.
[CLSCompliant(false)] public virtual uint ModelSerialNumber { get; }
inherited fromModelComponent
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.

Name

Gets or sets the name
public virtual string Name { get; set; }
inherited fromModelComponent
InvalidOperationExceptionWhen 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.
public bool NameIsLocked { get; }
inherited fromModelComponent

PatternUnitSystem

#Since v9.0
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.
public UnitSystem PatternUnitSystem { get; set; }

ReferenceModelSerialNumber

When a component is in a model for reference, this value identifies the reference model.
[CLSCompliant(false)] public virtual uint ReferenceModelSerialNumber { get; }
inherited fromModelComponent
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.
public UserDataList UserData { get; }
inherited fromCommonObject

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.
public ArchivableDictionary UserDictionary { get; }
inherited fromCommonObject

UserStringCount

#Since v8.9
Gets the amount of user strings.
public int UserStringCount { get; }

Methods

AddHatchLine

#Since v8.0
Add a HatchLine to the pattern.
public int AddHatchLine(
hatchLine
The hatch line to add.
)
The index of newly added hatch line, or -1 on failure.

ClearId

Resets the HasId property of the model component to false, if possible.
public void ClearId()
inherited fromModelComponent
InvalidOperationExceptionIf the ID is locked.

ClearIndex

Resets the HasIndex property of the model component to false, if possible.
public void ClearIndex()
inherited fromModelComponent
InvalidOperationExceptionIf the index is locked.

ClearName

Resets the HasName property of the model component to false, if possible.
public void ClearName()
inherited fromModelComponent
InvalidOperationExceptionIf the name is locked.

ConstructConstObject

Assigns a parent object and a sub-object index to this.
protected void ConstructConstObject(
parentObject,
The parent object.
subobjectIndex
The sub-object index.
)
inherited fromCommonObject

CreatePreviewGeometry

#Since v6.8
Creates preview line segments of the hatch pattern.
public Line[] CreatePreviewGeometry(
width,
The width of the preview.
height,
The height of the preview.
angle
The rotation angle of the pattern display in radians.
)
The preview line segments if successful, an empty array on failure.

DataCRC

Increments the Cyclic Redundancy Check value by this instance.
[CLSCompliant(false)] public uint DataCRC(
currentRemainder
The current remainder value.
)
inherited fromModelComponent
The updated remainder value.

DeleteAllUserStrings

#Since v8.9
public void DeleteAllUserStrings()

DeleteUserString

#Since v8.9
public bool DeleteUserString(
key
)

Dispose

Actively reclaims unmanaged resources that this instance uses.
public void Dispose()
inherited fromCommonObject

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.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)
inherited fromCommonObject

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.
public void EnsurePrivateCopy()
inherited fromCommonObject

GetDefaultHatchPatterns

#Since v9.0
Gets Rhino default hatch patterns. These patterns are not in the document hatch pattern table.
public static HatchPattern[] GetDefaultHatchPatterns()
An array of hatch patterns.

GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)
inherited fromCommonObject

GetUserString

#Since v8.9
Gets user string from this geometry.
public string GetUserString(
key
id used to retrieve the string.
)
string associated with the key if successful. null if no key was found.

GetUserStrings

#Since v8.9
Gets a copy of all (user key string, user value string) pairs attached to this geometry.
public NameValueCollection GetUserStrings()
A new collection.

HatchLineAt

#Since v8.0
Gets a HatchLine at an index.
public HatchLine HatchLineAt(
hatchLineIndex
The index of the hatch line.
)
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.
public bool IsValidWithLog(
out string
log
A textual log. This out parameter is assigned during this call.
)
inherited fromCommonObject
true if this object is valid; false otherwise.

LockId

Locks the component Id property.
public void LockId()
inherited fromModelComponent

LockIndex

Locks the component Index property.
public void LockIndex()
inherited fromModelComponent

LockName

Locks the component Name property.
public void LockName()
inherited fromModelComponent

NonConstOperation

For derived classes implementers.

Defines the necessary implementation to free the instance from being constant.

protected virtual void NonConstOperation()
inherited fromCommonObject

OnSwitchToNonConst

#
protected override void OnSwitchToNonConst()

ReadFromFile

#Since v5.0
Reads hatch pattern definitions from a file.
public static HatchPattern[] ReadFromFile(
filename,
Name of an existing file. If filename is null or empty, default hatch pattern filename is used.
quiet
Ignored.
)
An array of hatch patterns. This can be null, but not empty.

RemoveAllHatchLines

#Since v8.0
Remove all of the hatch line from the pattern.
public void RemoveAllHatchLines()

RemoveHatchLine

#Since v8.0
Remove a hatch line from the pattern.
public bool RemoveHatchLine(
hatchLineIndex
The index of the hatch line to remove.
)
True if successful, false if index is out of range.

SetHatchLines

#Since v8.0
Set all of the hatch lines at once. Existing hatch lines are deleted.
public int SetHatchLines(
hatchLines
An enumeration of hatch lines.
)
The number of hatch lines added.

SetUserString

#Since v8.9
Attach a user string (key,value combination) to this geometry.
public bool SetUserString(
key,
id used to retrieve this string.
value
string associated with key.
)
true on success.

ToJSON

Create a JSON string representation of this object
public string ToJSON()
inherited fromCommonObject

ToString

Returns the name of the model component type, and then its name and index.
public override string ToString()
inherited fromModelComponent
Remarks: This is provided as a visual aid. Do not rely on this for serialization.
Object.ToString

WriteToFile

#Since v8.15
Writes a hatch pattern defintion to a file.
public static bool WriteToFile(
filename,
Name of file to create. If file exists, it will be overwritten.
hatchPattern
The hatch pattern to write.
)
Remarks: Output file is in AutoCAD .PAT format.
True if successful, false otherwise.

WriteToFile

#Since v8.15
Writes one or more hatch pattern defintions to a file.
public static bool WriteToFile(
filename,
Name of file to create. If file exists, it will be overwritten.
hatchPatterns
The enumeration of hatch patterns to write.
)
Remarks: Output file is in AutoCAD .PAT format.
True if successful, false otherwise.