Gasget
Previous Topic  Next Topic 

 

 

Gasget

 

 

 

 

 

 

 

 

 

              sdLwPolyline poly = fDrawCtrl1.Document.CreateLwPolyline();

            poly.AddVertex(new Point3D(80, 65, 0));

            poly.AddVertex(new Point3D(20, 65, 0));

            poly.AddVertex(new Point3D(20, 45, 0));

            poly.AddVertex(new Point3D(-35, 15, 0));

            poly.AddVertex(new Point3D(-35, -25, 0));

            poly.AddVertex(new Point3D(20, -55, 0));

            poly.AddVertex(new Point3D(80, -55, 0));

            poly.AddVertex(new Point3D(135, -25, 0));

            poly.AddVertex(new Point3D(135, 15, 0));

            poly.AddVertex(new Point3D(80, 45, 0));

            poly.Closed = true;

 

            poly.LineSections[3].Bulge = 0.5;

            poly.LineSections[5].Bulge = (double)(1 / 12.0);

            poly.LineSections[7].Bulge = 0.5;

 

            sd3dSolid solid = fDrawCtrl1.Document.AddSolidExtruded(poly, 100);

 

            sdCircle circle0 = fDrawCtrl1.Document.CreateCircle(new Point3D(115, -5, 0), 15);

            sd3dSolid cir0 = fDrawCtrl1.Document.AddSolidExtruded(circle0, 100);

            sdCircle circle1 = fDrawCtrl1.Document.CreateCircle(new Point3D(-15, -5, 0), 15);

            sd3dSolid cir1 = fDrawCtrl1.Document.AddSolidExtruded(circle1, 100);

 

            sdCircle circleCtr = fDrawCtrl1.Document.CreateCircle(new Point3D(50, -5, 0), 35);

            sd3dSolid cirCtr = fDrawCtrl1.Document.AddSolidExtruded(circleCtr, 100);

 

            List<sd3dSolid> cirSolids = new List<sd3dSolid>();

            cirSolids.Add(cir0);

            cirSolids.Add(cir1);

            cirSolids.Add(cirCtr);

 

            for (int i = 0; i < cirSolids.Count; i++)

            {

                solid = fDrawCtrl1.Document.AddSolidOpSubtract(solid, cirSolids[i], falsefalse);

            }

            sd3dSolid pA = solid;

 

            sdCircle circleCtr1 = fDrawCtrl1.Document.CreateCircle(new Point3D(50, -5, 0), 35);

            sd3dSolid cirCtr1 = fDrawCtrl1.Document.AddSolidExtruded(circleCtr1, 130);

            sdCircle circleCtr2 = fDrawCtrl1.Document.CreateCircle(new Point3D(50, -5, 0), 30);

            sd3dSolid cirCtr2 = fDrawCtrl1.Document.AddSolidExtruded(circleCtr2, 130);

 

            sd3dSolid pB = fDrawCtrl1.Document.AddSolidOpSubtract(cirCtr1, cirCtr2, falsefalse);

            pB.Move(new Point3D(0, 0, -30));

 

            fDrawCtrl1.Document.AddSolidOpUnion(pA, pB, falsefalse);

 

            fDrawCtrl1.Document.DimStyles.DimStyleList[0].OverallScale = 17;

 

            fDrawCtrl1.Document.AddDimensionRotated(new Point3D(-30, -5, 0), new Point3D(0, -5, 0), new Point3D(-15, 40, 0), 0);

            fDrawCtrl1.Document.AddDimensionRotated(new Point3D(100, -5, 0), new Point3D(130, -5, 0), new Point3D(-15, 40, 0), 0);

            fDrawCtrl1.Document.AddDimensionRotated(new Point3D(20, 45, 0), new Point3D(20, 65, 0), new Point3D(5, 55, 0), 90);

            fDrawCtrl1.Document.AddDimensionRotated(new Point3D(15, -5, 0), new Point3D(85, -5, 0), new Point3D(50, -80, 0), 0);

 

            fDrawCtrl1.Document.ActiveView.View = ViewMode.FRONT;

            fDrawCtrl1.Document.AddDimensionRotated(new Point3D(145, 0, 0), new Point3D(145, 0, 100), new Point3D(170, -60, 0), 90);

 

            poly.Dispose();

            circle0.Dispose();

            circle1.Dispose();

            circleCtr.Dispose();

            circleCtr1.Dispose();

            circleCtr2.Dispose();