Разработка прикладной библиотеки автоматизированного проектирования сборочной модели переходника

Автор работы: Пользователь скрыл имя, 05 Февраля 2015 в 18:11, курсовая работа

Краткое описание

На настоящий момент САПР становятся обязательной частью любой производственной экономической деятельности. Они помогают обеспечить жизнеспособность фирмы и дают ей возможность развиваться в нынешних условиях жесткой рыночной конкуренции. Основной вклад подобных систем состоит в следующем:
- повышение качества продукции за счет сокращения ошибок в конструкторских и технологических расчетах, удобства внесения инженерных изменений и контроля качества;

Прикрепленные файлы: 1 файл

dip.doc

— 1.74 Мб (Скачать документ)

                line_B2.end_point[i] = point_B3[i];

                line_B3.start_point[i] = point_B3[i];

                line_B3.end_point[i] = point_B4[i];

                line_B4.start_point[i] = point_B4[i];

                line_B4.end_point[i] = point_B5[i];

                line_B5.start_point[i] = point_B5[i];

                line_B5.end_point[i] = point_B6[i];

                line_B6.start_point[i] = point_B6[i];

                line_B6.end_point[i] = point_B1[i];*/

 

               /* line_C1.start_point[i] = point_C1[i];

                line_C1.end_point[i] = point_C2[i];

                line_C2.start_point[i] = point_C2[i];

                line_C2.end_point[i] = point_C3[i];

                line_C3.start_point[i] = point_C3[i];

                line_C3.end_point[i] = point_C1[i];*/

            }

 

            Tag[] sketch1 = new Tag[4];

           theUfSession.Curve.CreateLine(ref line_A1, out sketch1[0]);

            theUfSession.Curve.CreateLine(ref line_A2, out sketch1[1]);

            theUfSession.Curve.CreateLine(ref line_A3, out sketch1[2]);

            theUfSession.Curve.CreateLine(ref line_A4, out sketch1[3]);

 

            /*Tag[] sketch2 = new Tag[6];

            theUfSession.Curve.CreateLine(ref line_B1, out sketch2[0]);

            theUfSession.Curve.CreateLine(ref line_B2, out sketch2[1]);

            theUfSession.Curve.CreateLine(ref line_B3, out sketch2[2]);

            theUfSession.Curve.CreateLine(ref line_B4, out sketch2[3]);

            theUfSession.Curve.CreateLine(ref line_B5, out sketch2[4]);

            theUfSession.Curve.CreateLine(ref line_B6, out sketch2[5]);

 

           /* Tag[] sketch3 = new Tag[3];

            theUfSession.Curve.CreateLine(ref line_C1, out sketch3[0]);

            theUfSession.Curve.CreateLine(ref line_C2, out sketch3[1]);

            theUfSession.Curve.CreateLine(ref line_C3, out sketch3[2]);*/

 

            double[] ref_pt1 = new double[3];

            ref_pt1[0] = 0.00;

            ref_pt1[1] = 0.00;

            ref_pt1[2] = 0.00;

            double[] direction1 = { 1.00, 0.00, 0.00 };

            string[] limit1 = { "0", "360" };

            Tag[] body1;

            theUfSession.Modl.CreateRevolved(sketch1, limit1, ref_pt1, direction1, FeatureSigns.Nullsign, out body1);

 

           /* string taper_angle = "0.0";

            string[] limit_extrude1 = { "0", "15" };

            double[] ref_pt_extrude = { 0.0, 0.0, 0.0 };

            double[] direction_extrude1 = { -1.0, 0.0, 0.0 };

 

            theUfSession.Modl.CreateExtruded(

            sketch2,

            taper_angle,

            limit_extrude1,

            ref_pt_extrude ,

            direction_extrude1,

            FeatureSigns.Positive,

            out body1);

            theUfSession.Modl.CreateRevolved(sketch3, limit1, ref_pt1, direction1, FeatureSigns.Negative, out body1);

 

            theSession.DisplayManager.HideByType(DisplayManager.ShowHideType.Curves, DisplayManager.ShowHideScope.AnyInAssembly);

            */

            //СОЗДАНИЕ ФАСОК И СКРУГЛЕНИЙ

 

            Tag feat1 = body1[0];

            Tag objTag1;

            Tag[] edgeArray1;

            int edgeCount;

            Tag obj_id_camf;

            Tag[] list1;

 

            theUfSession.Modl.AskFeatBody(feat1, out objTag1);

            theUfSession.Modl.AskBodyEdges(objTag1, out edgeArray1);

            theUfSession.Modl.AskListCount(edgeArray1, out edgeCount);

            ArrayList arrList1 = new ArrayList();

            for (int ii = 0; ii < edgeCount; ii++)

            {

                Tag edge;

                theUfSession.Modl.AskListItem(edgeArray1, ii, out edge);

                if( (ii == 0) ||(ii==1))

                {

                    arrList1.Add(edge);

                }

            }

            list1 = (Tag[])arrList1.ToArray(typeof(Tag));

 

            // Параметры фаски:

            string offset1 = "1";

            string offset2 = "1";

            string ang = "45";

            // Создание фаски.

            theUfSession.Modl.CreateChamfer(3, offset1, offset2, ang, list1, out obj_id_camf);

        }

        /*---------------------------------------------------------------------------------------------------------------------------------*/

        void gayka2()

        {

            Tag squares1;

            string name1 = "gayka2";

            int units1 = 1;

            theUfSession.Part.New(name1, units1, out squares1);

 

            double[] point_A1 = { 0.0, 0.0, 0.0 };

            double[] point_A2 = { 0.0, 13.0, 0.0 };

            double[] point_A3 = { -15.0, 13.0, 0.0 };

            double[] point_A4 = { -15.0, 0.0, 0.0 };

 

            double[] point_B1 = { 0.0, -18, 10.3923 };

            double[] point_B2 = { 0.0, 0.0, 20.7846 };

            double[] point_B3 = { 0.0, 18, 10.3923 };

            double[] point_B4 = { 0.0, 18, -10.3923 };

            double[] point_B5 = { 0.0, 0.0, -20.7846 };

            double[] point_B6 = { 0.0, -18, -10.3923 };

 

            double[] point_C1 = { -15.0, 18, 0.0 };

            double[] point_C2 = { -15.0, (18 + 5), 0.0 };

            double[] point_C3 = { -(15 - 3), (18 + 5), 0.0 };

 

            UFCurve.Line line_A1 = new UFCurve.Line();

            UFCurve.Line line_A2 = new UFCurve.Line();

            UFCurve.Line line_A3 = new UFCurve.Line();

            UFCurve.Line line_A4 = new UFCurve.Line();

 

            UFCurve.Line line_B1 = new UFCurve.Line();

            UFCurve.Line line_B2 = new UFCurve.Line();

            UFCurve.Line line_B3 = new UFCurve.Line();

            UFCurve.Line line_B4 = new UFCurve.Line();

            UFCurve.Line line_B5 = new UFCurve.Line();

            UFCurve.Line line_B6 = new UFCurve.Line();

 

            UFCurve.Line line_C1 = new UFCurve.Line();

            UFCurve.Line line_C2 = new UFCurve.Line();

            UFCurve.Line line_C3 = new UFCurve.Line();

 

            line_A1.start_point = new double[3];

            line_A1.end_point = new double[3];

            line_A2.start_point = new double[3];

            line_A2.end_point = new double[3];

            line_A3.start_point = new double[3];

            line_A3.end_point = new double[3];

            line_A4.start_point = new double[3];

            line_A4.end_point = new double[3];

 

            line_B1.start_point = new double[3];

            line_B1.end_point = new double[3];

            line_B2.start_point = new double[3];

            line_B2.end_point = new double[3];

            line_B3.start_point = new double[3];

            line_B3.end_point = new double[3];

            line_B4.start_point = new double[3];

            line_B4.end_point = new double[3];

            line_B5.start_point = new double[3];

            line_B5.end_point = new double[3];

            line_B6.start_point = new double[3];

            line_B6.end_point = new double[3];

 

            line_C1.start_point = new double[3];

            line_C1.end_point = new double[3];

            line_C2.start_point = new double[3];

            line_C2.end_point = new double[3];

            line_C3.start_point = new double[3];

            line_C3.end_point = new double[3];

 

            for (int i = 0; i < 3; i++)

            {

                line_A1.start_point[i] = point_A1[i];

                line_A1.end_point[i] = point_A2[i];

                line_A2.start_point[i] = point_A2[i];

                line_A2.end_point[i] = point_A3[i];

                line_A3.start_point[i] = point_A3[i];

                line_A3.end_point[i] = point_A4[i];

                line_A4.start_point[i] = point_A4[i];

                line_A4.end_point[i] = point_A1[i];

 

                line_B1.start_point[i] = point_B1[i];

                line_B1.end_point[i] = point_B2[i];

                line_B2.start_point[i] = point_B2[i];

                line_B2.end_point[i] = point_B3[i];

                line_B3.start_point[i] = point_B3[i];

                line_B3.end_point[i] = point_B4[i];

                line_B4.start_point[i] = point_B4[i];

                line_B4.end_point[i] = point_B5[i];

                line_B5.start_point[i] = point_B5[i];

                line_B5.end_point[i] = point_B6[i];

                line_B6.start_point[i] = point_B6[i];

                line_B6.end_point[i] = point_B1[i];

 

                line_C1.start_point[i] = point_C1[i];

                line_C1.end_point[i] = point_C2[i];

                line_C2.start_point[i] = point_C2[i];

                line_C2.end_point[i] = point_C3[i];

                line_C3.start_point[i] = point_C3[i];

                line_C3.end_point[i] = point_C1[i];

            }

 

            Tag[] sketch1 = new Tag[4];

            theUfSession.Curve.CreateLine(ref line_A1, out sketch1[0]);

            theUfSession.Curve.CreateLine(ref line_A2, out sketch1[1]);

            theUfSession.Curve.CreateLine(ref line_A3, out sketch1[2]);

            theUfSession.Curve.CreateLine(ref line_A4, out sketch1[3]);

 

            Tag[] sketch2 = new Tag[6];

            theUfSession.Curve.CreateLine(ref line_B1, out sketch2[0]);

            theUfSession.Curve.CreateLine(ref line_B2, out sketch2[1]);

            theUfSession.Curve.CreateLine(ref line_B3, out sketch2[2]);

            theUfSession.Curve.CreateLine(ref line_B4, out sketch2[3]);

            theUfSession.Curve.CreateLine(ref line_B5, out sketch2[4]);

            theUfSession.Curve.CreateLine(ref line_B6, out sketch2[5]);

 

            Tag[] sketch3 = new Tag[3];

            theUfSession.Curve.CreateLine(ref line_C1, out sketch3[0]);

            theUfSession.Curve.CreateLine(ref line_C2, out sketch3[1]);

            theUfSession.Curve.CreateLine(ref line_C3, out sketch3[2]);

 

            double[] ref_pt1 = new double[3];

            ref_pt1[0] = 0.00;

            ref_pt1[1] = 0.00;

            ref_pt1[2] = 0.00;

            double[] direction1 = { 1.00, 0.00, 0.00 };

            string[] limit1 = { "0", "360" };

            Tag[] body1;

 

 

            string taper_angle = "0.0";

            string[] limit_extrude1 = { "0", "15" };

            double[] ref_pt_extrude = { 0.0, 0.0, 0.0 };

            double[] direction_extrude1 = { -1.0, 0.0, 0.0 };

 

            theUfSession.Modl.CreateExtruded(

            sketch2/*Массив объектов выдавливания*/,

            taper_angle/*Угол уклона*/,

            limit_extrude1/*Начало и конец выдавливания*/,

            ref_pt_extrude /*базовая точка*/,

            direction_extrude1/*Направление выдавливания*/,

            FeatureSigns.Nullsign/*Буревая операция (ВЫЧИТАНИЕ)*/,

            out body1);

            theUfSession.Modl.CreateRevolved(sketch3, limit1, ref_pt1, direction1, FeatureSigns.Negative, out body1);

 

            theUfSession.Modl.CreateRevolved(sketch1, limit1, ref_pt1, direction1, FeatureSigns.Negative, out body1);

 

            theSession.DisplayManager.HideByType(DisplayManager.ShowHideType.Curves, DisplayManager.ShowHideScope.AnyInAssembly);

 

        }

        /*---------------------------------------------------------------------------------------------------------------------------------*/

        void vint()

        {

            Tag squares1;

            string name1 = "gayka";

            int units1 = 1;

            theUfSession.Part.New(name1, units1, out squares1);

        }

        /*---------------------------------------------------------------------------------------------------------------------------------*/

        void gayka()

        {

            Tag squares1;

            string name1 = "gayka";

            int units1 = 1;

            theUfSession.Part.New(name1, units1, out squares1);

 

            double[] point_A1 = { 0.0, 0.0, 0.0 };

            double[] point_A2 = { 0.0, 15.0, 0.0 };

            double[] point_A3 = { -15.0, 15.0, 0.0 };

            double[] point_A4 = { -15.0, 0.0, 0.0 };

 

            double[] point_B1 = { 0.0, -18, 10.3923 };

            double[] point_B2 = { 0.0, 0.0, 20.7846 };

            double[] point_B3 = { 0.0, 18, 10.3923 };

            double[] point_B4 = { 0.0, 18, -10.3923 };

            double[] point_B5 = { 0.0, 0.0, -20.7846 };

            double[] point_B6 = { 0.0, -18, -10.3923 };

 

            double[] point_C1 = { -15.0, 18, 0.0 };

            double[] point_C2 = { -15.0, (18 + 5), 0.0 };

            double[] point_C3 = { -(15 - 3), (18 + 5), 0.0 };

 

            UFCurve.Line line_A1 = new UFCurve.Line();

            UFCurve.Line line_A2 = new UFCurve.Line();

            UFCurve.Line line_A3 = new UFCurve.Line();

            UFCurve.Line line_A4 = new UFCurve.Line();

 

            UFCurve.Line line_B1 = new UFCurve.Line();

            UFCurve.Line line_B2 = new UFCurve.Line();

            UFCurve.Line line_B3 = new UFCurve.Line();

            UFCurve.Line line_B4 = new UFCurve.Line();

            UFCurve.Line line_B5 = new UFCurve.Line();

            UFCurve.Line line_B6 = new UFCurve.Line();

 

            UFCurve.Line line_C1 = new UFCurve.Line();

            UFCurve.Line line_C2 = new UFCurve.Line();

            UFCurve.Line line_C3 = new UFCurve.Line();

 

            line_A1.start_point = new double[3];

            line_A1.end_point = new double[3];

            line_A2.start_point = new double[3];

            line_A2.end_point = new double[3];

            line_A3.start_point = new double[3];

            line_A3.end_point = new double[3];

            line_A4.start_point = new double[3];

            line_A4.end_point = new double[3];

 

            line_B1.start_point = new double[3];

            line_B1.end_point = new double[3];

            line_B2.start_point = new double[3];

            line_B2.end_point = new double[3];

            line_B3.start_point = new double[3];

            line_B3.end_point = new double[3];

            line_B4.start_point = new double[3];

            line_B4.end_point = new double[3];

            line_B5.start_point = new double[3];

            line_B5.end_point = new double[3];

            line_B6.start_point = new double[3];

            line_B6.end_point = new double[3];

 

            line_C1.start_point = new double[3];

            line_C1.end_point = new double[3];

            line_C2.start_point = new double[3];

            line_C2.end_point = new double[3];

            line_C3.start_point = new double[3];

            line_C3.end_point = new double[3];

 

            for (int i = 0; i < 3; i++)

            {

                line_A1.start_point[i] = point_A1[i];

                line_A1.end_point[i] = point_A2[i];

                line_A2.start_point[i] = point_A2[i];

                line_A2.end_point[i] = point_A3[i];

                line_A3.start_point[i] = point_A3[i];

                line_A3.end_point[i] = point_A4[i];

                line_A4.start_point[i] = point_A4[i];

                line_A4.end_point[i] = point_A1[i];

 

                line_B1.start_point[i] = point_B1[i];

                line_B1.end_point[i] = point_B2[i];

                line_B2.start_point[i] = point_B2[i];

                line_B2.end_point[i] = point_B3[i];

                line_B3.start_point[i] = point_B3[i];

                line_B3.end_point[i] = point_B4[i];

                line_B4.start_point[i] = point_B4[i];

                line_B4.end_point[i] = point_B5[i];

                line_B5.start_point[i] = point_B5[i];

                line_B5.end_point[i] = point_B6[i];

                line_B6.start_point[i] = point_B6[i];

                line_B6.end_point[i] = point_B1[i];

 

                line_C1.start_point[i] = point_C1[i];

                line_C1.end_point[i] = point_C2[i];

                line_C2.start_point[i] = point_C2[i];

                line_C2.end_point[i] = point_C3[i];

                line_C3.start_point[i] = point_C3[i];

                line_C3.end_point[i] = point_C1[i];

            }

 

            Tag[] sketch1 = new Tag[4];

            theUfSession.Curve.CreateLine(ref line_A1, out sketch1[0]);

            theUfSession.Curve.CreateLine(ref line_A2, out sketch1[1]);

            theUfSession.Curve.CreateLine(ref line_A3, out sketch1[2]);

            theUfSession.Curve.CreateLine(ref line_A4, out sketch1[3]);

 

            Tag[] sketch2 = new Tag[6];

            theUfSession.Curve.CreateLine(ref line_B1, out sketch2[0]);

            theUfSession.Curve.CreateLine(ref line_B2, out sketch2[1]);

            theUfSession.Curve.CreateLine(ref line_B3, out sketch2[2]);

            theUfSession.Curve.CreateLine(ref line_B4, out sketch2[3]);

            theUfSession.Curve.CreateLine(ref line_B5, out sketch2[4]);

            theUfSession.Curve.CreateLine(ref line_B6, out sketch2[5]);

 

            Tag[] sketch3 = new Tag[3];

            theUfSession.Curve.CreateLine(ref line_C1, out sketch3[0]);

            theUfSession.Curve.CreateLine(ref line_C2, out sketch3[1]);

            theUfSession.Curve.CreateLine(ref line_C3, out sketch3[2]);

 

            double[] ref_pt1 = new double[3];

            ref_pt1[0] = 0.00;

            ref_pt1[1] = 0.00;

            ref_pt1[2] = 0.00;

            double[] direction1 = { 1.00, 0.00, 0.00 };

            string[] limit1 = { "0", "360" };

Информация о работе Разработка прикладной библиотеки автоматизированного проектирования сборочной модели переходника