Represents a dimension of an entity that can be measured with an angle.
Constructors
Constructs an angular dimension from a given arc.
public AngularDimension(Line line1, Point3d pointOnLine1, Line line2, Point3d pointOnLine2, Point3d pointOnAngularDimensionArc, bool bSetExtensionPoints)
Constructs an angular dimension between the lines. If the lines intersect in a single point, that point is used as the center of the angular dimension arc.In this case, there are eight possible angles to dimension.The pointOnAngularDimensionArc and pointOnLine parameters are used to select the correct angle to dimension. If a pointOnLine parameter is not set, the corresponding line's midpoint is used. If the lines are colinear, the point on the line closest to pointOnAngularDimensionArc is the center of the angular dimension arc.
Parameters:
| line1 (Line) | The first line. |
| pointOnLine1 (Point3d) | If specified, indicates which semi-infinite portion of line1 to dimension. Otherwise the midpoint of line1 as a segment is used. When in doubt, use Point3d.Unset. |
| line2 (Line) | The second line. |
| pointOnLine2 (Point3d) | |
| pointOnAngularDimensionArc (Point3d) | A point on the interior of the angular dimension arc. |
| bSetExtensionPoints (bool) | If bSetExtensionPoints is true, and a pointOnLine parameter is valid, that point is used as the extension point. Otherwise the angular dimension arc endpoint is used. |
public AngularDimension(Plane plane, Vector3d horizontal, Point3d centerpoint, Point3d defpoint1, Point3d defpoint2, Point3d dimlinepoint)
Constructs an angular dimension with extension lines starting at plane origin (arc center).
public AngularDimension(Plane plane, Vector3d horizontal, Point3d extpoint1, Point3d extpoint2, Point3d dirpoint1, Point3d dirpoint2, Point3d dimlinepoint)
Constructs an angular dimension from parameters.
Parameters:
| plane (Plane) | The dimension's plane. |
| horizontal (Vector3d) | The horizontal direction. |
| extpoint1 (Point3d) | Start of first extension line. |
| extpoint2 (Point3d) | start of second extension line. |
| dirpoint1 (Point3d) | point on first extension vector. |
| dirpoint2 (Point3d) | Spoint on second extension vector. |
| dimlinepoint (Point3d) | point on dimension line. |
AngularDimension
#Protected constructor used in serialization.
Parameters:
| info (SerializationInfo) | |
| context (StreamingContext) |
Properties
AlternateBelowLine
AlternateDimensionLengthDisplay
Alternate length display units and format
AltLengthFactor
AltLengthResolution
AltLengthRoundoff
AltPrefix
AltSuffix
AltToleranceResolution
AltUnitsDisplay
AltZeroSuppression
ArrowBlockId1
ArrowBlockId2
ArrowFit
ArrowheadType1
ArrowheadType2
ArrowSize
BaselineSpacing
CentermarkSize
CentermarkStyle
DetailMeasured
DimensionLengthDisplay
Length display units and format
DimensionLineExtension
DimensionStyle
If there are no overrides then the parent style is returned otherwise the dimension style saved with the annotation is returned.
DimensionStyleId
Id of this annotation's parent dimstyle If this annotation has overrides to dimstyle properties, those overrides will be represented in the DimensionStyle returned by DimensionStyle(ParentStyle)
Disposed
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
DistanceScale
DrawForward
Gets or sets whether the text is oriented towards the reader when viewed from behind
DrawTextFrame
obsoleteDo not use setter as the MaskFrame is an enum. Use MaskFrame property instead
Gets or sets whether to draw a frame around a text mask
ExtensionLineExtension
ExtensionLineOffset
FirstCharFont
Returns the font used by the first run of text in an annotation
FixedExtensionLength
FixedLengthExtensionOn
Font
The base Font for the text of the annotation. The text string is rich text and therefore a different font that the base font can be associated with sub strings of the text
FontIndex
obsoleteUse Font property instead. Ex: textEntity.Font = Rhino.DocObjects.Font.FromQuartetProperties("Arial", false, false);
Obsolete; use Font property instead
ForceArrowPosition
ForceDimensionLineBetweenExtensionLines
ForceDimLine
HasBrepForm
Returns true if the Brep.TryConvertBrep function will be successful for this object
HasPropertyOverrides
HasUserData
Gets true if this class has any custom information attached to it through UserData.
IsDeformable
true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
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.
Overrides: CommonObject.IsDocumentControlled
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)
LengthFactor
LengthResolution
LengthRoundoff
MaskColor
Color to use for drawing a text mask when it is enabled. If the mask is enabled and MaskColor is System.Drawing.Color.Transparent, then the viewport's color will be used for the MaskColor
MaskColorSource
Gets or sets whether the mask background color is from the background or from a color
MaskFrame
Gets or sets whether to draw a frame around a text mask
MaskOffset
Offset for the border around text of the rectangle used to draw the mask. This value multiplied by TextHeight is the offset on each side of the tight rectangle around the text characters to the mask rectangle. The default value is 0.1.
MaskUsesViewportColor
If true, the viewport's color is used for the mask color. If false, the color defined by MaskColor is used
NumericValue
Gets the numeric value (or measurement), depending on geometry type.
LinearDimension: distance between arrow tips
RadialDimension: radius or diameter depending on type
AngularDimension: angle in radians
ObjectType
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
ParentDimensionStyle
The parent dimension style associated with this annotation
PlainTextWithFields
Text stripped of RTF formatting information and with field expressions intact
PlainUserText
Prefix
Suffix
SuppressDimensionLine1
Suppresses the dimension line and arrowhead between the first extension line and the dimension text.
SuppressDimensionLine2
Suppresses the dimension line and arrowhead between the second extension line and the dimension text.
SuppressExtension1
SuppressExtension2
Text
obsoleteUse RichText or PlainText
Text including additional RTF formatting information
TextAngleType
TextFit
TextFormula
TextHasRtfFormatting
Gets a value indicating whether the annotation's text is formatted as RTF (Rich Text Format). Returns true if the text begins with an RTF header; otherwise, false.
TextHeight
AnnotationBase.TextHeight Gets the parent dimstyle for the annotation and gets or sets the text height in the dimstyle
TextLocation
TextOrientation
TextPosition
Gets and sets the position of text on the plane.
TextRotation
ToleranceFormat
ToleranceHeightScale
ToleranceLowerValue
ToleranceResolution
ToleranceUpperValue
UseDefaultTextPoint
UseKerning
Use kerning data in font to set distances between glyphs
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.
ZeroSuppression
Methods
public bool AdjustFromPoints(Plane plane, Point3d centerpoint, Point3d defpoint1, Point3d defpoint2, Point3d dimlinepoint)
Updates dimension geometry from point locations.
public bool AdjustFromPoints(Plane plane, Point3d extpoint1, Point3d extpoint2, Point3d dirpoint1, Point3d dirpoint2, Point3d dimlinepoint)
Update angular dimension from point locations.
Parameters:
| plane (Plane) | Dimension's plane |
| extpoint1 (Point3d) | Start of first extension line. |
| extpoint2 (Point3d) | start of second extension line. |
| dirpoint1 (Point3d) | point on first extension vector. |
| dirpoint2 (Point3d) | Spoint on second extension vector. |
| dimlinepoint (Point3d) | point on dimension line. |
Returns: True if successful, false otherwise.
ClearPropertyOverrides
Clears all overridden properties for this annotation
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.
Returns: 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.
public static AngularDimension Create(DimensionStyle dimStyle, Line line1, Point3d pointOnLine1, Line line2, Point3d pointOnLine2, Point3d pointOnAngularDimensionArc, bool bSetExtensionPoints)
The angle between the lines is dimensioned. If the lines intersect in a single point, that point is used as the center of the angular dimension arc.In this case, there are eight possible angles to dimension.The pointOnAngularDimensionArc and pointOnLine parameters are used to select the correct angle to dimension. If a pointOnLine parameter is not set, the corresponding line's midpoint is used. If the lines are colinear, the point on the line closest to pointOnAngularDimensionArc is the center of the angular dimension arc.
Parameters:
| dimStyle (DimensionStyle) | Dimension style. |
| line1 (Line) | The first line. |
| pointOnLine1 (Point3d) | If specified, indicates which semi-infinite portion of line1 to dimension. Otherwise the midpoint of line1 as a segment is used. When in doubt, use Point3d.Unset. |
| line2 (Line) | The second line. |
| pointOnLine2 (Point3d) | |
| pointOnAngularDimensionArc (Point3d) | A point on the interior of the angular dimension arc. |
| bSetExtensionPoints (bool) | If bSetExtensionPoints is true, and a pointOnLine parameter is valid, that point is used as the extension point. Otherwise the angular dimension arc endpoint is used. |
Returns: The angular dimension if successful, null otherwise.
public static AngularDimension Create(DimensionStyle dimStyle, Plane plane, Vector3d horizontal, Point3d centerpoint, Point3d defpoint1, Point3d defpoint2, Point3d dimlinepoint)
Creates an angular dimension with extension lines starting at plane origin (arc center).
Parameters:
| dimStyle (DimensionStyle) | Dimension's dimension style |
| plane (Plane) | Dimension's plane. |
| horizontal (Vector3d) | Horizontal reference direction. |
| centerpoint (Point3d) | Dimension center point. |
| defpoint1 (Point3d) | Point on first extension line. |
| defpoint2 (Point3d) | Point on second extension line. |
| dimlinepoint (Point3d) | Point on dimension arc. |
Returns: The angular dimension if successful, null otherwise.
public static AngularDimension Create(DimensionStyle dimStyle, Plane plane, Vector3d horizontal, Point3d extpoint1, Point3d extpoint2, Point3d dirpoint1, Point3d dirpoint2, Point3d dimlinepoint)
Creates an angular dimension from parameters.
Parameters:
| dimStyle (DimensionStyle) | The dimension style. |
| plane (Plane) | The dimension's plane. |
| horizontal (Vector3d) | The horizontal direction. |
| extpoint1 (Point3d) | Start of first extension line. |
| extpoint2 (Point3d) | start of second extension line. |
| dirpoint1 (Point3d) | point on first extension vector. |
| dirpoint2 (Point3d) | Spoint on second extension vector. |
| dimlinepoint (Point3d) | point on dimension line. |
public static AngularDimension Create(Guid styleId, Plane plane, Point3d extpoint1, Point3d extpoint2, Point3d dirpoint1, Point3d dirpoint2, Point3d dimlinepoint)
obsoleteUse an override that accepts a DimStyle
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.
Parameters:
| currentRemainder (uint) | The current remainder value. |
Returns: CRC of the information the defines the object.
DeleteAllUserStrings
public void DeleteAllUserStrings()
Parameters:
| key (string) |
Dispose
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
Dispose
Overridden in order to destroy local display cache information
Parameters:
| disposing (bool) |
Overrides: CommonObject.Dispose
Returns: 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.
Returns: An object of the same type as this object.
This behavior is overridden by implementing classes.
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.
Returns: An array of Curve and TextEntity objects. If the leader is using user-defined arrowheads, InstanceReferenceGeometry objects will be included.
[ConstOperation]
public bool Get3dPoints(out Point3d centerpoint, out Point3d defpoint1, out Point3d defpoint2, out Point3d arrowpoint1, out Point3d arrowpoint2, out Point3d dimlinepoint, out Point3d textpoint)
Get locations of dimension's 3d points
Parameters:
| centerpoint (out Point3d) | Dimension's center point |
| defpoint1 (out Point3d) | First definition point |
| defpoint2 (out Point3d) | Second definition point |
| arrowpoint1 (out Point3d) | First arrow point |
| arrowpoint2 (out Point3d) | Second arrow point |
| dimlinepoint (out Point3d) | Point on dimension line |
| textpoint (out Point3d) | Text location point |
Parameters:
| style (DimensionStyle) |
GetBoundingBox
Bounding box solver. Gets the world axis aligned bounding box for the geometry.
Parameters:
| accurate (bool) | 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. |
Returns: 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.
GetBoundingBox
Aligned Bounding box solver. Gets the plane aligned bounding box.
Parameters:
| plane (Plane) | Orientation plane for BoundingBox. |
Returns: A BoundingBox in plane coordinates.
GetBoundingBox
Aligned bounding box solver. Gets the world axis aligned bounding box for the transformed geometry.
Parameters:
| xform (Transform) | Transformation to apply to bounding box after calculation. The geometry is not modified. |
Returns: The bounding box of the transformed geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.
Overrides: GeometryBase.GetBoundingBox
GetDimensionStyle
Return the proper dimension style from which to get properties for this annotation object If this object has style overrides, those will be included in the returned dimension style and the style will be updated to include the current state of the parent style for non-overridden fields
Parameters:
| parentDimStyle (DimensionStyle) |
[ConstOperation]
public bool GetDisplayLines(DimensionStyle style, double scale, out Line[] lines, out Arc[] arcs)
Parameters:
| style (DimensionStyle) | |
| scale (double) | |
| lines (out Line[]) | |
| arcs (out Arc[]) |
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. |
GetPlainTextWithRunMap
Return plain text string for this annotation with field expressions unevaluated.
Parameters:
| map (ref int[]) | an array of int values in groups of 3: run index, character start position, and length. |
Returns: A plain text string.
Parameters:
| corners (out Point3d[]) |
GetTextTransform
[ConstOperation]
public Transform GetTextTransform(ViewportInfo viewport, DimensionStyle style, double textScale, bool drawForward)
Get the transform for this text object's text geometry
Parameters:
| viewport (ViewportInfo) | Viewport where text is being used |
| style (DimensionStyle) | Dimension's DimensionStyle |
| textScale (double) | Scale to apply to text |
| drawForward (bool) | Draw text front-facing |
Parameters:
| key (string) | id used to retrieve the string. |
Returns: 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.
Returns: A new collection.
IsAllBold
Returns true if all of the text in the annotation is Bold, otherwise returns false
IsAllItalic
Returns true if all of the text in the annotation is Italic, otherwise returns false
IsAllUnderlined
Returns true if all of the text in the annotation is Underlined, otherwise returns false
IsPropertyOverridden
Returns true if a property is overridden
Parameters:
| field (DimensionStyle.Field) |
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.
MakeDeformable
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
Returns: 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.
Returns: An estimated memory footprint.
NonConstOperation
protected override void NonConstOperation()
Destroy cache handle
Overrides: CommonObject.NonConstOperation
OnSwitchToNonConst
protected override void OnSwitchToNonConst()
Is called when a non-constant operation occurs.
Overrides: CommonObject.OnSwitchToNonConst
Rotate
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Scale
Scales the object by the specified factor. The scale is centered at the origin.
Parameters:
| scaleFactor (double) | The uniform scaling factor. |
Returns: true if geometry successfully scaled.
SetAltDimensionLengthDisplayWithZeroSuppressionReset
Parameters:
| ld (DimensionStyle.LengthDisplay) |
Parameters:
| set_on (bool) |
SetDimensionLengthDisplayWithZeroSuppressionReset
Parameters:
| ld (DimensionStyle.LengthDisplay) |
Parameters:
| set_on (bool) |
SetOverrideDimStyle
Set a style including overrides for this annotation object. The DimensionStyle OverrideStyle must have the override fields marked as overridden and must have it's Id set to nil. Use DimensionStyle.SetFieldOverride(Field field) and related functions to manage override settings. To override a field, the field value must be set and the field must be marked as an override. The DimensionStyle passed in here must not be in the dimstyle table
Parameters:
| OverrideStyle (DimensionStyle) |
SetRichText
Sets the annotation's text as rich text (RTF), optionally using a specified dimension style for formatting overrides.
Parameters:
| rtfText (string) | The RTF (Rich Text Format) string to assign to the annotation. |
| dimstyle (DimensionStyle) | The dimension style to use for formatting overrides, or null to use the current style. |
Parameters:
| set_on (bool) |
SetUserString
Attach a user string (key,value combination) to this geometry.
ToJSON
Create a JSON string representation of this object
Parameters:
| options (SerializationOptions) |
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.
Parameters:
| xform (Transform) | Transformation to apply to geometry. |
Returns: true if geometry successfully transformed.
Translate
Translates the object along the specified vector.
Translate
Translates the object along the specified vector.
Parameters:
| translationVector (Vector3d) | A moving vector. |
Returns: true if geometry successfully translated.
UpdateDimensionText
Remakes dimension text geometry object and sets it on the dimension.
Parameters:
| style (DimensionStyle) | The dimension style. |
| units (LengthUnit) | The length units. |
UpdateDimensionText
Remakes dimension text geometry object and sets it on the dimension.
Parameters:
| style (DimensionStyle) | The dimension style. |
| units (UnitSystem) | The unit system. |
WrapText
public void WrapText()
Wrap text