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

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

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

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

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

dip.doc

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

            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 bolt1()

        {

            Tag squares1;

            string name1 = "bolt1";

            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 = { 80.0, 15.0, 0.0 };

            double[] point_A4 = { 80.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;

            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 == 5)

                {

                    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 zaglush()

        {

            Tag squares1;

            string name1 = "zaglush";

            int units1 = 1;

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

 

            //круг1

            string taper_angle1 = "0.0";

            double[] arc1_centerpt1 = { 0, 0, 0 };

            double arc1_start_ang1 = 0.0;

            double arc1_end_ang1 = 3.14159265358979324 * 2;

            double arc1_rad1 = 70;

            double startheight1 = 0;

            double height1 = 20;

            double[] matrix1 = { 1, 0, 0, 0, 1, 0, 0, 0, -1 };

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

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

            FeatureSigns Nullsing = FeatureSigns.Nullsign;

            FeatureSigns Negative = FeatureSigns.Negative;

 

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad1,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Nullsing);

 

            double arc1_rad2 = 28;

            double startheight2 = 14;

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad2,

            startheight2, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double arc1_rad3 = 13.2;

            double[] arc1_centerpt3 = { 50, 0, 0 };

            round2(taper_angle1, arc1_centerpt3, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt4 = { -50, 0, 0 };

            round2(taper_angle1, arc1_centerpt4, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt5 = { 0, 50, 0 };

            round2(taper_angle1, arc1_centerpt5, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double[] arc1_centerpt6 = { 0, -50, 0 };

            round2(taper_angle1, arc1_centerpt6, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

        }

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

        void procladka_verh()

        {

            Tag squares1;

            string name1 = "procladka_verh";

            int units1 = 1;

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

 

            //круг1

            string taper_angle1 = "0.0";

            double[] arc1_centerpt1 = { 0, 0, 0 };

            double arc1_start_ang1 = 0.0;

            double arc1_end_ang1 = 3.14159265358979324 * 2;

            double arc1_rad1 = 68;

            double startheight1 = 0;

            double height1 = 10;

            double[] matrix1 = { 1, 0, 0, 0, 1, 0, 0, 0, -1 };

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

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

            FeatureSigns Nullsing = FeatureSigns.Nullsign;

            FeatureSigns Negative = FeatureSigns.Negative;

 

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad1,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Nullsing);

 

            double arc1_rad2 = 28;

 

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad2,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double arc1_rad3 = 13.2;

            double[] arc1_centerpt3 = { 50, 0, 0 };

            round2(taper_angle1, arc1_centerpt3, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt4 = { -50, 0, 0 };

            round2(taper_angle1, arc1_centerpt4, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt5 = { 0, 50, 0 };

            round2(taper_angle1, arc1_centerpt5, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double[] arc1_centerpt6 = { 0, -50, 0 };

            round2(taper_angle1, arc1_centerpt6, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

        }

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

        void osnovan_verh()

        {

            Tag squares1;

            string name1 = " osnovan_verh";

            int units1 = 1;

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

 

            //круг1

            string taper_angle1 = "0.0";

            double[] arc1_centerpt1 = { 0, 0, 0 };

            double arc1_start_ang1 = 0.0;

            double arc1_end_ang1 = 3.14159265358979324 * 2;

            double arc1_rad1 = 70;

            double startheight1 = 0;

            double height1 = 30;

            double[] matrix1 = { 1, 0, 0, 0, 1, 0, 0, 0, -1 };

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

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

            FeatureSigns Nullsing = FeatureSigns.Nullsign;

            FeatureSigns Negative = FeatureSigns.Negative;

 

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad1,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Nullsing);

 

 

 

 

            double arc1_rad2 = 30;

            double startheight2 = 10;

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad2,

            startheight2, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double arc1_rad3 = 13.2;

            double[] arc1_centerpt3 = { 50, 0, 0 };

            round2(taper_angle1, arc1_centerpt3, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt4 = { -50, 0, 0 };

            round2(taper_angle1, arc1_centerpt4, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

 

            double[] arc1_centerpt5 = { 0, 50, 0 };

            round2(taper_angle1, arc1_centerpt5, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double[] arc1_centerpt6 = { 0, -50, 0 };

            round2(taper_angle1, arc1_centerpt6, arc1_start_ang1, arc1_end_ang1, arc1_rad3,

            startheight1, height1, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

            double arc1_rad7 = 26;

            double startheight7 = 0;

            double height7 = 10;

 

            round2(taper_angle1, arc1_centerpt1, arc1_start_ang1, arc1_end_ang1, arc1_rad7,

  startheight7, height7, matrix1, ref_pt_extrude1, direction_extrude1, Negative);

 

        }

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

        void cylk(double length)

        {

           

            Tag squares1;

            string name1 = "cylk";

            int units1 = 1;

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

            //круг1

            string taper_angle1 = "0.0";

            double[] arc1_centerpt1 = { 0, 0, 0 };

            double arc1_start_ang1 = 0.0;

            double arc1_end_ang1 = 3.14159265358979324 * 2;

            double arc1_rad1 = 30;

            double startheight1 = 0;

            double height1 = length;

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