Show / Hide Table of Contents

Class Dimension

Represents the base class for a dimension EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
Dimension
AlignedDimension
Angular2LineDimension
Angular3PointDimension
DiametricDimension
LinearDimension
OrdinateDimension
RadialDimension
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Normal
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix3, Vector3)
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
EntityObject.Clone()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public abstract class Dimension : EntityObject, IHasXData, ICloneable

Constructors

| Improve this Doc View Source

Dimension(DimensionType)

Initializes a new instance of the Dimension class.

Declaration
protected Dimension(DimensionType type)
Parameters
Type Name Description
DimensionType type

Fields

| Improve this Doc View Source

defPoint

Declaration
protected Vector2 defPoint
Field Value
Type Description
Vector2
| Improve this Doc View Source

textRefPoint

Declaration
protected Vector2 textRefPoint
Field Value
Type Description
Vector2

Properties

| Improve this Doc View Source

AttachmentPoint

Gets or sets the dimension text attachment point.

Declaration
public MTextAttachmentPoint AttachmentPoint { get; set; }
Property Value
Type Description
MTextAttachmentPoint
| Improve this Doc View Source

Block

Gets the block that contains the entities that make up the dimension picture.

Declaration
public Block Block { get; set; }
Property Value
Type Description
Block
Remarks

Set this value to null to force the program that reads the resulting DXF file to generate the dimension drawing block, some programs do not even care about this block and will always generate their own dimension drawings.
You can even use your own dimension drawing setting this value with the resulting block. The assigned block name is irrelevant, it will be automatically modified to accommodate the naming conventions of the blocks for dimension (*D#).
The block will be overwritten when adding the dimension to a DxfDocument if BuildDimensionBlocks is set to true.

| Improve this Doc View Source

DimensionType

Gets the dimension type.

Declaration
public DimensionType DimensionType { get; }
Property Value
Type Description
DimensionType
| Improve this Doc View Source

Elevation

Gets or sets the dimension elevation, its position along its normal.

Declaration
public double Elevation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

LineSpacingFactor

Gets or sets the dimension text line spacing factor.

Declaration
public double LineSpacingFactor { get; set; }
Property Value
Type Description
System.Double
Remarks

Percentage of default line spacing to be applied. Valid values range from 0.25 to 4.00, the default value 1.0.

| Improve this Doc View Source

LineSpacingStyle

Get or sets the dimension text MTextLineSpacingStyle.

Declaration
public MTextLineSpacingStyle LineSpacingStyle { get; set; }
Property Value
Type Description
MTextLineSpacingStyle
| Improve this Doc View Source

Measurement

Gets the actual measurement.

Declaration
public abstract double Measurement { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Style

Gets or sets the style associated with the dimension.

Declaration
public DimensionStyle Style { get; set; }
Property Value
Type Description
DimensionStyle
| Improve this Doc View Source

StyleOverrides

Gets the dimension style overrides list.

Declaration
public DimensionStyleOverrideDictionary StyleOverrides { get; }
Property Value
Type Description
DimensionStyleOverrideDictionary
Remarks

Any dimension style value stored in this list will override its corresponding value in the assigned style to the dimension.

| Improve this Doc View Source

TextPositionManuallySet

Gets or sets if the text reference point has been set by the user. Set to false to reset the dimension text to its original position.

Declaration
public bool TextPositionManuallySet { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

TextReferencePoint

Gets or sets the text reference Vector2, the middle point of dimension text in local coordinates.

Declaration
public Vector2 TextReferencePoint { get; set; }
Property Value
Type Description
Vector2
Remarks

This value is related to the style property FitTextMove. If the style FitTextMove is set to BesidesDimLine the text reference point will take precedence over the offset value to place the dimension line. In case of Ordinate dimensions if the text has been manually set the text position will take precedence over the EndLeaderPoint only if FitTextMove has been set to OverDimLineWithoutLeader.

| Improve this Doc View Source

TextRotation

Gets or sets the rotation angle in degrees of the dimension text away from its default orientation(the direction of the dimension line).

Declaration
public double TextRotation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

UserText

Gets or sets the dimension text explicitly.

Declaration
public string UserText { get; set; }
Property Value
Type Description
System.String
Remarks

Dimension text explicitly entered by the user. Optional; default is the measurement. If null or "<>", the dimension measurement is drawn as the text, if " " (one blank space), the text is suppressed. Anything else is drawn as the text.

Methods

| Improve this Doc View Source

BuildBlock(String)

Gets the block that contains the entities that make up the dimension picture.

Declaration
protected abstract Block BuildBlock(string name)
Parameters
Type Name Description
System.String name

Name to be assigned to the generated block.

Returns
Type Description
Block

The block that represents the actual dimension.

| Improve this Doc View Source

CalculateReferencePoints()

Calculate the dimension reference points.

Declaration
protected abstract void CalculateReferencePoints()
| Improve this Doc View Source

OnDimensionBlockChangedEvent(Block, Block)

Declaration
protected virtual Block OnDimensionBlockChangedEvent(Block oldBlock, Block newBlock)
Parameters
Type Name Description
Block oldBlock
Block newBlock
Returns
Type Description
Block
| Improve this Doc View Source

OnDimensionStyleChangedEvent(DimensionStyle, DimensionStyle)

Declaration
protected virtual DimensionStyle OnDimensionStyleChangedEvent(DimensionStyle oldStyle, DimensionStyle newStyle)
Parameters
Type Name Description
DimensionStyle oldStyle
DimensionStyle newStyle
Returns
Type Description
DimensionStyle
| Improve this Doc View Source

OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride)

Declaration
protected virtual void OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride item)
Parameters
Type Name Description
DimensionStyleOverride item
| Improve this Doc View Source

OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride)

Declaration
protected virtual void OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride item)
Parameters
Type Name Description
DimensionStyleOverride item
| Improve this Doc View Source

Update()

Updates the internal data of the dimension and if needed it rebuilds the block definition of the actual dimension.

Declaration
public void Update()
Remarks

This method needs to be manually called to reflect any change made to the dimension properties (geometry and/or style).

Events

| Improve this Doc View Source

DimensionBlockChanged

Declaration
public event Dimension.DimensionBlockChangedEventHandler DimensionBlockChanged
Event Type
Type Description
Dimension.DimensionBlockChangedEventHandler
| Improve this Doc View Source

DimensionStyleChanged

Declaration
public event Dimension.DimensionStyleChangedEventHandler DimensionStyleChanged
Event Type
Type Description
Dimension.DimensionStyleChangedEventHandler
| Improve this Doc View Source

DimensionStyleOverrideAdded

Declaration
public event Dimension.DimensionStyleOverrideAddedEventHandler DimensionStyleOverrideAdded
Event Type
Type Description
Dimension.DimensionStyleOverrideAddedEventHandler
| Improve this Doc View Source

DimensionStyleOverrideRemoved

Declaration
public event Dimension.DimensionStyleOverrideRemovedEventHandler DimensionStyleOverrideRemoved
Event Type
Type Description
Dimension.DimensionStyleOverrideRemovedEventHandler

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX