Represents a hatch in planar boundary loop or loops. This is a 2d entity with a plane defining a local coordinate system. The loops, patterns, angles, etc are all in this local coordinate system. The Hatch object manages the plane and loop array Fill definitions are in the HatchPattern or class derived from HatchPattern Hatch has an index to get the pattern definition from the pattern table.

Constructors

Hatch

#
Protected constructor for internal use.
protected Hatch(
info,
Serialization data.
context
Serialization stream.
)

Properties

BasePoint

#Since v6.11
Gets or sets the hatch pattern base point
public Point3d BasePoint { 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

HasBrepForm

Returns true if the Brep.TryConvertBrep function will be successful for this object
public bool HasBrepForm { get; }
inherited fromGeometryBase

HasUserData

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

IsDeformable

true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
public bool IsDeformable { get; }
inherited fromGeometryBase

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 sealed override bool IsDocumentControlled { get; }
inherited fromGeometryBase

IsShallowDuplicate

Is this instance a 'shallow copy'. Shallow copies are no different than regular instances with the exception that they will convert to complete independent 'deep' copies if a non const operation is perform on the instance (something that mutates the internal data)
public bool IsShallowDuplicate { get; }
inherited fromGeometryBase

IsValid

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

ObjectType

Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
[CLSCompliant(false)] public ObjectType ObjectType { get; }
inherited fromGeometryBase

PatternIndex

#ExampleSince v5.0
Gets or sets the index of the pattern in the document hatch pattern table.
public int PatternIndex { get; set; }

PatternRotation

#Since v5.0
Gets or sets the relative rotation of the pattern.
public double PatternRotation { get; set; }

PatternScale

#Since v5.0
Gets or sets the scaling factor of the pattern.
public double PatternScale { get; set; }

Plane

#Since v6.11
Gets or sets the hatch plane
public Plane Plane { get; set; }

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

Gets the amount of user strings.
public int UserStringCount { get; }
inherited fromGeometryBase

Methods

ComponentIndex

If this piece of geometry is a component in something larger, like a BrepEdge in a Brep, then this function returns the component index.
[ConstOperation] public ComponentIndex ComponentIndex()
inherited fromGeometryBase
This object's component index. If this object is not a sub-piece of a larger geometric entity, then the returned index has m_type = ComponentIndex.InvalidType and m_index = -1.

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

Create

#Since v7.18
Create a hatch with a given set of outer and inner loops
public static Hatch Create(
hatchPlane,
outerLoop,
2d closed curve representing outer boundary of hatch
innerLoops,
2d closed curves for inner boundaries
hatchPatternIndex,
rotationRadians,
scale
)

Create

#ExampleSince v6.0
Constructs an array of hatches from one curve.
public static Hatch[] Create(
curve,
hatchPatternIndex,
The index of the hatch pattern in the document hatch pattern table.
rotationRadians,
The relative rotation of the pattern.
scale,
A scaling factor.
tolerance
)
An array of hatches. The array might be empty on error.

Create

#ExampleSince v5.0 Obsolete v6.0
Constructs an array of hatches from one curve.
public static Hatch[] Create(
curve,
hatchPatternIndex,
The index of the hatch pattern in the document hatch pattern table.
rotationRadians,
The relative rotation of the pattern.
scale
A scaling factor.
)
obsoleteUse version that takes a tolerance parameter instead
An array of hatches. The array might be empty on error.

Create

#Since v6.0
Constructs an array of hatches from a set of curves.
public static Hatch[] Create(
curves,
An array, a list or any enumerable set of Curve.
hatchPatternIndex,
The index of the hatch pattern in the document hatch pattern table.
rotationRadians,
The relative rotation of the pattern.
scale,
A scaling factor.
tolerance
)
An array of hatches. The array might be empty on error.
ArgumentNullExceptionIf curves is null.

Create

#Since v5.0 Obsolete v6.0
Constructs an array of hatches from a set of curves.
public static Hatch[] Create(
curves,
An array, a list or any enumerable set of Curve.
hatchPatternIndex,
The index of the hatch pattern in the document hatch pattern table.
rotationRadians,
The relative rotation of the pattern.
scale
A scaling factor.
)
obsoleteUse version that takes a tolerance parameter instead
An array of hatches. The array might be empty on error.
ArgumentNullExceptionIf curves is null.

CreateDisplayGeometry

#Since v5.6
Generate geometry that would be used to draw the hatch with a given hatch pattern
[ConstOperation] public void CreateDisplayGeometry(
pattern,
patternScale,
out Curve[]
bounds,
out Line[]
lines,
out Brep
solidBrep
)

CreateFromBrep

#Since v7.18
Create a hatch from a planar face of a Brep
public static Hatch CreateFromBrep(
brep,
brepFaceIndex,
hatchPatternIndex,
rotationRadians,
scale,
basePoint
)

DataCRC

Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical.
[CLSCompliant(false)] public uint DataCRC(
currentRemainder
The current remainder value.
)
inherited fromGeometryBase
CRC of the information the defines the object.

DeleteAllUserStrings

public void DeleteAllUserStrings()
inherited fromGeometryBase

DeleteUserString

public bool DeleteUserString(
key
)
inherited fromGeometryBase

Dispose

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

Dispose

Overridden in order to destroy local display cache information
protected override void Dispose(
disposing
)
inherited fromGeometryBase

Duplicate

Constructs a deep (full) copy of this object.
public virtual GeometryBase Duplicate()
inherited fromGeometryBase
An object of the same type as this, with the same properties and behavior.

DuplicateShallow

Constructs a light copy of this object. By "light", it is meant that the same underlying data is used until something is done to attempt to change it. For example, you could have a shallow copy of a very heavy mesh object and the same underlying data will be used when doing things like inspecting the number of faces on the mesh. If you modify the location of one of the mesh vertices, the shallow copy will create a full duplicate of the underlying mesh data and the shallow copy will become a deep copy.
public GeometryBase DuplicateShallow()
inherited fromGeometryBase
An object of the same type as this object.

This behavior is overridden by implementing classes.

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

Explode

#ExampleSince v5.0
Decomposes the hatch pattern into an array of geometry.
[ConstOperation] public GeometryBase[] Explode()
An array of geometry that formed the appearance of the original elements.

Get2dCurves

#Since v8.18
Gets 2d curves that define the boundaries of the hatch
[ConstOperation] public Curve[] Get2dCurves(
outer
true to get the outer curves, false to get the inner curves
)

Get3dCurves

#Since v5.0
Gets 3d curves that define the boundaries of the hatch
[ConstOperation] public Curve[] Get3dCurves(
outer
true to get the outer curves, false to get the inner curves
)

GetBoundingBox

Bounding box solver. Gets the world axis aligned bounding box for the geometry.
[ConstOperation] public BoundingBox GetBoundingBox(
accurate
If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.
)
inherited fromGeometryBase
The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetBoundingBox

Aligned Bounding box solver. Gets the plane aligned bounding box.
[ConstOperation] public BoundingBox GetBoundingBox(
plane,
Orientation plane for BoundingBox.
out Box
worldBox
Aligned box in World coordinates.
)
inherited fromGeometryBase
A BoundingBox in plane coordinates.

GetBoundingBox

Aligned Bounding box solver. Gets the plane aligned bounding box.
[ConstOperation] public BoundingBox GetBoundingBox(
plane
Orientation plane for BoundingBox.
)
inherited fromGeometryBase
A BoundingBox in plane coordinates.

GetBoundingBox

Aligned Bounding box solver. Gets the world axis aligned bounding box for the transformed geometry.
[ConstOperation] public virtual BoundingBox GetBoundingBox(
xform
Transformation to apply to object prior to the BoundingBox computation. The geometry itself is not modified.
)
inherited fromGeometryBase
The accurate bounding box of the transformed geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetGradientFill

#Since v7.0
Get gradient fill information for this hatch. If the "GradientType" for the fill is None, then this hatch doesn't have any gradient fill.
public ColorGradient GetGradientFill()

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

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

GetUserStrings

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

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.

MakeDeformable

If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
public bool MakeDeformable()
inherited fromGeometryBase
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.

MemoryEstimate

Computes an estimate of the number of bytes that this object is using in memory.
[CLSCompliant(false)] [ConstOperation] public uint MemoryEstimate()
inherited fromGeometryBase
An estimated memory footprint.

NonConstOperation

Destroy cache handle
protected override void NonConstOperation()
inherited fromGeometryBase

OnSwitchToNonConst

Is called when a non-constant operation occurs.
protected override void OnSwitchToNonConst()
inherited fromGeometryBase

Rotate

Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
public bool Rotate(
angleRadians,
Angle of rotation in radians.
rotationAxis,
Direction of the axis of rotation.
rotationCenter
Point on the axis of rotation.
)
inherited fromGeometryBase
true if geometry successfully rotated.

Scale

Scales the object by the specified factor. The scale is centered at the origin.
public bool Scale(
scaleFactor
The uniform scaling factor.
)
inherited fromGeometryBase
true if geometry successfully scaled.

ScalePattern

#Since v6.11
Scale the hatch's pattern
public void ScalePattern(
xform
)

SetGradientFill

#Since v7.0
public void SetGradientFill()

SetUserString

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.
)
inherited fromGeometryBase
true on success.

ToBrep

#Since v8.9
Constructs a Brep representation of this hatch.
public Brep ToBrep()
A Brep representation of this hatch if successful, null otherwise.

ToJSON

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

Transform

Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.
public bool Transform(
Transform
xform
Transformation to apply to geometry.
)
inherited fromGeometryBase
true if geometry successfully transformed.

Translate

Translates the object along the specified vector.
public bool Translate(
x,
The X component.
y,
The Y component.
z
The Z component.
)
inherited fromGeometryBase
true if geometry successfully translated.

Translate

Translates the object along the specified vector.
public bool Translate(
translationVector
A moving vector.
)
inherited fromGeometryBase
true if geometry successfully translated.