Class AlignedDimension
A linear dimension aligned along the line between the specified start and end.
Examples
var l = Polygon.L(5, 5, 1);
var m = new Mass(l, 1, BuiltInMaterials.Glass);
this.Model.AddElement(m);
var offset = 0.125;
m.UpdateRepresentations();
var dimensions = new List<LinearDimension>();
foreach (var f in m.Representation.SolidOperations[0].Solid.Faces)
{
var p = f.Value.Outer.ToPolygon();
var segs = p.Segments();
var plane = p.Plane();
for (var i = 0; i < segs.Length; i++)
{
var a = segs[i];
var d = new AlignedDimension(a.Start, a.End, offset, a.Direction().Cross(plane.Normal));
dimensions.Add(d);
}
}
Inherited Members
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)
System.Object.ToString()
Namespace: Elements.Annotations
Assembly: Hypar.Elements.dll
Syntax
public class AlignedDimension : LinearDimension, INotifyPropertyChanged, IOverrideLinked
Constructors
AlignedDimension(Vector3, Vector3, Plane, String, String, String)
Create an aligned dimension from JSON.
Declaration
[JsonConstructor]
public AlignedDimension(Vector3 start, Vector3 end, Plane referencePlane, string prefix = null, string suffix = null, string displayValue = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | The start of the dimension. |
Vector3 | end | The end of the dimension. |
Plane | referencePlane | The plane on which the dimension is projected. |
System.String | prefix | Text that appears before the dimension's value. |
System.String | suffix | Text that appears after the dimension's value. |
System.String | displayValue | Text that appears in place of the dimension's value. |
AlignedDimension(Vector3, Vector3, Double, Vector3)
Create a linear dimension where the reference line is created by offsetting from the line created between start and end by the provided value.
Declaration
public AlignedDimension(Vector3 start, Vector3 end, double offset = 0, Vector3 offsetDirection = default(Vector3))
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | The start of the dimension. |
Vector3 | end | The end of the dimension. |
System.Double | offset | The offset of the reference line. |
Vector3 | offsetDirection | The direction in which the annotation will be offset from the dimension line. |
Implements
System.ComponentModel.INotifyPropertyChanged