Casing

Casing.png

Define layer names.

const string
    Dim = "Dim",
    DashDot = "DashDot",
    Frame = "Frame",
    FrameText = "FrameText";

Draw the component and its dimensions.

// Setting layers and linetype 
model1.Layers.Add(new Layer(Dim, Color.CornflowerBlue));
model1.Layers.Add(new Layer(Frame) { LineWeight = 2 });
model1.Layers.Add(new Layer(FrameText) { LineWeight = 3 });
model1.LineTypes.Add(DashDot, new float[] { 15f, -5f, 1f, -5f });
model1.Layers[0].LineWeight = 2.5f;

//Main Circles
Circle centerInner = new Circle(new Point3D(0, 0, 0), 15);
Circle centerOuter = new Circle(new Point3D(0, 0, 0), 30);
Circle rightInner = new Circle(new Point3D(50, 0, 0), 7);
Circle rightouter = new Circle(new Point3D(50, 0, 0), 15);
Circle leftInner = new Circle(new Point3D(-55, -30, 0), 4);
Circle leftOuter = new Circle(new Point3D(-55, -30, 0), 12);

//Main circles dimensions
Point3D dlp = new Point3D(0, 40, 0);
dlp.TransformBy(new Rotation(Utility.DegToRad(60), Vector3D.AxisZ));
DiametricDim cOutDim = new DiametricDim(centerOuter, dlp, textHeight)
{
    ArrowsLocation = elementPositionType.Outside,
    TrimLeader = true,
    CenterMarkSize = 0
};
model1.Entities.Add(cOutDim, Dim);

dlp = new Point3D(0, 22.5, 0);
dlp.TransformBy(new Rotation(Utility.DegToRad(-30), Vector3D.AxisZ));
DiametricDim cInDim = new DiametricDim(centerInner, dlp, textHeight)
{
    ArrowsLocation = elementPositionType.Outside,
    TrimLeader = true,
    CenterMarkSize = 0
};
model1.Entities.Add(cInDim, Dim);

dlp = new Point3D(0, rightouter.Radius + 5, 0);
dlp.TransformBy(new Rotation(Utility.DegToRad(-60), Vector3D.AxisZ));
dlp.TransformBy(new Translation(rightouter.Center.X, rightouter.Center.Y));
DiametricDim cROutDim = new DiametricDim(rightouter, dlp, textHeight)
{
    ArrowsLocation = elementPositionType.Outside,
    TrimLeader = true,
    CenterMarkSize = 0
};
model1.Entities.Add(cROutDim, Dim);

dlp = new Point3D(0, leftOuter.Radius + 5, 0);
dlp.TransformBy(new Rotation(Utility.DegToRad(120), Vector3D.AxisZ));
dlp.TransformBy(new Translation(leftOuter.Center.X, leftOuter.Center.Y));
DiametricDim cLOutDim = new DiametricDim(leftOuter, dlp, textHeight)
{
    ArrowsLocation = elementPositionType.Outside,
    TrimLeader = true,
    CenterMarkSize = 0
};
model1.Entities.Add(cLOutDim, Dim);

//Major Dashed Lines   
Line leftDashed, rightDashed, verticalCenterDashed, horizontalCenterDashed, horizontalLowerDashed;
leftDashed = UtilityEx.GetLinesTangentToCircleFromPoint(centerOuter, new Point3D(-55, -124))[1];
leftDashed.LineTypeMethod = colorMethodType.byEntity;
leftDashed.LineTypeName = DashDot;
model1.Entities.Add(leftDashed, Dim);

rightDashed = new Line(55, -124, 0, 0)
{
    LineTypeMethod = colorMethodType.byEntity,
    LineTypeName = DashDot
};
model1.Entities.Add(rightDashed, Dim);
horizontalCenterDashed = new Line(new Point3D(-centerOuter.Radius, 0), new Point3D(65, 0))
{
    LineTypeMethod = colorMethodType.byEntity,
    LineTypeName = DashDot
};
model1.Entities.Add(horizontalCenterDashed, Dim);
verticalCenterDashed = new Line(new Point3D(0, 30), new Point3D(0, -124))
{
    LineTypeMethod = colorMethodType.byEntity,
    LineTypeName = DashDot
};
model1.Entities.Add(verticalCenterDashed, Dim);
horizontalLowerDashed = new Line(new Point3D(-55, -30), new Point3D(0, -30))
{
    LineTypeMethod = colorMethodType.byEntity,
    LineTypeName = DashDot
};
model1.Entities.Add(horizontalLowerDashed, Dim);

//Outer Shape
Line bottomLine = new Line(-72, -124, 62, -124);
Line l1L = new Line(-72, -116, -72, -124);
Line l1R = new Line(62, -124, 62, -116);
Arc a1L, a1R;
Line l2L = new Line((Point3D)leftDashed.StartPoint.Clone(), (Point3D)leftDashed.EndPoint.Clone());
Line l2R = new Line(rightDashed.StartPoint, rightDashed.EndPoint);
Arc a2L, a2R, aRR, a4L;
Arc a3L = new Arc(leftOuter.Center, leftOuter.Radius, 2 * Math.PI);
Arc a3R = new Arc(rightouter.Center, rightouter.Radius, 2 * Math.PI);
Arc aCtop = new Arc(centerOuter.Center, centerOuter.Radius, 2 * Math.PI);
Line lineTopR = UtilityEx.GetLinesTangentToTwoCircles(centerOuter, rightouter)[0];

Curve.Fillet(l2L, a3L, 24, false, true, true, true, out a2L);
Curve.Fillet(l2R, a3R, 30, true, true, true, true, out a2R);
Curve.Fillet(lineTopR, (Arc)a2R.Clone(), 15, false, true, false, false, out aRR);
Curve.Fillet(a3L, aCtop, 45, true, true, true, true, out a4L);
Curve.Fillet(lineTopR, a4L, 30, false, true, true, true, out aCtop);
Curve.Fillet(new Line(62, -116, 0, -116), l2R, 14, false, false, true, true, out a1R);
Curve.Fillet(new Line(-80, -116, 0, -116), l2L, 22.5, false, false, true, true, out a1L);

//intermediate Shape
Line bottomlineInter = (Line)bottomLine.Offset(-7, Vector3D.AxisZ);
Line l2LInter = (Line)l2L.Offset(3, Vector3D.AxisZ);
Line l2RInter = (Line)l2R.Offset(-3, Vector3D.AxisZ);
Arc a1LInter, a1RInter;
Curve.Fillet(bottomlineInter, l2RInter, 25, false, false, true, true, out a1RInter);
Curve.Fillet(l2LInter, bottomlineInter, 25, false, true, true, true, out a1LInter);
Arc a2RInter, a3RInter, aRHiInter;
Circle c2RInter, cRLowInter;
c2RInter = new Circle((Point3D)a2R.Center.Clone(), 33);
cRLowInter = UtilityEx.GetCirclesTangentToTwoCircles(c2RInter, rightouter, 5, true)[0];
Curve.Fillet(l2RInter, cRLowInter, 33, true, true, true, true, out a2RInter);
Line l3R = (Line)lineTopR.Offset(3, Vector3D.AxisZ);
a3RInter = new Arc((Point3D)rightouter.Center.Clone(), rightouter.Radius, Math.PI * 2);
Curve.Fillet(a3RInter, l3R, 5, true, true, true, true, out aRHiInter);
a3RInter.TrimBy((Point3D)cRLowInter.EndPoint.Clone(), false);
Arc a4R, aCenterLow;
aCenterLow = new Arc((Point3D)centerOuter.Center.Clone(), centerOuter.Radius, Math.PI * 2);
Curve.Fillet(aCenterLow, l3R, 5, true, true, false, true, out a4R);
Arc a5LInter = (Arc)a4L.Offset(-3, Vector3D.AxisZ);
Arc a4LInter, a6LInter, a3LInter, a2LInter;
Curve.Fillet(aCenterLow, a5LInter, 5, true, false, false, true, out a6LInter);
Curve.Fillet(leftOuter, a5LInter, 5, true, false, false, true, out a4LInter);
a2LInter = (Arc)a2L.Offset(3, Vector3D.AxisZ);
Curve.Fillet(leftOuter, a2LInter, 5, true, true, false, true, out a3LInter);
Arc aLeftOut = new Arc((Point3D)leftOuter.Center.Clone(), (Point3D)a3LInter.EndPoint.Clone(), (Point3D)a4LInter.StartPoint.Clone());
Arc aCenter = new Arc((Point3D)a4R.StartPoint.Clone(), new Point3D(0, -30, 0), (Point3D)a6LInter.EndPoint.Clone(), false);

//Inner Shape
Line lInnerBott, lInnerL, lInnerR;
lInnerBott = (Line)bottomLine.Offset(-25, Vector3D.AxisZ);
lInnerL = (Line)(new Line((Point3D)leftDashed.StartPoint.Clone(), (Point3D)leftDashed.EndPoint.Clone())).Offset(21, Vector3D.AxisZ);
lInnerR = (Line)(new Line((Point3D)rightDashed.StartPoint.Clone(), (Point3D)rightDashed.EndPoint.Clone())).Offset(-21, Vector3D.AxisZ);

Arc aL, aR, aTop;
Curve.Fillet(lInnerBott, lInnerR, 7, false, false, true, true, out aR);
Curve.Fillet(lInnerR, lInnerL, 10, true, false, true, true, out aTop);
Curve.Fillet(lInnerL, lInnerBott, 7, false, true, true, true, out aL);

//Radial Dimensions
RadialDim rDr1 = CreateRadialDim(a1R, Utility.DegToRad(225), a1R.Radius / 2, textHeight);
//This method also fixes the orientation of the arc's plane in space so that its X and Y match world X and Y axis.
//The arc's plane orientation is fundamental for the correct radial dimension display.

rDr1.TrimLeader = true;
model1.Entities.Add(rDr1, Dim);

RadialDim rDr2 = CreateRadialDim(a2R, Utility.DegToRad(170), a2R.Radius / 2, textHeight);
rDr2.TrimLeader = true;
model1.Entities.Add(rDr2, Dim);

RadialDim rDr1Inter = CreateRadialDim(a1RInter, Utility.DegToRad(315), a1RInter.Radius + 8, textHeight);
rDr1Inter.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDr1Inter, Dim);

RadialDim rDr2Inter = CreateRadialDim(a2RInter, Utility.DegToRad(140), a2RInter.Radius / 2, textHeight);
rDr2Inter.TrimLeader = true;
model1.Entities.Add(rDr2Inter, Dim);

RadialDim rDr3Inter = CreateRadialDim(aRHiInter, Utility.DegToRad(0), aRHiInter.Radius + 4, textHeight);
rDr3Inter.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDr3Inter, Dim);

RadialDim rDr4Inter = CreateRadialDim(a4R, Utility.DegToRad(170), a4R.Radius + 4, textHeight);
rDr4Inter.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDr4Inter, Dim);

RadialDim rDl1 = CreateRadialDim(a1L, Utility.DegToRad(325), a1L.Radius / 2, textHeight);
rDl1.TrimLeader = true;
model1.Entities.Add(rDl1, Dim);

RadialDim rDl2 = CreateRadialDim(a2L, Utility.DegToRad(20), a2L.Radius / 2, textHeight);
rDl2.TrimLeader = true;
model1.Entities.Add(rDl2, Dim);

RadialDim rDl4 = CreateRadialDim(a4L, Utility.DegToRad(320), 2 * a4L.Radius / 3, textHeight);
rDl4.TrimLeader = true;
model1.Entities.Add(rDl4, Dim);

RadialDim rDl5 = CreateRadialDim(a1LInter, Utility.DegToRad(225), a1LInter.Radius + 10, textHeight);
rDl5.TrimLeader = false;
rDl5.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDl5, Dim);

RadialDim rDl6 = CreateRadialDim(a3LInter, Utility.DegToRad(200), a3LInter.Radius / 2, textHeight);
rDl6.ArrowsLocation = elementPositionType.Inside;
model1.Entities.Add(rDl6, Dim);

RadialDim rDl7 = CreateRadialDim(a4LInter, Utility.DegToRad(165), a4LInter.Radius + 15, textHeight);
rDl7.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDl7, Dim);

RadialDim rDl8 = CreateRadialDim(a6LInter, Utility.DegToRad(20), a6LInter.Radius * 2, textHeight);
rDl8.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDl8, Dim);

RadialDim rIR = CreateRadialDim(aR, Utility.DegToRad(340), aR.Radius * 2, textHeight);
rIR.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rIR, Dim);

RadialDim rIT = CreateRadialDim(aTop, Utility.DegToRad(150), aTop.Radius / 2, textHeight);
model1.Entities.Add(rIT, Dim);

RadialDim rIL = CreateRadialDim(aL, Utility.DegToRad(200), aL.Radius * 2, textHeight);
rIL.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rIL, Dim);

dlp = new Point3D(cRLowInter.Radius + 4, 0, 0);
dlp.TransformBy(new Rotation(Utility.DegToRad(0), Vector3D.AxisZ));
dlp.TransformBy(new Translation(cRLowInter.Center.X, cRLowInter.Center.Y));
RadialDim rDr5Inter = new RadialDim(cRLowInter, dlp, textHeight); ;
rDr5Inter.ArrowsLocation = elementPositionType.Outside;
model1.Entities.Add(rDr5Inter, Dim);

foreach (Entity en in model1.Entities)//Hiding the center mark
    if (en is RadialDim)
        ((RadialDim)en).CenterMarkSize = 0;

// Adding to Entities
model1.Entities.AddRange(new Entity[] {

    //Main Circles
     centerInner,rightInner, leftInner, 

    //Outer shape
    l1L, l1R,a1R,a1L,   a2L,a2R,  l2L,  bottomLine, l2R, lineTopR, aRR, a4L, aCtop, a3L,a3R,
     new Line(62, -116, a1R.StartPoint.X, a1R.StartPoint.Y),new Line((Point3D)l1L.StartPoint.Clone(), (Point3D)a1L.StartPoint.Clone()),

     //Intermediate shape
     l2LInter, l2RInter, bottomlineInter, a1RInter, a1LInter,cRLowInter,a2RInter,aRHiInter,a3RInter,l3R, a4R,
     a5LInter, a6LInter,aCenter,
     a4LInter,a2LInter, a3LInter,aLeftOut,

     //inner shape
     lInnerBott, lInnerL, lInnerR,aR,aTop,aL,
 });

//Linear Dimensions
double hlmt = 40;
double llmt = -80;
double lowlmt1 = -134;
double lowlmt2 = -144;
double rlmt = 72;

Point2D p1 = (Point2D)a4L.IntersectWith(new Line(Plane.XY, leftOuter.Center.X, hlmt, leftOuter.Center.X, leftOuter.Center.Y))[0];
Point2D p2 = centerOuter.Center + new Vector2D(0, centerOuter.Radius);

LinearDim ld1 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, hlmt), textHeight);
model1.Entities.Add(ld1, Dim);

p1 = (Point2D)lineTopR.IntersectWith(new Line(Plane.XY, rightouter.Center.X, hlmt, rightouter.Center.X, rightouter.Center.Y))[0];
LinearDim ld2 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, hlmt), textHeight);
model1.Entities.Add(ld2, Dim);

p1 = (Point2D)a4L.IntersectWith(new Line(Plane.XY, -55, 0, 0, 0))[0];
p2 = (Point2D)leftOuter.Center.Clone();
p1.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
p2.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld3 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, -llmt), textHeight);
model1.Entities.Add(ld3, Dim);

p1 = (Point2D)bottomLine.StartPoint.Clone();
p1.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld4 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, -llmt), textHeight);
model1.Entities.Add(ld4, Dim);

p1 = (Point2D)bottomLine.StartPoint.Clone();
p2 = new Point2D(0, -124);
LinearDim ld5 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, lowlmt2), textHeight);
model1.Entities.Add(ld5, Dim);

p1 = (Point2D)leftDashed.StartPoint.Clone();
LinearDim ld6 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, lowlmt1), textHeight);
model1.Entities.Add(ld6, Dim);

p1 = (Point2D)bottomLine.EndPoint.Clone();
p2 = new Point2D(0, -124);
LinearDim ld7 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, lowlmt2), textHeight);
model1.Entities.Add(ld7, Dim);

p1 = (Point2D)rightDashed.StartPoint.Clone();
LinearDim ld8 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, lowlmt1), textHeight);
model1.Entities.Add(ld8, Dim);

Vector3D tanV = (Vector3D)lInnerR.StartTangent.Clone();
Vector3D normV = Vector3D.Cross(tanV, Vector3D.AxisZ);
normV.Normalize();
normV.Length = 100;
Line normL = new Line(0, 0, normV.X, normV.Y);
normL.Translate(new Vector3D(0, -89.5, 0));
p1 = normL.IntersectWith(lInnerR)[0];
p2 = normL.IntersectWith(l2RInter)[0];
Plane pl = Plane.XY;
pl.Rotate(normV.Angle, Vector3D.AxisZ);
p1.TransformBy(new Rotation(-normV.Angle, Vector3D.AxisZ));
p2.TransformBy(new Rotation(-normV.Angle, Vector3D.AxisZ));
LinearDim ld9 = new LinearDim(pl, p1, p2, Point2D.MidPoint(p1, p2), textHeight);
model1.Entities.Add(ld9, Dim);

p1 = normL.IntersectWith(l2R)[0];
p1.TransformBy(new Rotation(-normV.Angle, Vector3D.AxisZ));
LinearDim ld10 = new LinearDim(pl, p1, p2, Point2D.MidPoint(p1, p2), textHeight);
model1.Entities.Add(ld10, Dim);

p1 = (Point2D)l1R.StartPoint.Clone();
p2 = (Point2D)l1R.EndPoint.Clone();
p1.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
p2.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld11 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, -rlmt), textHeight);
model1.Entities.Add(ld11, Dim);

p1 = (Point2D)rightInner.Center.Clone() + Vector2D.AxisY * rightInner.Radius;
p2 = (Point2D)rightInner.Center.Clone() - Vector2D.AxisY * rightInner.Radius;
p1.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
p2.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld12 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X, -rlmt), textHeight);
model1.Entities.Add(ld12, Dim);

normL = (Line)verticalCenterDashed.Clone();
normL = (Line)normL.Offset(10, Vector3D.AxisZ);
p1 = normL.IntersectWith(bottomlineInter)[0];
p2 = normL.IntersectWith(bottomLine)[0];
p1.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
p2.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld13 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, Point2D.MidPoint(p1, p2), textHeight);
model1.Entities.Add(ld13, Dim);

p2 = normL.IntersectWith(lInnerBott)[0];
p2.TransformBy(new Rotation(-Math.PI / 2, Vector3D.AxisZ));
LinearDim ld14 = new LinearDim(new Plane(Point3D.Origin, Vector3D.AxisY, Vector3D.AxisX * -1), p1, p2, Point2D.MidPoint(p1, p2), textHeight);
model1.Entities.Add(ld14, Dim);

p1 = (Point2D)leftInner.Center.Clone() - new Vector2D(leftInner.Radius, 0);
p2 = (Point2D)leftInner.Center.Clone() + new Vector2D(leftInner.Radius, 0);
LinearDim ld15 = new LinearDim(Plane.XY, p1, p2, new Point2D(Point2D.MidPoint(p1, p2).X - 18, -23), textHeight);
model1.Entities.Add(ld15, Dim);

//More dashed lines
Line leftMin = new Line(leftOuter.Center.X, leftOuter.Center.Y - leftOuter.Radius, leftOuter.Center.X, leftOuter.Center.Y + leftOuter.Radius);
leftMin.LineTypeMethod = colorMethodType.byEntity;
leftMin.LineTypeName = DashDot;
model1.Entities.Add(leftMin, Dim);

Line rightMin = new Line(rightouter.Center.X, rightouter.Center.Y - rightouter.Radius, rightouter.Center.X, rightouter.Center.Y + rightouter.Radius);
rightMin.LineTypeMethod = colorMethodType.byEntity;
rightMin.LineTypeName = DashDot;
model1.Entities.Add(rightMin, Dim);

// Scale and translate component
double scale = 2;

model1.Entities.Scale(scale);

foreach (Entity en in model1.Entities)
    if (en is Dimension)
        // Restore original measure
        ((Dimension)en).LinearScale = 1 / scale;

model1.Entities.Translate(10, 100);
model1.Entities.Regen();

// Drawing the frame
int halfWidth = 200;
int halfHeight = 287;

LinearPath lp = new LinearPath(-halfWidth, -halfHeight, 2 * halfWidth, 2 * halfHeight);
model1.Entities.Add(lp);

Line line = new Line(-halfWidth / 4, -halfHeight + 30, halfWidth, -halfHeight + 30);
model1.Entities.Add(line);
line = new Line(-halfWidth / 4, -halfHeight + 30, -halfWidth / 4, -halfHeight);
model1.Entities.Add(line);
line = new Line(-halfWidth / 4, -halfHeight + 20, halfWidth, -halfHeight + 20);
model1.Entities.Add(line, Frame);
line = new Line(100, -halfHeight + 30, 100, -halfHeight);
model1.Entities.Add(line, Frame);
line = new Line(130, -halfHeight + 30, 130, -halfHeight);
model1.Entities.Add(line, Frame);
line = new Line(160, -halfHeight + 30, 160, -halfHeight);
model1.Entities.Add(line, Frame);
line = new Line(100, -halfHeight + 10, 160, -halfHeight + 10);
model1.Entities.Add(line, Frame);

Text text = new Text(25, -halfHeight + 25, 0, "Title", 4, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);
text = new Text(25, -halfHeight + 10, 0, "Casing", 8, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);
text = new Text(115, -halfHeight + 25, 0, "Date", 4, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);
text = new Text(115, -halfHeight + 15, 0, "Design", 4, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);
text = new Text(115, -halfHeight + 5, 0, "Check", 4, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);
text = new Text(180, -halfHeight + 25, 0, "Approve", 4, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter);
model1.Entities.Add(text, FrameText);

// other settings
model1.SetView(viewType.Top, true, false);
model1.ActiveViewport.Grid.Visible = false;
model1.ActiveViewport.OriginSymbol.Visible = false;
model1.Invalidate();

Utility function to draw the radial dimension:

private RadialDim CreateRadialDim(Arc a, double rotation, double distanceFromCenter, double textH)
{
    //Returns a radial dimension on the XY plane oriented according to rotation and distanceFromCenter.
    //The rotation follows the trigonometric standard for angles.

    Circle cr = new Circle(Plane.XY, a.Center, a.Radius);
    Point3D dlp = new Point3D(distanceFromCenter, 0, 0);
    dlp.TransformBy(new Rotation(rotation, Vector3D.AxisZ));
    dlp.TransformBy(new Translation(a.Center.X, a.Center.Y));
    return new RadialDim(cr, dlp, textH);
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.