Beispiel #1
0
        //Hier beginnen RechteckProfile


        //RechteckVoll!
        //Erzeugen der Geometrie RechteckVoll
        internal void ErzeugeProfilRechteckVoll(RechteckVoll rechteckVoll)
        {
            hspB1_catia_Profil.set_Name("Rechteck_Voll");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();

            //Setzen der Punkte
            Point2D catPoint2D1 = factory2D.CreatePoint(-rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2);
            Point2D catPoint2D2 = factory2D.CreatePoint(rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2);
            Point2D catPoint2D3 = factory2D.CreatePoint(rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2);
            Point2D catPoint2D4 = factory2D.CreatePoint(-rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2);

            //Linie Horrizontal Oben
            Line2D catLine2D1 = factory2D.CreateLine(-rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2, rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            //Linie Vertikal Rechts
            Line2D catLine2D2 = factory2D.CreateLine(rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2, rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;


            //Linie Horizontal Unten
            Line2D catLine2D3 = factory2D.CreateLine(rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2, -rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            //Linie Vertikal Links
            Line2D catLine2D4 = factory2D.CreateLine(-rechteckVoll.Breite / 2, rechteckVoll.Höhe / 2, -rechteckVoll.Breite / 2, -rechteckVoll.Höhe / 2);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
Beispiel #2
0
        public void ErzeugeProfil(double breiterechteck, double hoeherechteck)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Rechteck");

            // Rechteck in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            // Rechteck erzeugen

            // erst die Punkte
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(-breiterechteck / 2, hoeherechteck / 2);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(breiterechteck / 2, hoeherechteck / 2);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(breiterechteck / 2, -hoeherechteck / 2);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(-breiterechteck / 2, -hoeherechteck / 2);

            // dann die Linien
            Line2D catLine2D1 = catFactory2D1.CreateLine(-breiterechteck / 2, hoeherechteck / 2, breiterechteck / 2, hoeherechteck / 2);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(breiterechteck / 2, hoeherechteck / 2, breiterechteck / 2, -hoeherechteck / 2);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(breiterechteck / 2, -hoeherechteck / 2, -breiterechteck / 2, -hoeherechteck / 2);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(-breiterechteck / 2, -hoeherechteck / 2, -breiterechteck / 2, hoeherechteck / 2);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
        public void ErzeugeProfil(Double b, Double h)
        {
            // Skizze umbenennen
            hsp_catiaSkizze.set_Name("Rechteck");

            // Rechteck in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaSkizze.OpenEdition();

            // Rechteck erzeugen

            // erst die Punkte
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(-50, 50);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(50, 50);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(50, -50);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(-50, -50);

            // dann die Linien
            Line2D catLine2D1 = catFactory2D1.CreateLine(-50, 50, 50, 50);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(50, 50, 50, -50);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(50, -50, -50, -50);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(-50, -50, -50, 50);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hsp_catiaSkizze.CloseEdition();
            // Part aktualisieren
            myPart.Update();
        }
        public void ErzeugeProfil(double breitedreieck, double hoehedreieck)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Dreieck");

            // Dreieck in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            // Dreieck erzeugen
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(0, hoehedreieck);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(0, hoehedreieck);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(breitedreieck / 2, 0);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(-breitedreieck / 2, 0);

            Line2D catLine2D1 = catFactory2D1.CreateLine(0, hoehedreieck, 0, hoehedreieck);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(0, Math.Sqrt(Math.Pow(hoehedreieck, 4)), breitedreieck / 2, 0);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(breitedreieck / 2, 0, -breitedreieck / 2, 0);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(-breitedreieck / 2, 0, 0, Math.Sqrt(Math.Pow(hoehedreieck, 4)));

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #5
0
            public void erstelleDreieck(double dHoehe, double dBreite)
            {
                // Skizze umbenennen
                hsp_catiaProfil.set_Name("Dreieck");

                // Rechteck in Skizze einzeichnen
                // Skizze oeffnen
                Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

                // Rechteck erzeugen

                // erst die Punkte
                Point2D catPoint2D1 = catFactory2D1.CreatePoint(dHoehe, 0);
                Point2D catPoint2D2 = catFactory2D1.CreatePoint(0, dBreite / 2);
                Point2D catPoint2D3 = catFactory2D1.CreatePoint(0, -dBreite / 2);


                // dann die Linien
                Line2D catLine2D1 = catFactory2D1.CreateLine(dHoehe, 0, 0, dBreite / 2);

                catLine2D1.StartPoint = catPoint2D1;
                catLine2D1.EndPoint   = catPoint2D2;

                Line2D catLine2D2 = catFactory2D1.CreateLine(0, dBreite / 2, 0, -dBreite / 2);

                catLine2D2.StartPoint = catPoint2D2;
                catLine2D2.EndPoint   = catPoint2D3;

                Line2D catLine2D3 = catFactory2D1.CreateLine(0, -dBreite / 2, dHoehe, 0);

                catLine2D3.StartPoint = catPoint2D3;
                catLine2D3.EndPoint   = catPoint2D1;



                // Skizzierer verlassen
                hsp_catiaProfil.CloseEdition();
                // Part aktualisieren
                hsp_catiaPart.Part.Update();
            }
Beispiel #6
0
        //create 2DLine------------------------------------------------------
        private void button4_Click(object sender, EventArgs e)
        {
            //object[] Crd1 = new object[2];
            //object[] Crd2 = new object[2];
            object[] CrdSt = new object[2];
            object[] CrdEn = new object[2];

            try
            {
                Point2D strP = lin.StartPoint;
                Point2D endP = lin.EndPoint;

                strP.GetCoordinates(CrdSt);
                endP.GetCoordinates(CrdEn);

                PartDocument prtDoc = (PartDocument)catia.ActiveDocument;

                GeometricElements geo2D = (GeometricElements)p1.Parent;
                Sketch            skt   = (Sketch)geo2D.Parent;
                Factory2D         fac   = skt.OpenEdition();

                Line2D lin2 = fac.CreateLine((double)CrdSt[0], (double)CrdSt[1], (double)arrCoord1[0], (double)arrCoord1[1]);
                lin2.StartPoint = strP;
                lin2.EndPoint   = p1;
                Line2D lin3 = fac.CreateLine((double)CrdEn[0], (double)CrdEn[1], (double)arrCoord1[0], (double)arrCoord1[1]);
                lin3.StartPoint = endP;
                lin3.EndPoint   = p1;
                Line2D lin4 = fac.CreateLine((double)arrCoord1[0], (double)arrCoord1[1], (double)arrCoord2[0], (double)arrCoord2[1]);
                lin4.StartPoint = p1;
                lin4.EndPoint   = p2;
                //Line2D lin2 = CreateLine(fac,strP,p1) ;

                skt.CloseEdition();
            }
            catch (Exception)
            {
                MessageBox.Show("선택한 정보가 없습니다.");
                return;
            }
        }
        public void ErzeugeProfil(double längequadrat)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Quadrat");

            // quadrat in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            // Quadrat erzeugen
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(-längequadrat / 2, längequadrat / 2);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(längequadrat / 2, längequadrat / 2);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(längequadrat / 2, -längequadrat / 2);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(-längequadrat / 2, -längequadrat / 2);

            Line2D catLine2D1 = catFactory2D1.CreateLine(-längequadrat / 2, längequadrat / 2, längequadrat / 2, längequadrat / 2);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(längequadrat / 2, längequadrat / 2, längequadrat / 2, -längequadrat / 2);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(längequadrat / 2, -längequadrat / 2, -längequadrat / 2, -längequadrat / 2);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(-längequadrat / 2, -längequadrat / 2, -längequadrat / 2, längequadrat / 2);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
        public void Rechteck_DrawSketch(double RechteckBreite, double RechteckHoehe)
        {
            double b = RechteckBreite;
            double h = RechteckHoehe;

            CATIA_Rechteck2D.set_Name("Rechteckprofil");

            Factory2D RechteckFactory = CATIA_Rechteck2D.OpenEdition();

            // Definition der Eckpunkte
            Point2D Rechteck_Eckpunkt1 = RechteckFactory.CreatePoint(0, 0);
            Point2D Rechteck_Eckpunkt2 = RechteckFactory.CreatePoint(b, 0);
            Point2D Rechteck_Eckpunkt3 = RechteckFactory.CreatePoint(b, h);
            Point2D Rechteck_Eckpunkt4 = RechteckFactory.CreatePoint(0, h);

            // Definition der Linien
            Line2D RechteckLinie1 = RechteckFactory.CreateLine(0, 0, b, 0);

            RechteckLinie1.StartPoint = Rechteck_Eckpunkt1;
            RechteckLinie1.EndPoint   = Rechteck_Eckpunkt2;

            Line2D RechteckLinie2 = RechteckFactory.CreateLine(b, 0, b, h);

            RechteckLinie2.StartPoint = Rechteck_Eckpunkt2;
            RechteckLinie2.EndPoint   = Rechteck_Eckpunkt3;

            Line2D RechteckLinie3 = RechteckFactory.CreateLine(b, h, 0, h);

            RechteckLinie3.StartPoint = Rechteck_Eckpunkt3;
            RechteckLinie3.EndPoint   = Rechteck_Eckpunkt4;

            Line2D RechteckLinie4 = RechteckFactory.CreateLine(0, 0, 0, h);

            RechteckLinie4.StartPoint = Rechteck_Eckpunkt1;
            RechteckLinie4.EndPoint   = Rechteck_Eckpunkt4;

            CATIA_Rechteck2D.CloseEdition();

            CATIA_RechteckPart.Part.Update();
        }
Beispiel #9
0
        public void ErzeugeProfil(object sender, RoutedEventArgs e)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Rechteck");

            // Rechteck in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();
            double hoeheRechteck = Convert.ToDouble(
            // Rechteck erzeugen
            Point2D catPoint2D1 = catFactory2D1.CreatePoint();
            Line2D catLine2D1 = catFactory2D1.CreateLine();
        }
Beispiel #10
0
        public void ErzeugeRechteckProfil(double b, double h)
        {
            b /= 2;
            h /= 2;
            catiaProfil.set_Name("Rechteck ");

            Factory2D catFactory2D = catiaProfil.OpenEdition();

            Point2D catP2D_1 = catFactory2D.CreatePoint(-b, h);
            Point2D catP2D_2 = catFactory2D.CreatePoint(b, h);
            Point2D catP2D_3 = catFactory2D.CreatePoint(b, -h);
            Point2D catP2D_4 = catFactory2D.CreatePoint(-b, -h);

            Line2D catL2D_1 = catFactory2D.CreateLine(-b, h, b, h);

            catL2D_1.StartPoint = catP2D_1;
            catL2D_1.EndPoint   = catP2D_2;

            Line2D catL2D_2 = catFactory2D.CreateLine(b, h, b, -h);

            catL2D_2.StartPoint = catP2D_2;
            catL2D_2.EndPoint   = catP2D_3;

            Line2D catL2D_3 = catFactory2D.CreateLine(b, -h, -b, -h);

            catL2D_3.StartPoint = catP2D_3;
            catL2D_3.EndPoint   = catP2D_4;

            Line2D catL2D_4 = catFactory2D.CreateLine(-b, -h, -b, h);

            catL2D_4.StartPoint = catP2D_4;
            catL2D_4.EndPoint   = catP2D_1;


            catiaProfil.CloseEdition();
            catiaPart.Part.Update();
        }
        public override void ErzeugeProfil(Double b, Double h, Double p, Double q)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("L-Profil");

            // Rechteck in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            // Rechteck erzeugen

            // erst die Punkte
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(0, 0);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(0, h);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(p, h);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(p, p);
            Point2D catPoint2D5 = catFactory2D1.CreatePoint(b, p);
            Point2D catPoint2D6 = catFactory2D1.CreatePoint(b, 0);

            // dann die Linien
            Line2D catLine2D1 = catFactory2D1.CreateLine(0, 0, 0, h);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(0, h, p, h);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(p, h, p, p);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(p, p, b, p);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D5;

            Line2D catLine2D5 = catFactory2D1.CreateLine(b, p, b, 0);

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;

            Line2D catLine2D6 = catFactory2D1.CreateLine(b, 0, 0, 0);

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D1;



            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #12
0
        public void ErzeugeLProfil(Double Hoehe, Double Breite, Double Wandstaerke)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("L-Profil");

            // U-Profil in Skizze einzeichnen
            // Skizze oeffnen
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            // U-Profil erzeugen

            // erst die Punkte
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(0, 0);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(Breite, 0);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(Breite, Wandstaerke);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(Wandstaerke, Wandstaerke);
            Point2D catPoint2D5 = catFactory2D1.CreatePoint(Wandstaerke, Hoehe);
            Point2D catPoint2D6 = catFactory2D1.CreatePoint(0, Hoehe);

            // dann die Linien
            Line2D catLine2D1 = catFactory2D1.CreateLine(0, 0, Breite, 0);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = catFactory2D1.CreateLine(Breite, 0, Breite, Wandstaerke);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(Breite, Wandstaerke, Wandstaerke, Wandstaerke);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(Wandstaerke, Wandstaerke, Wandstaerke, Hoehe);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D5;

            Line2D catLine2D5 = catFactory2D1.CreateLine(Wandstaerke, Hoehe, 0, Hoehe);

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;

            Line2D catLine2D6 = catFactory2D1.CreateLine(0, Hoehe, 0, 0);

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();

            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
        private static Line2D CreateLine(Factory2D fac, Point2D p1, Point2D p2)
        {
            object[] ob1 = new object[2];
            p1.GetCoordinates(ob1);

            object[] ob2 = new object[2];
            p1.GetCoordinates(ob2);

            Line2D line = fac.CreateLine((double)ob1[0], (double)ob1[1], (double)ob2[0], (double)ob2[1]);

            line.StartPoint = p1;
            line.EndPoint   = p2;

            return(line);
        }
        public static Line2D DrawLine(this Factory2D F, Vector Start, Point2D End)
        {
            Line2D L = F.CreateLine(Start, End.GetPos());

            if (LookupTable.ContainsKey(Start))
            {
                L.StartPoint = LookupTable[Start];
            }
            else
            {
                L.StartPoint = L.StartPoint;
                LookupTable.Add(Start, L.StartPoint);
            }
            L.EndPoint = End;
            return(L);
        }
Beispiel #15
0
        //Ende RundVoll

        //Sechseck
        //Erzeugen der Geometrie Sechseck
        internal void ErzeugeSechseckVoll(SechseckVoll neuSechseckVoll)
        {
            hspB1_catia_Profil.set_Name("Sechseck");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();

            //Setzen der Punkte
            Point2D catPoint2D1 = factory2D.CreatePoint(-neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));
            Point2D catPoint2D2 = factory2D.CreatePoint(neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));
            Point2D catPoint2D3 = factory2D.CreatePoint(neuSechseckVoll.Radius, 0);
            Point2D catPoint2D4 = factory2D.CreatePoint(neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));

            Point2D catPoint2D5 = factory2D.CreatePoint(-neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));
            Point2D catPoint2D6 = factory2D.CreatePoint(-neuSechseckVoll.Radius, 0);


            // Linien
            Line2D catLine2D1 = factory2D.CreateLine(-neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))), neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            Line2D catLine2D2 = factory2D.CreateLine(neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))), neuSechseckVoll.Radius, 0);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = factory2D.CreateLine(neuSechseckVoll.Radius, 0, neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = factory2D.CreateLine(neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))), -neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D5;

            Line2D catLine2D5 = factory2D.CreateLine(-neuSechseckVoll.Radius / 2, -Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))), -neuSechseckVoll.Radius, 0);

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;

            Line2D catLine2D6 = factory2D.CreateLine(-neuSechseckVoll.Radius, 0, -neuSechseckVoll.Radius / 2, Math.Sqrt(neuSechseckVoll.Radius * neuSechseckVoll.Radius - ((neuSechseckVoll.Radius / 2) * (neuSechseckVoll.Radius / 2))));

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D1;



            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
        public static Line2D DrawLine(this Factory2D F, Point2D Start, Vector End)
        {
            Line2D L = F.CreateLine(Start.GetPos(), End);

            L.StartPoint = Start;
            if (LookupTable.ContainsKey(End))
            {
                L.EndPoint = LookupTable[End];
            }
            else
            {
                L.EndPoint = L.EndPoint;
                LookupTable.Add(End, L.EndPoint);
            }
            return(L);
        }
Beispiel #17
0
            public void erstelleLprofilSkizze(double dL1, double dL2, double dL3, double dL4)
            {
                Factory2D fact2D = hsp_catiaProfil.OpenEdition();

                // Skizze umbenennen
                hsp_catiaProfil.set_Name("L-Profil");

                // Eckpunkte erstellen

                double dStartpunktx = 0;
                double dStartpunkty = 0;

                Point2D P1 = fact2D.CreatePoint(dStartpunktx, dStartpunkty);
                Point2D P2 = fact2D.CreatePoint(dStartpunktx, dL1);
                Point2D P3 = fact2D.CreatePoint(dL2 - dL4, dL1);
                Point2D P4 = fact2D.CreatePoint(dL2 - dL4, dL1 - dL3);
                Point2D P5 = fact2D.CreatePoint(dL2, dL1 - dL3);
                Point2D P6 = fact2D.CreatePoint(dL2, dStartpunkty);

                Line2D L1 = fact2D.CreateLine(dStartpunktx, dStartpunkty, dStartpunktx, dL1);
                Line2D L2 = fact2D.CreateLine(dStartpunktx, dL1, dL2 - dL4, dL1);
                Line2D L3 = fact2D.CreateLine(dL2 - dL4, dL1, dL2 - dL4, dL1 - dL3);
                Line2D L4 = fact2D.CreateLine(dL2 - dL4, dL1 - dL3, dL2, dL1 - dL3);
                Line2D L5 = fact2D.CreateLine(dL2, dL1 - dL3, dL2, dStartpunkty);
                Line2D L6 = fact2D.CreateLine(dL2, dStartpunkty, dStartpunktx, dStartpunkty);

                L1.StartPoint = P1;
                L1.EndPoint   = P2;

                L2.StartPoint = P2;
                L2.EndPoint   = P3;

                L3.StartPoint = P3;
                L3.EndPoint   = P4;

                L4.StartPoint = P4;
                L4.EndPoint   = P1;

                L5.StartPoint = P5;
                L5.EndPoint   = P6;

                L6.StartPoint = P6;
                L6.EndPoint   = P1;


                hsp_catiaProfil.CloseEdition();

                hsp_catiaPart.Part.Update();
            }
        public static Line2D DrawLine(this Factory2D F, Vector Start, Vector End)
        {
            Line2D L = F.CreateLine(Start, End);

            if (LookupTable.ContainsKey(Start))
            {
                L.StartPoint = LookupTable[Start];
            }
            else
            {
                L.StartPoint = L.StartPoint;
                LookupTable.Add(Start, L.StartPoint);
            }
            if (LookupTable.ContainsKey(End))
            {
                L.EndPoint = LookupTable[End];
            }
            else
            {
                L.EndPoint = L.EndPoint;
                LookupTable.Add(End, L.EndPoint);
            }
            return(L);
        }
        public void SonderT_DrawSketch(double SonderT_Breite, double SonderT_Hoehe, double Flanschbreite, double Stegbreite)
        {
            double b = SonderT_Breite;
            double h = SonderT_Hoehe;
            double f = Flanschbreite;
            double s = Stegbreite;

            double alpha = Math.Atan(0.02);

            double upperDelta = Math.Tan(alpha) * (b / 4);
            double lowerDelta = Math.Tan(alpha) * (h / 2);

            double delta = h - f + Math.Tan(alpha) * (b / 4);
            double phi   = (b / 2) - (s / 2) + (Math.Tan(alpha) * (h / 2));

            double x = (delta - Math.Tan((Math.PI / 2) - alpha) * phi) / (Math.Tan(alpha) - Math.Tan((Math.PI / 2) - alpha));
            double y = ((-1) * Math.Tan(alpha)) * x + delta;

            CATIA_SonderT_2D.set_Name("T-Profil");

            Factory2D SonderT_Factory = CATIA_SonderT_2D.OpenEdition();

            // Definition der Geometrie
            Point2D Konturpunkt1 = SonderT_Factory.CreatePoint(0, h);
            Point2D Konturpunkt2 = SonderT_Factory.CreatePoint(b, h);
            Point2D Konturpunkt3 = SonderT_Factory.CreatePoint(b, (h - f + upperDelta));
            Point2D Konturpunkt4 = SonderT_Factory.CreatePoint((b - x), y);
            Point2D Konturpunkt5 = SonderT_Factory.CreatePoint(((b / 2) + (s / 2) - (lowerDelta)), 0);
            Point2D Konturpunkt6 = SonderT_Factory.CreatePoint(((b / 2) - (s / 2) + (lowerDelta)), 0);
            Point2D Konturpunkt7 = SonderT_Factory.CreatePoint(x, y);
            Point2D Konturpunkt8 = SonderT_Factory.CreatePoint(0, (h - f + upperDelta));

            Line2D Linie12 = SonderT_Factory.CreateLine(0, h, b, h);

            Linie12.StartPoint = Konturpunkt1;
            Linie12.EndPoint   = Konturpunkt2;

            Line2D Linie23 = SonderT_Factory.CreateLine(b, h, b, (h - f + upperDelta));

            Linie23.StartPoint = Konturpunkt2;
            Linie23.EndPoint   = Konturpunkt3;

            Line2D Linie34 = SonderT_Factory.CreateLine(b, (h - f + upperDelta), (b - x), y);

            Linie34.StartPoint = Konturpunkt3;
            Linie34.EndPoint   = Konturpunkt4;

            Line2D Linie45 = SonderT_Factory.CreateLine((b - x), y, ((b / 2) + (s / 2) - (lowerDelta)), 0);

            Linie45.StartPoint = Konturpunkt4;
            Linie45.EndPoint   = Konturpunkt5;

            Line2D Linie56 = SonderT_Factory.CreateLine(((b / 2) + (s / 2) - (lowerDelta)), 0, ((b / 2) - (s / 2) + (lowerDelta)), 0);

            Linie56.StartPoint = Konturpunkt5;
            Linie56.EndPoint   = Konturpunkt6;

            Line2D Linie67 = SonderT_Factory.CreateLine(((b / 2) - (s / 2) + (lowerDelta)), 0, x, y);

            Linie67.StartPoint = Konturpunkt6;
            Linie67.EndPoint   = Konturpunkt7;

            Line2D Linie78 = SonderT_Factory.CreateLine(x, y, 0, (h - f + upperDelta));

            Linie78.StartPoint = Konturpunkt7;
            Linie78.EndPoint   = Konturpunkt8;

            Line2D Linie81 = SonderT_Factory.CreateLine(0, (h - f + upperDelta), 0, h);

            Linie81.StartPoint = Konturpunkt8;
            Linie81.EndPoint   = Konturpunkt1;

            CATIA_SonderT_2D.CloseEdition();

            CATIA_SonderT_Part.Part.Update();
        }
Beispiel #20
0
        internal void SechseckZeichnen(Schraube arr, Sketch skizze)
        {
            double schlüsselweite          = 0.5 * Convert.ToDouble(arr.schluesselbreite);
            double außenkreisSchraubenkopf = schlüsselweite / (Math.Sqrt(3) / 2);

            Factory2D catfactory2D = skizze.OpenEdition();

            Point2D point2D1 = catfactory2D.CreatePoint(0, 0);
            Point2D point2D2 = catfactory2D.CreatePoint(0, schlüsselweite);

            Circle2D circle2D1 = catfactory2D.CreateClosedCircle(0, 0, außenkreisSchraubenkopf);

            circle2D1.CenterPoint  = point2D1;
            circle2D1.Construction = true;

            Circle2D circle2D2 = catfactory2D.CreateClosedCircle(0, 0, schlüsselweite);

            circle2D2.CenterPoint  = point2D1;
            circle2D2.Construction = true;

            Point2D point2D3 = catfactory2D.CreatePoint(0.5 * außenkreisSchraubenkopf, schlüsselweite);
            Point2D point2D4 = catfactory2D.CreatePoint(-0.5 * außenkreisSchraubenkopf, schlüsselweite);
            Point2D point2D5 = catfactory2D.CreatePoint(-1 * außenkreisSchraubenkopf, 0);
            Point2D point2D6 = catfactory2D.CreatePoint(-0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite);
            Point2D point2D7 = catfactory2D.CreatePoint(0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite);
            Point2D point2D8 = catfactory2D.CreatePoint(außenkreisSchraubenkopf, -0);

            Line2D line2D3 = catfactory2D.CreateLine(0.5 * außenkreisSchraubenkopf, schlüsselweite, -0.5 * außenkreisSchraubenkopf, schlüsselweite);

            line2D3.StartPoint = point2D3;
            line2D3.EndPoint   = point2D4;

            Line2D line2D4 = catfactory2D.CreateLine(-0.5 * außenkreisSchraubenkopf, schlüsselweite, -1 * außenkreisSchraubenkopf, 0);

            line2D4.StartPoint = point2D4;
            line2D4.EndPoint   = point2D5;

            Line2D line2D5 = catfactory2D.CreateLine(-1 * außenkreisSchraubenkopf, 0, -0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite);

            line2D5.StartPoint = point2D5;
            line2D5.EndPoint   = point2D6;

            Line2D line2D6 = catfactory2D.CreateLine(-0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite, 0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite);

            line2D6.StartPoint = point2D6;
            line2D6.EndPoint   = point2D7;

            Line2D line2D7 = catfactory2D.CreateLine(0.5 * außenkreisSchraubenkopf, -1 * schlüsselweite, außenkreisSchraubenkopf, 0);

            line2D7.StartPoint = point2D7;
            line2D7.EndPoint   = point2D8;

            Line2D line2D8 = catfactory2D.CreateLine(außenkreisSchraubenkopf, 0, 0.5 * außenkreisSchraubenkopf, schlüsselweite);

            line2D8.StartPoint = point2D8;
            line2D8.EndPoint   = point2D3;

            Line2D line2D9 = catfactory2D.CreateLine(0, 0, 0, schlüsselweite);

            line2D9.Construction = true;
            line2D9.StartPoint   = point2D1;
            line2D9.EndPoint     = point2D2;
        }
Beispiel #21
0
        public void Stirnzahnrad(MainWindow.Außenverzahnung av)
        {
            //Profil Erstellen

            //Nullpunkt
            double x0 = 0;
            double y0 = 0;

            //Hilfsgrößen
            double Teilkreisradius   = av.d / 2;
            double Hilfskreisradius  = Teilkreisradius * 0.94;
            double Fußkreisradius    = Teilkreisradius - (1.25 * av.m);
            double Kopfkreisradius   = Teilkreisradius + av.m;
            double Verrundungsradius = 0.35 * av.m;

            double Alpha         = 2;
            double Alpharad      = Math.PI * Alpha / 180;
            double Beta          = 140 / av.z;
            double Betarad       = Math.PI * Beta / 180;
            double Gamma         = 90 - (Alpha - Beta);
            double Gammarad      = Math.PI * Gamma / 180;
            double Totalangel    = 360.0 / av.z;
            double Totalangelrad = Math.PI * Totalangel / 180;


            //Punkte
            //Kopfkreis
            double xKopfkreis = -Kopfkreisradius *Math.Sin(Alpharad);

            double yKopfkreis = Kopfkreisradius * Math.Cos(Alpharad);

            //Fußkreis
            double xFußkreis = -Fußkreisradius *Math.Sin(Betarad);

            double yFußkreis = Fußkreisradius * Math.Cos(Betarad);

            //Koordinaten Anfangspunkt Fußkreis
            double Hilfswinkel            = Totalangelrad - Math.Atan(Math.Abs(xFußkreis) / Math.Abs(yFußkreis));
            double x_AnfangspunktFußkreis = Fußkreisradius * Math.Sin(Hilfswinkel);
            double y_AnfangspunktFußkreis = Fußkreisradius * Math.Cos(Hilfswinkel);

            //Skizze umbenennen und öffnen
            hsp_catiaProfil.set_Name("Zahnradskizze");
            Factory2D catfactory2D1 = hsp_catiaProfil.OpenEdition();

            //Nun die Punkte in die Skizze
            Point2D point_Ursprung          = catfactory2D1.CreatePoint(x0, y0);
            Point2D point_KopfkreisLinks    = catfactory2D1.CreatePoint(xKopfkreis, yKopfkreis);
            Point2D point_FußkreisLinks     = catfactory2D1.CreatePoint(xFußkreis, yFußkreis);
            Point2D point_KopfkreisRechts   = catfactory2D1.CreatePoint(-xKopfkreis, yKopfkreis);
            Point2D point_FußkreisRechts    = catfactory2D1.CreatePoint(-xFußkreis, yFußkreis);
            Point2D point_AnfangspunktLinks = catfactory2D1.CreatePoint(-x_AnfangspunktFußkreis, y_AnfangspunktFußkreis);

            //Linien
            Line2D line_FußkreisKopfkreis = catfactory2D1.CreateLine(xFußkreis, yFußkreis, xKopfkreis, yKopfkreis);

            line_FußkreisKopfkreis.StartPoint = point_FußkreisLinks;
            line_FußkreisKopfkreis.EndPoint   = point_KopfkreisLinks;

            Line2D line_KopfkreisFußkreis = catfactory2D1.CreateLine(-xKopfkreis, yKopfkreis, -xFußkreis, yFußkreis);

            line_KopfkreisFußkreis.StartPoint = point_KopfkreisRechts;
            line_KopfkreisFußkreis.EndPoint   = point_FußkreisRechts;


            //Kreise
            Circle2D circle_KopfkreisLinksRechts = catfactory2D1.CreateCircle(x0, y0, Kopfkreisradius, 0, Math.PI * 2);

            circle_KopfkreisLinksRechts.CenterPoint = point_Ursprung;
            circle_KopfkreisLinksRechts.EndPoint    = point_KopfkreisLinks;
            circle_KopfkreisLinksRechts.StartPoint  = point_KopfkreisRechts;

            Circle2D circle_AnfangFußkreis = catfactory2D1.CreateCircle(x0, x0, Fußkreisradius, 0, Math.PI * 2);

            circle_AnfangFußkreis.CenterPoint = point_Ursprung;
            circle_AnfangFußkreis.EndPoint    = point_AnfangspunktLinks;
            circle_AnfangFußkreis.StartPoint  = point_FußkreisLinks;

            hsp_catiaProfil.CloseEdition();

            hsp_catiaPart.Part.Update();


            //Profilerstellen Ende

            //Kreismuster

            ShapeFactory       SF  = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;
            HybridShapeFactory HSF = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;
            Part myPart            = hsp_catiaPart.Part;

            Factory2D             Factory2D2  = hsp_catiaProfil.Factory2D;
            HybridShapePointCoord Ursprung    = HSF.AddNewPointCoord(0, 0, 0);
            Reference             RefUrsprung = myPart.CreateReferenceFromObject(Ursprung);
            HybridShapeDirection  XDir        = HSF.AddNewDirectionByCoord(1, 0, 0);
            Reference             RefXDir     = myPart.CreateReferenceFromObject(XDir);

            CircPattern Kreismuster = SF.AddNewSurfacicCircPattern(Factory2D2, 1, 2, 0, 0, 1, 1, RefUrsprung, RefXDir, false, 0, true, false);

            Kreismuster.CircularPatternParameters = CatCircularPatternParameters.catInstancesandAngularSpacing;
            AngularRepartition angularRepartition1 = Kreismuster.AngularRepartition;
            Angle angle1 = angularRepartition1.AngularSpacing;

            angle1.Value = Convert.ToDouble(360 / Convert.ToDouble(av.z));
            AngularRepartition angularRepartition2 = Kreismuster.AngularRepartition;
            IntParam           intParam1           = angularRepartition2.InstancesCount;

            intParam1.Value = Convert.ToInt32(av.z) + 1;

            Reference           Ref_Kreismuster = myPart.CreateReferenceFromObject(Kreismuster);
            HybridShapeAssemble Verbindung      = HSF.AddNewJoin(Ref_Kreismuster, Ref_Kreismuster);
            Reference           Ref_Verbindung  = myPart.CreateReferenceFromObject(Verbindung);

            HSF.GSMVisibility(Ref_Verbindung, 0);
            myPart.Update();
            Bodies bodies = myPart.Bodies;
            Body   myBody = bodies.Add();

            myBody.set_Name("Zahnrad");
            myBody.InsertHybridShape(Verbindung);
            myPart.Update();

            myPart.InWorkObject = myBody;
            Pad myPad = SF.AddNewPadFromRef(Ref_Verbindung, av.t);

            myPart.Update();


            //Bohrung
            Reference RefBohrung1       = hsp_catiaPart.Part.CreateReferenceFromBRepName("FSur:(Face:(Brp:(Pad.1;2);None:();Cf11:());WithTemporaryBody;WithoutBuildError;WithInitialFeatureSupport;MonoFond;MFBRepVersion_CXR15)", myPad);
            Hole      catBohrung1       = SF.AddNewHoleFromPoint(0, 0, 0, RefBohrung1, 0);
            Length    catLengthBohrung1 = catBohrung1.Diameter;

            catLengthBohrung1.Value = Convert.ToDouble(av.d / 2);

            hsp_catiaPart.Part.Update();
        }
Beispiel #22
0
        public void SonderU_DrawSketch(double SonderU_Breite, double SonderU_Hoehe, double Flanschbreite, double Stegbreite)
        {
            double b = SonderU_Breite;
            double h = SonderU_Hoehe;
            double f = Flanschbreite;
            double s = Stegbreite;

            double c;   // Hilfsmaß zur Bemaßung am abgeschrägten Flansch
            double alpha;

            if (h <= 300)
            {
                c = 0.5 * b;
            }
            else
            {
                c = 0.5 * (b - s);
            }

            if (h > 300)
            {
                alpha = Math.Atan(0.05);
            }
            else
            {
                alpha = Math.Atan(0.08);
            }

            double outerDelta = Math.Tan(alpha) * c;    // Berechnung des Versatzmaßes der Schrägenkonturpunkte
            double innerDelta = Math.Tan(alpha) * (b - c - s);

            CATIA_SonderU_2D.set_Name("U-Profil");

            Factory2D SonderU_Factory = CATIA_SonderU_2D.OpenEdition();

            // Definition der Geometrie
            Point2D Konturpunkt1 = SonderU_Factory.CreatePoint(0, 0);
            Point2D Konturpunkt2 = SonderU_Factory.CreatePoint(b, 0);
            Point2D Konturpunkt3 = SonderU_Factory.CreatePoint(b, (f - outerDelta));
            Point2D Konturpunkt4 = SonderU_Factory.CreatePoint(s, (f + innerDelta));
            Point2D Konturpunkt5 = SonderU_Factory.CreatePoint(s, (h - f - innerDelta));
            Point2D Konturpunkt6 = SonderU_Factory.CreatePoint(b, (h - f + outerDelta));
            Point2D Konturpunkt7 = SonderU_Factory.CreatePoint(b, h);
            Point2D Konturpunkt8 = SonderU_Factory.CreatePoint(0, h);

            Line2D Linie12 = SonderU_Factory.CreateLine(0, 0, b, 0);

            Linie12.StartPoint = Konturpunkt1;
            Linie12.EndPoint   = Konturpunkt2;

            Line2D Linie23 = SonderU_Factory.CreateLine(b, 0, b, (f - outerDelta));

            Linie23.StartPoint = Konturpunkt2;
            Linie23.EndPoint   = Konturpunkt3;

            Line2D Linie34 = SonderU_Factory.CreateLine(b, (f - outerDelta), s, (f + innerDelta));

            Linie34.StartPoint = Konturpunkt3;
            Linie34.EndPoint   = Konturpunkt4;

            Line2D Linie45 = SonderU_Factory.CreateLine(s, (f + innerDelta), s, (h - f - innerDelta));

            Linie45.StartPoint = Konturpunkt4;
            Linie45.EndPoint   = Konturpunkt5;

            Line2D Linie56 = SonderU_Factory.CreateLine(s, (h - f - innerDelta), b, (h - f + outerDelta));

            Linie56.StartPoint = Konturpunkt5;
            Linie56.EndPoint   = Konturpunkt6;

            Line2D Linie67 = SonderU_Factory.CreateLine(b, (h - f + outerDelta), b, h);

            Linie67.StartPoint = Konturpunkt6;
            Linie67.EndPoint   = Konturpunkt7;

            Line2D Linie78 = SonderU_Factory.CreateLine(b, h, 0, h);

            Linie78.StartPoint = Konturpunkt7;
            Linie78.EndPoint   = Konturpunkt8;

            Line2D Linie81 = SonderU_Factory.CreateLine(0, h, 0, 0);

            Linie81.StartPoint = Konturpunkt8;
            Linie81.EndPoint   = Konturpunkt1;

            CATIA_SonderU_2D.CloseEdition();

            CATIA_SonderU_Part.Part.Update();
        }
        public void SonderIPE_DrawSketch(double SonderIPE_Breite, double SonderIPE_Hoehe, double Flanschbreite, double Stegbreite)
        {
            double b  = SonderIPE_Breite;
            double h  = SonderIPE_Hoehe;
            double f  = Flanschbreite;
            double s  = Stegbreite;
            double R  = 2 * s;  // Definition des Eckenradius nach DIN 1025-2 und DIN 1025-5
            double bs = (b - s) / 2;

            CATIA_SonderIPE_2D.set_Name("I-Profil");

            Factory2D SonderIPE_Factory = CATIA_SonderIPE_2D.OpenEdition();

            // Definition der Geometrie

            // Definition der Radienmittelpunkte
            Point2D Mittelpunkt1 = SonderIPE_Factory.CreatePoint((bs - R), (f + R));
            Point2D Mittelpunkt2 = SonderIPE_Factory.CreatePoint((bs + s + R), (f + R));
            Point2D Mittelpunkt3 = SonderIPE_Factory.CreatePoint((bs + s + R), (h - f - R));
            Point2D Mittelpunkt4 = SonderIPE_Factory.CreatePoint((bs - R), (h - f - R));

            // Definition der Konturpunkte
            Point2D Konturpunkt1  = SonderIPE_Factory.CreatePoint(0, 0);
            Point2D Konturpunkt2  = SonderIPE_Factory.CreatePoint(b, 0);
            Point2D Konturpunkt3  = SonderIPE_Factory.CreatePoint(b, f);
            Point2D Konturpunkt4  = SonderIPE_Factory.CreatePoint((bs + s + R), f);
            Point2D Konturpunkt5  = SonderIPE_Factory.CreatePoint((bs + s), (f + R));
            Point2D Konturpunkt6  = SonderIPE_Factory.CreatePoint((bs + s), (h - f - R));
            Point2D Konturpunkt7  = SonderIPE_Factory.CreatePoint((bs + s + R), (h - f));
            Point2D Konturpunkt8  = SonderIPE_Factory.CreatePoint(b, (h - f));
            Point2D Konturpunkt9  = SonderIPE_Factory.CreatePoint(b, h);
            Point2D Konturpunkt10 = SonderIPE_Factory.CreatePoint(0, h);
            Point2D Konturpunkt11 = SonderIPE_Factory.CreatePoint(0, (h - f));
            Point2D Konturpunkt12 = SonderIPE_Factory.CreatePoint((bs - R), (h - f));
            Point2D Konturpunkt13 = SonderIPE_Factory.CreatePoint(bs, (h - f - R));
            Point2D Konturpunkt14 = SonderIPE_Factory.CreatePoint(bs, (f + R));
            Point2D Konturpunkt15 = SonderIPE_Factory.CreatePoint((bs - R), f);
            Point2D Konturpunkt16 = SonderIPE_Factory.CreatePoint(0, f);

            // Defintion der Linien
            Line2D Linie12 = SonderIPE_Factory.CreateLine(0, 0, b, 0);

            Linie12.StartPoint = Konturpunkt1;
            Linie12.EndPoint   = Konturpunkt2;

            Line2D Linie23 = SonderIPE_Factory.CreateLine(b, 0, b, f);

            Linie23.StartPoint = Konturpunkt2;
            Linie23.EndPoint   = Konturpunkt3;

            Line2D Linie34 = SonderIPE_Factory.CreateLine(b, f, (bs + s + R), f);

            Linie34.StartPoint = Konturpunkt3;
            Linie34.EndPoint   = Konturpunkt4;

            Line2D Linie56 = SonderIPE_Factory.CreateLine((bs + s), (f + R), (bs + s), (h - f - R));

            Linie56.StartPoint = Konturpunkt5;
            Linie56.EndPoint   = Konturpunkt6;

            Line2D Linie78 = SonderIPE_Factory.CreateLine((bs + s + R), (h - f), b, (h - f));

            Linie78.StartPoint = Konturpunkt7;
            Linie78.EndPoint   = Konturpunkt8;

            Line2D Linie89 = SonderIPE_Factory.CreateLine(b, (h - f), b, h);

            Linie89.StartPoint = Konturpunkt8;
            Linie89.EndPoint   = Konturpunkt9;

            Line2D Linie910 = SonderIPE_Factory.CreateLine(b, h, 0, h);

            Linie910.StartPoint = Konturpunkt9;
            Linie910.EndPoint   = Konturpunkt10;

            Line2D Linie1011 = SonderIPE_Factory.CreateLine(0, h, 0, (h - f));

            Linie1011.StartPoint = Konturpunkt10;
            Linie1011.EndPoint   = Konturpunkt11;

            Line2D Linie1112 = SonderIPE_Factory.CreateLine(0, (h - f), (bs - R), (h - f));

            Linie1112.StartPoint = Konturpunkt11;
            Linie1112.EndPoint   = Konturpunkt12;

            Line2D Linie1314 = SonderIPE_Factory.CreateLine(bs, (h - f - R), bs, (f + R));

            Linie1314.StartPoint = Konturpunkt13;
            Linie1314.EndPoint   = Konturpunkt14;

            Line2D Linie1516 = SonderIPE_Factory.CreateLine((bs - R), f, 0, f);

            Linie1516.StartPoint = Konturpunkt15;
            Linie1516.EndPoint   = Konturpunkt16;

            Line2D Linie161 = SonderIPE_Factory.CreateLine(0, f, 0, 0);

            Linie161.StartPoint = Konturpunkt16;
            Linie161.EndPoint   = Konturpunkt1;

            // Definition der Eckenverrundungen
            Circle2D Eckenverrundung1 = SonderIPE_Factory.CreateCircle((bs - R), (f + R), R, 0, 0);

            Eckenverrundung1.CenterPoint = Mittelpunkt1;
            Eckenverrundung1.StartPoint  = Konturpunkt15;
            Eckenverrundung1.EndPoint    = Konturpunkt14;

            Circle2D Eckenverrundung2 = SonderIPE_Factory.CreateCircle((bs + s + R), (f + R), R, 0, 0);

            Eckenverrundung2.CenterPoint = Mittelpunkt2;
            Eckenverrundung2.StartPoint  = Konturpunkt5;
            Eckenverrundung2.EndPoint    = Konturpunkt4;

            Circle2D Eckenverrundung3 = SonderIPE_Factory.CreateCircle((bs + s + R), (h - f - R), R, 0, 0);

            Eckenverrundung3.CenterPoint = Mittelpunkt3;
            Eckenverrundung3.StartPoint  = Konturpunkt7;
            Eckenverrundung3.EndPoint    = Konturpunkt6;

            Circle2D Eckenverrundung4 = SonderIPE_Factory.CreateCircle((bs - R), (h - f - R), R, 0, 0);

            Eckenverrundung4.CenterPoint = Mittelpunkt4;
            Eckenverrundung4.StartPoint  = Konturpunkt13;
            Eckenverrundung4.EndPoint    = Konturpunkt12;

            CATIA_SonderIPE_2D.CloseEdition();

            CATIA_SonderIPE_Part.Part.Update();
        }
Beispiel #24
0
        //Ende TProfiiiiiiiiiiiiiiiiiiiiiiil

        //L Profiiil
        //Erzeugen der Geometrie L Profil
        internal void ErzeugeLProfil(LProfil neuLProfil)
        {
            hspB1_catia_Profil.set_Name("L_Profil");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();

            //Setzen der Punkte
            Point2D catPoint2D1 = factory2D.CreatePoint(-neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2);
            Point2D catPoint2D2 = factory2D.CreatePoint(neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2);
            Point2D catPoint2D3 = factory2D.CreatePoint(neuLProfil.B2 / 2, neuLProfil.H2 / 2);
            Point2D catPoint2D4 = factory2D.CreatePoint(neuLProfil.B1 - neuLProfil.B2 / 2, neuLProfil.H2 / 2);

            Point2D catPoint2D5 = factory2D.CreatePoint(neuLProfil.B1 - neuLProfil.B2 / 2, -neuLProfil.H2 / 2);
            Point2D catPoint2D6 = factory2D.CreatePoint(-neuLProfil.B2 / 2, -neuLProfil.H2 / 2);


            //       _
            //      | |_     Linie fehlt= skizierte Linie
            //      |___|
            //
            //      | |_
            //      |___|

            Line2D catLine2D1 = factory2D.CreateLine(-neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2, neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;


            //       _
            //      |  _
            //      |___|
            Line2D catLine2D2 = factory2D.CreateLine(neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2, neuLProfil.B2 / 2, neuLProfil.H2 / 2);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            //       _
            //      | |
            //      |___|

            Line2D catLine2D3 = factory2D.CreateLine(neuLProfil.B2 / 2, neuLProfil.H2 / 2, neuLProfil.B1 - neuLProfil.B2 / 2, neuLProfil.H2 / 2);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;
            //       _
            //      | |_
            //      |___

            Line2D catLine2D4 = factory2D.CreateLine(neuLProfil.B1 - neuLProfil.B2 / 2, neuLProfil.H2 / 2, neuLProfil.B1 - neuLProfil.B2 / 2, -neuLProfil.H2 / 2);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D5;


            //       _
            //      | |_
            //      |   |
            Line2D catLine2D5 = factory2D.CreateLine(neuLProfil.B1 + neuLProfil.B2, -neuLProfil.H2 / 2, -neuLProfil.B2 / 2, -neuLProfil.H2 / 2);

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;

            //       _
            //        |_
            //       ___|
            Line2D catLine2D6 = factory2D.CreateLine(-neuLProfil.B2 / 2, -neuLProfil.H2 / 2, -neuLProfil.B2 / 2, neuLProfil.H1 - neuLProfil.H2 / 2);

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D1;



            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
Beispiel #25
0
        static void Logo(Factory2D F, float X, float Y, float Height, float Fatness)
        {
            const double AngleOffset = 0.09;

            Ellipse2D LeftUpper = F.CreateEllipse(X, Y - Fatness / 2 + Height,
                0, 0, Height / 2, Height, -3 * Math.PI / 2, -Math.PI / 2);

            Ellipse2D RightUpperUpper = F.CreateEllipse(X, Y - Fatness / 2 + Height,
                0, 0, Height / 2 - Fatness, Height - Fatness, Math.PI / 2, Math.PI - AngleOffset);

            Ellipse2D RightUpperLower = F.CreateEllipse(X, Y - Fatness / 2 + Height,
                0, 0, Height / 2 - Fatness, Height - Fatness, Math.PI + AngleOffset, 3 * Math.PI / 2);

            Ellipse2D LeftLower = F.CreateEllipse(X, Y + Fatness / 2 - Height,
                0, 0, Height / 2 - Fatness, Height - Fatness, 3 * Math.PI / 2, Math.PI / 2);
            Ellipse2D RightLower = F.CreateEllipse(X, Y + Fatness / 2 - Height,
                0, 0, Height / 2, Height, 3 * Math.PI / 2, Math.PI / 2);

            LeftUpper.EndPoint = LeftLower.EndPoint;
            RightUpperLower.EndPoint = RightLower.EndPoint;

            Circle2D UpperCircle = F.CreateCircle(X, (Y + Height * 2) - Fatness, Fatness / 2, -Math.PI / 2, Math.PI / 2);
            UpperCircle.EndPoint = LeftUpper.StartPoint;
            UpperCircle.StartPoint = RightUpperUpper.StartPoint;

            Circle2D LowerCircle = F.CreateCircle(X, (Y - Height * 2) + Fatness, Fatness / 2, Math.PI / 2, -Math.PI / 2);
            LowerCircle.StartPoint = LeftLower.StartPoint;
            LowerCircle.EndPoint = RightLower.StartPoint;

            Point2D BarLowerStart = RightUpperLower.StartPoint;
            Line2D BarLower = F.CreateLine(BarLowerStart.GetPos().X, BarLowerStart.GetPos().Y,
                BarLowerStart.GetPos().X + Height / 2, BarLowerStart.GetPos().Y);
            BarLower.StartPoint = BarLowerStart;

            Point2D BarUpperStart = RightUpperUpper.EndPoint;
            Line2D BarUpper = F.CreateLine(BarUpperStart.GetPos().X, BarUpperStart.GetPos().Y,
                BarUpperStart.GetPos().X + Height / 2, BarUpperStart.GetPos().Y);
            BarUpper.StartPoint = BarUpperStart;

            double UpperX = BarUpper.EndPoint.GetPos().X;
            double UpperY = BarUpper.EndPoint.GetPos().Y;
            double LowerY = BarLower.EndPoint.GetPos().Y;
            double R = (UpperY - LowerY) / 2;
            Circle2D BarCircle = F.CreateCircle(UpperX, LowerY + R, R, -Math.PI / 2, Math.PI / 2);
            BarCircle.EndPoint = BarUpper.EndPoint;
            BarCircle.StartPoint = BarLower.EndPoint;
        }
Beispiel #26
0
        //Ende UProfil

        //IProfil!
        //Erzeugen der Geometrie I Profil
        internal void ErzeugeIProfil(IProfil neuIProfil)
        {
            hspB1_catia_Profil.set_Name("I_Profil");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();

            //Setzen der Punkte
            Point2D catPoint2D1 = factory2D.CreatePoint(-neuIProfil.B1 / 2, neuIProfil.H1 / 2);
            Point2D catPoint2D2 = factory2D.CreatePoint(neuIProfil.B1 / 2, neuIProfil.H1 / 2);
            Point2D catPoint2D3 = factory2D.CreatePoint(neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);
            Point2D catPoint2D4 = factory2D.CreatePoint(neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            Point2D catPoint2D5 = factory2D.CreatePoint(neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));
            Point2D catPoint2D6 = factory2D.CreatePoint(neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));
            Point2D catPoint2D7 = factory2D.CreatePoint(neuIProfil.B1 / 2, -neuIProfil.H1 / 2);
            Point2D catPoint2D8 = factory2D.CreatePoint(-neuIProfil.B1 / 2, -neuIProfil.H1 / 2);

            Point2D catPoint2D9  = factory2D.CreatePoint(-neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));
            Point2D catPoint2D10 = factory2D.CreatePoint(-neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));
            Point2D catPoint2D11 = factory2D.CreatePoint(-neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);
            Point2D catPoint2D12 = factory2D.CreatePoint(-neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            //       _____
            //      |_   _| Linie fehlt= skizierte Linie
            //       _| |_
            //      |_____|

            //
            //      |_   _|
            //       _| |_
            //      |_____|
            Line2D catLine2D1 = factory2D.CreateLine(-neuIProfil.B1 / 2, neuIProfil.H1 / 2, neuIProfil.B1 / 2, neuIProfil.H1 / 2);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D2;

            //       _____
            //      |_   _
            //       _| |_
            //      |_____|
            Line2D catLine2D2 = factory2D.CreateLine(neuIProfil.B1 / 2, neuIProfil.H1 / 2, neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;


            //       _____
            //      |_    |
            //       _| |_
            //      |_____|
            Line2D catLine2D3 = factory2D.CreateLine(neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2, neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            //       _____
            //      |_   _|
            //       _|  _
            //      |_____|
            Line2D catLine2D4 = factory2D.CreateLine(neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2, neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D5;

            //       _____
            //      |_   _|
            //       _| |
            //      |_____|
            Line2D catLine2D5 = factory2D.CreateLine(neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2), neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;
            //       _____
            //      |_   _|
            //       _| |_
            //      |_____
            Line2D catLine2D6 = factory2D.CreateLine(neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2), neuIProfil.B1 / 2, -neuIProfil.H1 / 2);

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D7;
            //       _____
            //      |_   _|
            //       _| |_
            //      |     |
            Line2D catLine2D7 = factory2D.CreateLine(neuIProfil.B1 / 2, -neuIProfil.H1 / 2, -neuIProfil.B1 / 2, -neuIProfil.H1 / 2);

            catLine2D7.StartPoint = catPoint2D7;
            catLine2D7.EndPoint   = catPoint2D8;
            //       _____
            //      |_   _|
            //       _| |_
            //       _____|
            Line2D catLine2D8 = factory2D.CreateLine(-neuIProfil.B1 / 2, -neuIProfil.H1 / 2, -neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));

            catLine2D8.StartPoint = catPoint2D8;
            catLine2D8.EndPoint   = catPoint2D9;

            //       _____
            //      |_   _|
            //        | |_
            //      |_____|
            Line2D catLine2D9 = factory2D.CreateLine(-neuIProfil.B1 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2), -neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2));

            catLine2D9.StartPoint = catPoint2D9;
            catLine2D9.EndPoint   = catPoint2D10;
            //       _____
            //      |_   _|
            //       _  |_
            //      |_____|
            Line2D catLine2D10 = factory2D.CreateLine(-neuIProfil.B2 / 2, -(neuIProfil.H1 / 2 - neuIProfil.H2), -neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            catLine2D10.StartPoint = catPoint2D10;
            catLine2D10.EndPoint   = catPoint2D11;
            //       _____
            //      |    _|
            //       _| |_
            //      |_____|
            Line2D catLine2D11 = factory2D.CreateLine(-neuIProfil.B2 / 2, neuIProfil.H1 / 2 - neuIProfil.H2, -neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2);

            catLine2D11.StartPoint = catPoint2D11;
            catLine2D11.EndPoint   = catPoint2D12;
            //       _____
            //       _   _|
            //       _| |_
            //      |_____|
            Line2D catLine2D12 = factory2D.CreateLine(-neuIProfil.B1 / 2, neuIProfil.H1 / 2 - neuIProfil.H2, -neuIProfil.B1 / 2, neuIProfil.H1 / 2);

            catLine2D12.StartPoint = catPoint2D12;
            catLine2D12.EndPoint   = catPoint2D1;

            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
Beispiel #27
0
        public void ErzeugeVierkantrohr(Double r_ah, Double r_ih, Double r_ab, Double r_ib)
        {
            hsp_catiaProfil.set_Name("VierkantRohr");
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            Point2D catPoint2D1 = catFactory2D1.CreatePoint(r_ab - r_ib, r_ah);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(r_ab, r_ah + r_ib - r_ab);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(r_ab, 0);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(0, 0);

            Point2D catPoint2D5 = catFactory2D1.CreatePoint((r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2);
            Point2D catPoint2D6 = catFactory2D1.CreatePoint(r_ib + (r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2);
            Point2D catPoint2D7 = catFactory2D1.CreatePoint(r_ib + (r_ab - r_ib) / 2, (r_ah - r_ih) / 2);
            Point2D catPoint2D8 = catFactory2D1.CreatePoint((r_ab - r_ib) / 2, (r_ah - r_ih) / 2);

            Point2D catPoint2D9  = catFactory2D1.CreatePoint(0, r_ah + r_ib - r_ab);
            Point2D catPoint2D10 = catFactory2D1.CreatePoint(r_ab - r_ib, r_ah - (r_ab - r_ib));

            Point2D catPoint2D11 = catFactory2D1.CreatePoint(r_ib, r_ah);
            Point2D catPoint2D12 = catFactory2D1.CreatePoint(r_ib, r_ah + r_ib - r_ab);

            Circle2D catCircle2D1 = catFactory2D1.CreateCircle(r_ab - r_ib, r_ah - (r_ab - r_ib), r_ab - r_ib, r_ab - r_ib, r_ab - r_ib);

            catCircle2D1.CenterPoint = catPoint2D10;
            catCircle2D1.StartPoint  = catPoint2D1;
            catCircle2D1.EndPoint    = catPoint2D9;

            Circle2D catCircle2D2 = catFactory2D1.CreateCircle(r_ib, r_ah + r_ib - r_ab, r_ab - r_ib, r_ab - r_ib, r_ab - r_ib);

            catCircle2D2.CenterPoint = catPoint2D12;
            catCircle2D2.StartPoint  = catPoint2D2;
            catCircle2D2.EndPoint    = catPoint2D11;

            Line2D catLine2D1 = catFactory2D1.CreateLine(r_ab - r_ib, r_ah, r_ib, r_ah);

            catLine2D1.StartPoint = catPoint2D1;
            catLine2D1.EndPoint   = catPoint2D11;

            Line2D catLine2D2 = catFactory2D1.CreateLine(r_ab, r_ah + r_ab - r_ib, r_ab, 0);

            catLine2D2.StartPoint = catPoint2D2;
            catLine2D2.EndPoint   = catPoint2D3;

            Line2D catLine2D3 = catFactory2D1.CreateLine(r_ab, 0, 0, 0);

            catLine2D3.StartPoint = catPoint2D3;
            catLine2D3.EndPoint   = catPoint2D4;

            Line2D catLine2D4 = catFactory2D1.CreateLine(0, 0, 0, r_ah + r_ib - r_ab);

            catLine2D4.StartPoint = catPoint2D4;
            catLine2D4.EndPoint   = catPoint2D9;

            Line2D catLine2D5 = catFactory2D1.CreateLine((r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2, r_ib + (r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2);

            catLine2D5.StartPoint = catPoint2D5;
            catLine2D5.EndPoint   = catPoint2D6;

            Line2D catLine2D6 = catFactory2D1.CreateLine(r_ib + (r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2, r_ib + (r_ab - r_ib) / 2, (r_ah - r_ih) / 2);

            catLine2D6.StartPoint = catPoint2D6;
            catLine2D6.EndPoint   = catPoint2D7;

            Line2D catLine2D7 = catFactory2D1.CreateLine(r_ib + (r_ab - r_ib) / 2, (r_ah - r_ih) / 2, (r_ab - r_ib) / 2, (r_ah - r_ih) / 2);

            catLine2D7.StartPoint = catPoint2D7;
            catLine2D7.EndPoint   = catPoint2D8;

            Line2D catLine2D8 = catFactory2D1.CreateLine((r_ab - r_ib) / 2, (r_ah - r_ih) / 2, (r_ab - r_ib) / 2, r_ih + (r_ah - r_ih) / 2);

            catLine2D8.StartPoint = catPoint2D8;
            catLine2D8.EndPoint   = catPoint2D5;

            hsp_catiaProfil.CloseEdition();
            hsp_catiaPart.Part.Update();
        }
        public bool ErzeugeSkizzeTascheDoppelTTräger(double b, double h, double s, double t, bool skizzeerstellt)
        {
            if (skizzeerstellt == true)
            {
                if (b > 0 & h > 0 & s > 0 & t > 0)
                {
                    // Skizze umbenennen
                    catiaSketch1.set_Name("Tasche");

                    // Rechteck in Skizze einzeichnen
                    // Skizze oeffnen
                    Factory2D catFactory2D1 = catiaSketch1.OpenEdition();

                    // Rechteck erzeugen

                    // erst die Punkte
                    Point2D catPoint2D1 = catFactory2D1.CreatePoint(s / 2, h / 2 - t);
                    Point2D catPoint2D2 = catFactory2D1.CreatePoint(b / 2, h / 2 - t);
                    Point2D catPoint2D3 = catFactory2D1.CreatePoint(b / 2, -(h / 2 - t));
                    Point2D catPoint2D4 = catFactory2D1.CreatePoint(s / 2, -(h / 2 - t));

                    // dann die Linien
                    Line2D catLine2D1 = catFactory2D1.CreateLine(s / 2, h / 2 - t, b / 2, h / 2 - t);
                    catLine2D1.StartPoint = catPoint2D1;
                    catLine2D1.EndPoint   = catPoint2D2;

                    Line2D catLine2D2 = catFactory2D1.CreateLine(b / 2, h / 2 - t, b / 2, -(h / 2 - t));
                    catLine2D2.StartPoint = catPoint2D2;
                    catLine2D2.EndPoint   = catPoint2D3;

                    Line2D catLine2D3 = catFactory2D1.CreateLine(b / 2, -(h / 2 - t), s / 2, -(h / 2 - t));
                    catLine2D3.StartPoint = catPoint2D3;
                    catLine2D3.EndPoint   = catPoint2D4;

                    Line2D catLine2D4 = catFactory2D1.CreateLine(s / 2, -(h / 2 - t), s / 2, h / 2 - t);
                    catLine2D4.StartPoint = catPoint2D4;
                    catLine2D4.EndPoint   = catPoint2D1;

                    // erst die Punkte
                    Point2D catPoint2D5 = catFactory2D1.CreatePoint(-s / 2, h / 2 - t);
                    Point2D catPoint2D6 = catFactory2D1.CreatePoint(-b / 2, h / 2 - t);
                    Point2D catPoint2D7 = catFactory2D1.CreatePoint(-b / 2, -(h / 2 - t));
                    Point2D catPoint2D8 = catFactory2D1.CreatePoint(-s / 2, -(h / 2 - t));

                    // dann die Linien
                    Line2D catLine2D5 = catFactory2D1.CreateLine(-s / 2, h / 2 - t, -b / 2, h / 2 - t);
                    catLine2D1.StartPoint = catPoint2D1;
                    catLine2D1.EndPoint   = catPoint2D2;

                    Line2D catLine2D6 = catFactory2D1.CreateLine(-b / 2, h / 2 - t, -b / 2, -(h / 2 - t));
                    catLine2D2.StartPoint = catPoint2D2;
                    catLine2D2.EndPoint   = catPoint2D3;

                    Line2D catLine2D7 = catFactory2D1.CreateLine(-b / 2, -(h / 2 - t), -s / 2, -(h / 2 - t));
                    catLine2D3.StartPoint = catPoint2D3;
                    catLine2D3.EndPoint   = catPoint2D4;

                    Line2D catLine2D8 = catFactory2D1.CreateLine(-s / 2, -(h / 2 - t), -s / 2, h / 2 - t);
                    catLine2D4.StartPoint = catPoint2D4;
                    catLine2D4.EndPoint   = catPoint2D1;

                    // Skizzierer verlassen
                    catiaSketch1.CloseEdition();
                    // Part aktualisieren
                    catiaPart.Part.Update();
                    skizzeerstellt = true;
                }
                else
                {
                    MessageBox.Show("Fehler beim Erstellen des Profils:\rDie Werte dürfen nicht null sein!");
                    skizzeerstellt = false;
                }
            }
            else
            {
                MessageBox.Show("Fehler beim Erstellen des Profils:\rEs konnte keine Skizze erstellt werden!");
                skizzeerstellt = false;
            }


            return(skizzeerstellt);
        }
        public bool ErzeugeSkizzeTascheRechteckrohr(Double laenge2, Double breite2, bool skizzeerstellt)
        {
            if (skizzeerstellt == true)
            {
                if (breite2 > 0 & laenge2 > 0)
                {
                    breite2 = breite2 / 2;
                    laenge2 = laenge2 / 2;
                    // Skizze umbenennen
                    catiaSketch1.set_Name("Tasche");

                    // Rechteck in Skizze einzeichnen
                    // Skizze oeffnen
                    Factory2D catFactory2D1 = catiaSketch1.OpenEdition();

                    // Rechteck erzeugen

                    // erst die Punkte
                    Point2D catPoint2D1 = catFactory2D1.CreatePoint(-breite2, laenge2);
                    Point2D catPoint2D2 = catFactory2D1.CreatePoint(breite2, laenge2);
                    Point2D catPoint2D3 = catFactory2D1.CreatePoint(breite2, -laenge2);
                    Point2D catPoint2D4 = catFactory2D1.CreatePoint(-breite2, -laenge2);

                    // dann die Linien
                    Line2D catLine2D1 = catFactory2D1.CreateLine(-breite2, laenge2, breite2, laenge2);
                    catLine2D1.StartPoint = catPoint2D1;
                    catLine2D1.EndPoint   = catPoint2D2;

                    Line2D catLine2D2 = catFactory2D1.CreateLine(breite2, laenge2, breite2, -laenge2);
                    catLine2D2.StartPoint = catPoint2D2;
                    catLine2D2.EndPoint   = catPoint2D3;

                    Line2D catLine2D3 = catFactory2D1.CreateLine(breite2, -laenge2, -breite2, -laenge2);
                    catLine2D3.StartPoint = catPoint2D3;
                    catLine2D3.EndPoint   = catPoint2D4;

                    Line2D catLine2D4 = catFactory2D1.CreateLine(-breite2, -laenge2, -breite2, laenge2);
                    catLine2D4.StartPoint = catPoint2D4;
                    catLine2D4.EndPoint   = catPoint2D1;


                    // Skizzierer verlassen
                    catiaSketch1.CloseEdition();
                    // Part aktualisieren
                    catiaPart.Part.Update();
                    skizzeerstellt = true;
                }
                else
                {
                    MessageBox.Show("Fehler beim Erstellen des Profils:\rDie Werte dürfen nicht null sein!");
                    skizzeerstellt = false;
                }
            }
            else
            {
                MessageBox.Show("Fehler beim Erstellen des Profils:\rEs konnte keine Skizze erstellt werden!");
                skizzeerstellt = false;
            }


            return(skizzeerstellt);
        }
        public void erstelleSkizzenElemente()
        {
            Factory2D fact2D = hsp_catiaProfil.OpenEdition();

            // Eckpunkte erstellen

            Console.Write("Vertikale Länge Außen : ");
            double dL1 = Convert.ToDouble(Console.ReadLine());

            Console.Write("Horizontale Länge Außen : ");
            double dL2 = Convert.ToDouble(Console.ReadLine());

            Point2D P1 = fact2D.CreatePoint(dL2 / 2, dL1 / 2);
            Point2D P2 = fact2D.CreatePoint(dL2 / 2, -dL1 / 2);
            Point2D P3 = fact2D.CreatePoint(-dL2 / 2, -dL1 / 2);
            Point2D P4 = fact2D.CreatePoint(-dL2 / 2, dL1 / 2);

            Line2D L1 = fact2D.CreateLine(dL2 / 2, dL1 / 2, dL2 / 2, -dL1 / 2);
            Line2D L2 = fact2D.CreateLine(dL2 / 2, -dL1 / 2, -dL2 / 2, -dL1 / 2);
            Line2D L3 = fact2D.CreateLine(-dL2 / 2, -dL1 / 2, -dL2 / 2, dL1 / 2);
            Line2D L4 = fact2D.CreateLine(-dL2 / 2, dL1 / 2, dL2 / 2, dL1 / 2);

            L1.StartPoint = P1;
            L1.EndPoint   = P2;

            L2.StartPoint = P2;
            L2.EndPoint   = P3;

            L3.StartPoint = P3;
            L3.EndPoint   = P4;

            L4.StartPoint = P4;
            L4.EndPoint   = P1;


            Console.Write("Vertikale Länge Innen : ");
            double dL3 = Convert.ToDouble(Console.ReadLine());

            Console.Write("Horizontale Länge Innen : ");
            double dL4 = Convert.ToDouble(Console.ReadLine());

            Point2D P5 = fact2D.CreatePoint(dL4 / 2, dL3 / 2);
            Point2D P6 = fact2D.CreatePoint(dL4 / 2, -dL3 / 2);
            Point2D P7 = fact2D.CreatePoint(-dL4 / 2, -dL3 / 2);
            Point2D P8 = fact2D.CreatePoint(-dL4 / 2, dL3 / 2);

            Line2D L5 = fact2D.CreateLine(dL4 / 2, dL3 / 2, dL4 / 2, -dL3 / 2);
            Line2D L6 = fact2D.CreateLine(dL4 / 2, -dL3 / 2, -dL4 / 2, -dL3 / 2);
            Line2D L7 = fact2D.CreateLine(-dL4 / 2, -dL3 / 2, -dL4 / 2, dL3 / 2);
            Line2D L8 = fact2D.CreateLine(-dL4 / 2, dL3 / 2, dL4 / 2, dL3 / 2);

            L5.StartPoint = P5;
            L5.EndPoint   = P6;

            L6.StartPoint = P6;
            L6.EndPoint   = P7;

            L7.StartPoint = P7;
            L7.EndPoint   = P8;

            L8.StartPoint = P8;
            L8.EndPoint   = P5;


            hsp_catiaProfil.CloseEdition();

            hsp_catiaPart.Part.Update();
        }
 static Line2D CreateLine(this Factory2D F, Vector Start, Vector End)
 {
     return(F.CreateLine(Start.X, Start.Y, End.X, End.Y));
 }