Beispiel #1
0
        public void ErzeugeKreis(Double r)
        {
            hsp_catiaProfil.set_Name("Kreis");
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            Point2D  catPoint2D1  = catFactory2D1.CreatePoint(0, 0);
            Circle2D catcircle2D1 = catFactory2D1.CreateClosedCircle(0.000000, 0.000000, r);

            catcircle2D1.CenterPoint = catPoint2D1;

            hsp_catiaProfil.CloseEdition();
            hsp_catiaPart.Part.Update();
        }
Beispiel #2
0
        public void ErzeugeProfil(Double h, Double b)
        {
            hsp_catiaProfil.set_Name("Rechteck");
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            Point2D catPoint2D1 = catFactory2D1.CreatePoint(0, h);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(b, h);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(b, 0);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(0, 0);

            Line2D catLine2D1 = catFactory2D1.CreateLine(0, h, b, h);

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

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

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

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

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

            Line2D catLine2D4 = catFactory2D1.CreateLine(0, 0, 0, h);

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

            hsp_catiaProfil.CloseEdition();
            hsp_catiaPart.Part.Update();
        }
Beispiel #3
0
        public void ErzeugeProfil(Double r)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Grundfläche Schaft");

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


            // erst die Punkte
            Point2D catPoint2D1 = catFactory2D1.CreatePoint(0, 0);


            // dann den Kreis
            Circle2D catCircle2D_1 = catFactory2D1.CreateCircle(0, 0, r, 0, 0);

            catCircle2D_1.CenterPoint = catPoint2D1;



            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #4
0
        internal void ErstelleFaseProfil(object[] ParameterListe)
        {
            // Listen Werte wieder in richtige Datentypen umwandeln
            int    Kopf                 = Convert.ToInt32(ParameterListe[0]);
            double Durchmesser          = Convert.ToDouble(ParameterListe[1]);
            double Gewindelänge         = Convert.ToDouble(ParameterListe[2]);
            double Schaftlänge          = Convert.ToDouble(ParameterListe[3]);
            double Steigung             = Convert.ToDouble(ParameterListe[4]);
            int    Gewindeart           = Convert.ToInt32(ParameterListe[5]);
            double Schlüsselweite       = Convert.ToDouble(ParameterListe[6]);
            double Kopfhöhe             = Convert.ToDouble(ParameterListe[7]);
            double Kopfdurchmesser      = Convert.ToDouble(ParameterListe[8]);
            int    SchraubenrichtungInt = Convert.ToInt32(ParameterListe[9]);

            double Gesamtlänge = Gewindelänge + Schaftlänge + Kopfhöhe;
            Double P           = Steigung;
            Double Ri          = Durchmesser / 2;

            hsp_catiaPart.Part.InWorkObject = hsp_catiaProfil_Fase;
            hsp_catiaProfil_Fase.set_Name("Fase");

            double H_links = Ri;
            double V_links = Gesamtlänge - 0.65 * P;

            double H_rechts = Ri;
            double V_rechts = Gesamtlänge;

            double H_unten = Ri - 0.65 * P;
            double V_unten = Gesamtlänge;

            Factory2D catFactory2D3 = hsp_catiaProfil_Fase.OpenEdition();

            Point2D links  = catFactory2D3.CreatePoint(H_links, V_links);
            Point2D rechts = catFactory2D3.CreatePoint(H_rechts, V_rechts);
            Point2D unten  = catFactory2D3.CreatePoint(H_unten, V_unten);

            Line2D Oben = catFactory2D3.CreateLine(H_links, V_links, H_rechts, V_rechts);

            Oben.StartPoint = links;
            Oben.EndPoint   = rechts;

            Line2D hypo = catFactory2D3.CreateLine(H_links, V_links, H_unten, V_unten);

            hypo.StartPoint = links;
            hypo.EndPoint   = unten;

            Line2D seite = catFactory2D3.CreateLine(H_unten, V_unten, H_rechts, V_rechts);

            seite.StartPoint = unten;
            seite.EndPoint   = rechts;



            hsp_catiaProfil_Fase.CloseEdition();
            hsp_catiaPart.Part.Update();
        }
Beispiel #5
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 #6
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 #7
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 #8
0
        public void Kreis_DrawSketch(double KreisDurchmesser)
        {
            double d = KreisDurchmesser;

            CATIA_Kreis2D.set_Name("Kreisprofil");

            Factory2D KreisFactory = CATIA_Kreis2D.OpenEdition();

            // Definition des Kreises
            Circle2D KreisSketch = KreisFactory.CreateCircle(0, 0, (d / 2), 0, 0);

            CATIA_Kreis2D.CloseEdition();

            CATIA_KreisPart.Part.Update();
        }
Beispiel #9
0
        private void ProfilSchaft(object[] ParameterListe)
        {
            double Durchmesser = Convert.ToDouble(ParameterListe[1]);

            // Skizze umbenennen
            hsp_catiaProfil_Schaft.set_Name("Schaft");

            // Skizze oeffnen
            Factory2D catFactory2D2 = hsp_catiaProfil_Schaft.OpenEdition();


            Circle2D circle2DSchaft = catFactory2D2.CreateClosedCircle(0, 0, Durchmesser / 2);

            // Skizzierer verlassen
            hsp_catiaProfil_Schaft.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #10
0
        public void Kreis_hohl_DrawSketch(double KreisDurchmesser, double Wandstaerke)
        {
            double d  = KreisDurchmesser;
            double t  = Wandstaerke;
            double di = (d / 2) - t;

            CATIA_Kreis_hohl_2D.set_Name("Kreis-Hohlprofil");

            Factory2D Kreis_hohl_Factory = CATIA_Kreis_hohl_2D.OpenEdition();

            // Definition der Kreise
            Circle2D OuterCircle = Kreis_hohl_Factory.CreateCircle(0, 0, (d / 2), 0, 0);
            Circle2D InnerCircle = Kreis_hohl_Factory.CreateCircle(0, 0, di, 0, 0);

            CATIA_Kreis_hohl_2D.CloseEdition();

            CATIA_Kreis_hohl_Part.Part.Update();
        }
Beispiel #11
0
        internal void SkizzeZylinder(Schraube arr)
        {
            part_Schraube = hsp_catiaPartDoc.Part;
            Bodies bodies = part_Schraube.Bodies;

            body_Schraube = part_Schraube.MainBody;

            part_Schraube.InWorkObject = part_Schraube.MainBody;

            // hsp_catiaPartDoc.Part.InWorkObject = hsp_catiaPartDoc.Part.MainBody;   eventuell überflüssig
            hsp_catiaSkizze.set_Name("Zylinder");

            // Bearbeitungsumgebung der Skizze Öffnen
            Factory2D catfactory2D1 = hsp_catiaSkizze.OpenEdition();

            Circle2D Zylinder1 = catfactory2D1.CreateClosedCircle(0, 0, 0.5 * arr.durchmesser);

            hsp_catiaSkizze.CloseEdition();
        }
Beispiel #12
0
        public void ErzeugeProfil(Double b, Double h)
        {
            // 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(-25, 25);
            Point2D catPoint2D2 = catFactory2D1.CreatePoint(25, 25);
            Point2D catPoint2D3 = catFactory2D1.CreatePoint(25, -25);
            Point2D catPoint2D4 = catFactory2D1.CreatePoint(-25, -25);

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

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

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

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

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

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

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

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

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #13
0
        public void setMittelpunkt(double r)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("Kreis");

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

            // Kreis erzeugen
            // erst die Punkte


            Circle2D circle2D = catFactory2D1.CreateCircle(0, 0, r, 0, 0);

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.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();
        }
        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();
        }
        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();
        }
Beispiel #17
0
    public void ErzeugeRechteckprofil(string currentItemName, double[] parameterListe)
    {
        //  ()  <--breite-->     b

        double b = parameterListe[0];
        double h = parameterListe[1];

        //double e = parameterListe[2];
        //double f = parameterListe[3];

        // Skizze umbenennen
        hsp_catiaProfil.set_Name(currentItemName);
        // Skizze oeffnen
        Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();
        // erst die Punkte
        Point2D catPoint2D1 = catFactory2D1.CreatePoint(-b / 2, h / 2);
        Point2D catPoint2D2 = catFactory2D1.CreatePoint(b / 2, h / 2);
        Point2D catPoint2D3 = catFactory2D1.CreatePoint(b / 2, -h / 2);
        Point2D catPoint2D4 = catFactory2D1.CreatePoint(-b / 2, -h / 2);
        // dann die Linien
        Line2D catLine2D1 = catFactory2D1.CreateLine(-b / 2, h / 2, b / 2, h / 2);

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

        Line2D catLine2D2 = catFactory2D1.CreateLine(b / 2, h / 2, b / 2, -h / 2);

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

        Line2D catLine2D3 = catFactory2D1.CreateLine(b / 2, -h / 2, -b / 2, -h / 2);

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

        Line2D catLine2D4 = catFactory2D1.CreateLine(-b / 2, -h / 2, -b / 2, h / 2);

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

        // Skizzierer verlassen
        hsp_catiaProfil.CloseEdition();
        // Part aktualisieren
        hsp_catiaPart.Part.Update();
    }
        public void ErzeugeProfil(Data dat)
        {
            //Nullpunkt
            double x0 = 0;
            double y0 = 0;

            //Hilfsgrößen von Wilkos PDF
            double teilkreisradius   = dat.getTeilkreisdurchmesser() / 2;
            double hilfskreisradius  = teilkreisradius * 0.94;
            double fußkreisradius    = teilkreisradius - (1.25 * dat.getModul());
            double kopfkreisradius   = teilkreisradius + dat.getModul();
            double verrundungsradius = 0.35 * dat.getModul();

            double alpha         = 20;
            double beta          = 90 / dat.getZähnezahl();
            double betarad       = Math.PI * beta / 180;
            double gamma         = 90 - (alpha - beta);
            double gammarad      = Math.PI * gamma / 180;
            double totalangle    = 360.0 / dat.getZähnezahl();
            double totalanglerad = Math.PI * totalangle / 180;

            //Punkte
            //LinkerEvolKreis Mittelp. Koordinaten
            double mittelpunktEvol_x = hilfskreisradius * Math.Cos(gammarad);
            double mittelpunktEvol_y = hilfskreisradius * Math.Sin(gammarad);

            // Schnittpkt. auf Evolvente und Teilkreisradius
            double punktEvol_x = -teilkreisradius *Math.Sin(betarad);

            double punktEvol_y = teilkreisradius * Math.Cos(betarad);

            //Evolventenkreis Radius
            double EvolventenkreisRadius = Math.Sqrt(Math.Pow((mittelpunktEvol_x - punktEvol_x), 2) + Math.Pow((mittelpunktEvol_y - punktEvol_y), 2));

            //Koordinaten Schnittpunkt Kopfkreis und Evolventenkreis
            double evolventenKopfk_x = Schnittpunkt_X(x0, y0, kopfkreisradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius);
            double evolventenKopfk_y = Schnittpunkt_Y(x0, y0, kopfkreisradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius);

            //Mittelpunktkoordinaten Verrundung
            double mittelpunktVer_x = Schnittpunkt_X(x0, y0, fußkreisradius + verrundungsradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius + verrundungsradius);
            double mittelpunktVer_y = Schnittpunkt_Y(x0, y0, fußkreisradius + verrundungsradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius + verrundungsradius);

            //Schnittpubktkoordinaten Verrundung - Evolventenkreis
            double evolventenVer_x = Schnittpunkt_X(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);
            double evolventenVer_y = Schnittpunkt_Y(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);

            //Schnittpunktkoordinaten Verrundung - Fußkreis
            double fußkreisVer_x = Schnittpunkt_X(x0, y0, fußkreisradius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);
            double fußkreisVer_y = Schnittpunkt_Y(x0, y0, fußkreisradius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);

            //Koordinaten Anfangspunkt Fußkreis
            double hilfswinkel        = totalanglerad - Math.Atan(Math.Abs(fußkreisVer_x) / Math.Abs(fußkreisVer_y));
            double anfangspunktFußk_x = -fußkreisradius *Math.Sin(hilfswinkel);

            double anfangspunktFußk_y = fußkreisradius * Math.Cos(hilfswinkel);

            //Skizze umbenennen und öffnen
            hsp_catiaProfil.set_Name("Außenverzahntes Stirnrad");
            Factory2D catfactory2D1 = hsp_catiaProfil.OpenEdition();

            //Nun die Punkte in die Skizze
            Point2D point_Ursprung             = catfactory2D1.CreatePoint(x0, y0);
            Point2D pointAnfangFußkreis        = catfactory2D1.CreatePoint(anfangspunktFußk_x, anfangspunktFußk_y);
            Point2D pointFußkreisVer_l         = catfactory2D1.CreatePoint(fußkreisVer_x, fußkreisVer_y);
            Point2D pointFußkreisVer_r         = catfactory2D1.CreatePoint(-fußkreisVer_x, fußkreisVer_y);
            Point2D pointMittelpunktVer_l      = catfactory2D1.CreatePoint(mittelpunktVer_x, mittelpunktVer_y);
            Point2D pointMittelpunktVer_r      = catfactory2D1.CreatePoint(-mittelpunktVer_x, mittelpunktVer_y);
            Point2D pointVerrundungEvol_l      = catfactory2D1.CreatePoint(evolventenVer_x, evolventenVer_y);
            Point2D pointVerrundungEvol_r      = catfactory2D1.CreatePoint(-evolventenVer_x, evolventenVer_y);
            Point2D pointMittelpunktevol_l     = catfactory2D1.CreatePoint(mittelpunktEvol_x, mittelpunktEvol_y);
            Point2D pointMittelpunktevol_r     = catfactory2D1.CreatePoint(-mittelpunktEvol_x, mittelpunktEvol_y);
            Point2D pointEvolventenKopfkreis_l = catfactory2D1.CreatePoint(evolventenKopfk_x, evolventenKopfk_y);
            Point2D pointEvolventenKopfkreis_r = catfactory2D1.CreatePoint(-evolventenKopfk_x, evolventenKopfk_y);

            //Kreise
            Circle2D kreisFußkreis = catfactory2D1.CreateCircle(x0, y0, fußkreisradius, 0, Math.PI * 2);

            kreisFußkreis.CenterPoint = point_Ursprung;
            kreisFußkreis.StartPoint  = pointFußkreisVer_l;
            kreisFußkreis.EndPoint    = pointAnfangFußkreis;

            Circle2D kreisVerrundung_l = catfactory2D1.CreateCircle(mittelpunktVer_x, mittelpunktVer_y, verrundungsradius, 0, Math.PI * 2);

            kreisVerrundung_l.CenterPoint = pointMittelpunktVer_l;
            kreisVerrundung_l.StartPoint  = pointFußkreisVer_l;
            kreisVerrundung_l.EndPoint    = pointVerrundungEvol_l;

            Circle2D kreisEvolventenkreis_l = catfactory2D1.CreateCircle(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, 0, Math.PI * 2);

            kreisEvolventenkreis_l.CenterPoint = pointMittelpunktevol_l;
            kreisEvolventenkreis_l.StartPoint  = pointEvolventenKopfkreis_l;
            kreisEvolventenkreis_l.EndPoint    = pointVerrundungEvol_l;

            Circle2D kreisKopfkreis = catfactory2D1.CreateCircle(x0, y0, kopfkreisradius, 0, Math.PI * 2);

            kreisKopfkreis.CenterPoint = point_Ursprung;
            kreisKopfkreis.StartPoint  = pointEvolventenKopfkreis_r;
            kreisKopfkreis.EndPoint    = pointEvolventenKopfkreis_l;

            Circle2D kreisEvolventenkreis_r = catfactory2D1.CreateCircle(-mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, 0, Math.PI * 2);

            kreisEvolventenkreis_r.CenterPoint = pointMittelpunktevol_r;
            kreisEvolventenkreis_r.StartPoint  = pointVerrundungEvol_r;
            kreisEvolventenkreis_r.EndPoint    = pointEvolventenKopfkreis_r;

            Circle2D kreisVerrundung_r = catfactory2D1.CreateCircle(-mittelpunktVer_x, mittelpunktVer_y, verrundungsradius, 0, Math.PI * 2);

            kreisVerrundung_r.CenterPoint = pointMittelpunktVer_r;
            kreisVerrundung_r.StartPoint  = pointVerrundungEvol_r;
            kreisVerrundung_r.EndPoint    = pointFußkreisVer_r;



            hsp_catiaProfil.CloseEdition();

            hsp_catiaPart.Part.Update();
        }
Beispiel #19
0
        public void setPartName(String name)
        {
            hsp_catiaProfil.set_Name(name);

            hsp_catiaPart.Part.Update();
        }
Beispiel #20
0
        //Innenverzahntes Stirnrad
        public void ErzeugeProfilInnen(Data dat)
        {
            //KOORDINATEN ANLEGEN
            //Nullpunkt
            double x0 = 0;
            double y0 = 0;

            //Radien und Winkel umgestellt
            double Teilkreisradius = dat.getTeilkreisdurchmesser() / 2;
            //Angenährt
            double Hilfskreisradius  = Teilkreisradius * 1.12;
            double Kopfkreisradius   = Teilkreisradius - (1.25 * dat.getModul());
            double Fußkreisradius    = Teilkreisradius + dat.getModul();
            double Verrundungsradius = 0.35 * dat.getModul();

            double Alpha         = 20;
            double Beta          = 90 / dat.getZähnezahl();
            double Betarad       = Math.PI * Beta / 180;
            double Gamma         = 90 - (Alpha - Beta);
            double Gammarad      = Math.PI * Gamma / 180;
            double Totalangel    = 360.0 / dat.getZähnezahl();
            double Totalangelrad = Math.PI * Totalangel / 180;

            //Schnittpunkte und Koordinaten
            //Evolventenkreis Center Koordinaten
            double xMittelpunktaufEvol_links = Hilfskreisradius * Math.Cos(Gammarad);
            double yMittelpunktaufEvol_links = Hilfskreisradius * Math.Sin(Gammarad);

            //Schnittpkt. der Evolvente und dem Teilkreisradius
            double xPunktAufEvolvente = -Teilkreisradius *Math.Sin(Betarad);

            double yPunktAufEvolvente = Teilkreisradius * Math.Cos(Betarad);

            //Evolvente Radius
            double EvolventenkreisRadius = Math.Sqrt(Math.Pow((xMittelpunktaufEvol_links - xPunktAufEvolvente), 2) + Math.Pow((yMittelpunktaufEvol_links - yPunktAufEvolvente), 2));

            //Schnittpunkt Kopfkreis und Evolventenkreis
            double xEvolventenkopfkreis_links = Schnittpunkt_X(x0, y0, Kopfkreisradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius);
            double yEvolventenkopfkreis_links = Schnittpunkt_Y(x0, y0, Kopfkreisradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius);

            //Center Verrundung
            double xMittelpunktVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius - Verrundungsradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius + Verrundungsradius);
            double yMittelpunktVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius - Verrundungsradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius + Verrundungsradius);

            //Schnittpunkt Verrundung Evolventenkreis
            double x_SP_EvolventeVerrundung_links = Schnittpunkt_X(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_EvolventeVerrundung_links = Schnittpunkt_Y(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Schnittpunkt Verrundung Fußkreis
            double x_SP_FußkreisradiusVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_FußkreisradiusVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Anfangspunkt Fußkreis
            double Hilfswinkel            = Totalangelrad - Math.Atan(Math.Abs(x_SP_FußkreisradiusVerrundung_links) / Math.Abs(y_SP_FußkreisradiusVerrundung_links));
            double x_AnfangspunktFußkreis = -Fußkreisradius *Math.Sin(Hilfswinkel);

            double y_AnfangspunktFußkreis = Fußkreisradius * Math.Cos(Hilfswinkel);



            //Geometrisches Set auswählen und umbennen
            HybridBodies catHybridBodies1 = hsp_catiaPart.Part.HybridBodies;
            HybridBody   catHybridBody1;

            try
            {
                catHybridBody1 = catHybridBodies1.Item("Geometrisches Set.1");
            }
            catch (Exception)
            {
                MessageBox.Show("Kein geometrisches Set gefunden! " + Environment.NewLine +
                                "Ein PART manuell erzeugen und ein darauf achten, dass 'Geometisches Set' aktiviert ist.",
                                "Fehler", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            catHybridBody1.set_Name("Profile");



            //ERSTELLE SKIZZE FÜR SCHEIBE
            Sketches       sketchesBohrung   = catHybridBody1.HybridSketches;
            OriginElements catoriginelements = hsp_catiaPart.Part.OriginElements;
            Reference      refmxPlaneX       = (Reference)catoriginelements.PlaneYZ;

            hsp_catiaProfil = sketchesBohrung.Add(refmxPlaneX);

            ErzeugeAchsensystem();

            hsp_catiaPart.Part.Update();


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

            //Kreis
            Circle2D Scheibe = catfactory2D2.CreateClosedCircle(x0, y0, dat.getAußenradius());

            //Skizze schließen
            hsp_catiaProfil.CloseEdition();

            //Update
            hsp_catiaPart.Part.Update();

            //Erzeuge Block
            ShapeFactory shapeFactoryScheibe = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;

            hsp_catiaPart.Part.InWorkObject = hsp_catiaPart.Part.MainBody;
            Pad Block = shapeFactoryScheibe.AddNewPad(hsp_catiaProfil, dat.getBreite());

            hsp_catiaPart.Part.Update();



            //Zahnradskizze erstellen

            //Skizze umbenennen und öffnen
            Sketches       catSketches1      = catHybridBody1.HybridSketches;
            OriginElements catOriginElements = hsp_catiaPart.Part.OriginElements;
            Reference      catReference1     = (Reference)catOriginElements.PlaneYZ;

            hsp_catiaProfil = catSketches1.Add(catReference1);

            //Achsensystem in Skizze erstellen
            ErzeugeAchsensystem();

            //Update
            hsp_catiaPart.Part.Update();

            //Umbennen und öffnen
            hsp_catiaProfil.set_Name("Innenverzahntes Stirnrad");
            Factory2D catfactory2D1 = hsp_catiaProfil.OpenEdition();

            //Punkte in Skizze einzeichnen
            Point2D point_Ursprung                   = catfactory2D1.CreatePoint(x0, y0);
            Point2D pointAnfangFußkreisLinks         = catfactory2D1.CreatePoint(x_AnfangspunktFußkreis, y_AnfangspunktFußkreis);
            Point2D pointFußkreisVerrundungLinks     = catfactory2D1.CreatePoint(x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D pointFußkreisVerrundungRechts    = catfactory2D1.CreatePoint(-x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D pointMittelpunktVerrundungLinks  = catfactory2D1.CreatePoint(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D pointMittelpunktVerrundungRechts = catfactory2D1.CreatePoint(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D pointVerrundungEvolventeLinks    = catfactory2D1.CreatePoint(x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D pointVerrundungEvolventeRechts   = catfactory2D1.CreatePoint(-x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D pointMittelpunktevolventeLinks   = catfactory2D1.CreatePoint(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links);
            Point2D pointMittelpunktevolventeRechts  = catfactory2D1.CreatePoint(-xMittelpunktaufEvol_links, yMittelpunktaufEvol_links);
            Point2D pointEvolventenKopfkreisLinks    = catfactory2D1.CreatePoint(xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);
            Point2D pointEvolventenKopfkreisRechts   = catfactory2D1.CreatePoint(-xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);

            //Kreise einzeichnen
            Circle2D KreisFrußkreis = catfactory2D1.CreateCircle(x0, y0, Fußkreisradius, 0, Math.PI * 2);

            KreisFrußkreis.CenterPoint = point_Ursprung;
            KreisFrußkreis.StartPoint  = pointFußkreisVerrundungLinks;
            KreisFrußkreis.EndPoint    = pointAnfangFußkreisLinks;

            Circle2D KreisVerrundungLinks = catfactory2D1.CreateCircle(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            KreisVerrundungLinks.CenterPoint = pointMittelpunktVerrundungLinks;
            KreisVerrundungLinks.EndPoint    = pointFußkreisVerrundungLinks;
            KreisVerrundungLinks.StartPoint  = pointVerrundungEvolventeLinks;

            Circle2D KreisEvolventenkreisLinks = catfactory2D1.CreateCircle(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, 0, Math.PI * 2);

            KreisEvolventenkreisLinks.CenterPoint = pointMittelpunktevolventeLinks;
            KreisEvolventenkreisLinks.EndPoint    = pointEvolventenKopfkreisLinks;
            KreisEvolventenkreisLinks.StartPoint  = pointVerrundungEvolventeLinks;

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

            KreisKopfkreis.CenterPoint = point_Ursprung;
            KreisKopfkreis.StartPoint  = pointEvolventenKopfkreisRechts;
            KreisKopfkreis.EndPoint    = pointEvolventenKopfkreisLinks;

            Circle2D KreisEvolventenkreisRechts = catfactory2D1.CreateCircle(-xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, 0, Math.PI * 2);

            KreisEvolventenkreisRechts.CenterPoint = pointMittelpunktevolventeRechts;
            KreisEvolventenkreisRechts.EndPoint    = pointVerrundungEvolventeRechts;
            KreisEvolventenkreisRechts.StartPoint  = pointEvolventenKopfkreisRechts;

            Circle2D KreisVerrundungRechts = catfactory2D1.CreateCircle(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            KreisVerrundungRechts.CenterPoint = pointMittelpunktVerrundungRechts;
            KreisVerrundungRechts.EndPoint    = pointVerrundungEvolventeRechts;
            KreisVerrundungRechts.StartPoint  = pointFußkreisVerrundungRechts;


            //Schließen
            hsp_catiaProfil.CloseEdition();

            //Updaten
            hsp_catiaPart.Part.Update();



            //ERSTELLE KREISMUSTER
            HybridShapeFactory hybridShapeFactory1 = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;
            ShapeFactory       shapeFactory1       = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;

            Factory2D factory2D1 = hsp_catiaProfil.Factory2D;

            HybridShapePointCoord ursprung    = hybridShapeFactory1.AddNewPointCoord(0, 0, 0);
            Reference             refUrsprung = hsp_catiaPart.Part.CreateReferenceFromObject(ursprung);

            HybridShapeDirection xRichtung    = hybridShapeFactory1.AddNewDirectionByCoord(1, 0, 0);
            Reference            refxRichtung = hsp_catiaPart.Part.CreateReferenceFromObject(xRichtung);

            CircPattern kreismuster = shapeFactory1.AddNewSurfacicCircPattern(factory2D1, 1, 2, 0, 0, 1, 1, refUrsprung, refxRichtung, false, 0, true, false);

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

            angle1.Value = Convert.ToDouble(360 / dat.getZähnezahl());
            AngularRepartition angularRepartition2 = kreismuster.AngularRepartition;
            IntParam           intParam1           = angularRepartition2.InstancesCount;

            intParam1.Value = Convert.ToInt32(dat.getZähnezahl()) + 1;


            //Kreismusterenden verbinden

            Reference           refKreismuster = hsp_catiaPart.Part.CreateReferenceFromObject(kreismuster);
            HybridShapeAssemble verbindung     = hybridShapeFactory1.AddNewJoin(refKreismuster, refKreismuster);
            Reference           refVerbindung  = hsp_catiaPart.Part.CreateReferenceFromObject(verbindung);

            hybridShapeFactory1.GSMVisibility(refVerbindung, 0);

            hsp_catiaPart.Part.MainBody.InsertHybridShape(verbindung);


            //Update
            hsp_catiaPart.Part.Update();

            //Tasche
            ErzeugeTasche(dat, refVerbindung, shapeFactory1);
            hsp_catiaProfil = catSketches1.Parent as MECMOD.Sketch;
            hsp_catiaPart.Part.Update();
        }
Beispiel #21
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();
        }
Beispiel #22
0
        public void Stirnzahnrad(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         = 20;
            double Beta          = 90 / 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 erzeugen
            //Kleiner Kreis
            double xMittelpunktaufEvol_links = Hilfskreisradius * Math.Cos(Gammarad);
            double yMittelpunktaufEvol_links = Hilfskreisradius * Math.Sin(Gammarad);

            //Schnittpunkt auf Evolvente und Teilkreisradius
            double xPunktaufEvolvente = -Teilkreisradius *Math.Sin(Betarad);

            double yPunktaufEvolvente = Teilkreisradius * Math.Cos(Betarad);

            //Evolventenkreis Radius
            double EvolventenkreisRadius = Math.Sqrt(Math.Pow((xMittelpunktaufEvol_links - xPunktaufEvolvente), 2) + Math.Pow((yMittelpunktaufEvol_links - yPunktaufEvolvente), 2));

            //Koordinaten Schnittpunkt Kopfkreis und Evolventenkreis
            double xEvolventenkopfkreis_links = Schnittpunkt_X(x0, y0, Kopfkreisradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius);
            double yEvolventenkopfkreis_links = Schnittpunkt_Y(x0, y0, Kopfkreisradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius);

            //Mittelpunktkoordinaten Verrundung
            double xMittelpunktVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius + Verrundungsradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius + Verrundungsradius);
            double yMittelpunktVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius + Verrundungsradius, xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius + Verrundungsradius);

            //Schnittpunktkoordinaten Verrundung - Evolventenkreis
            double x_SP_EvolventeVerrundung_links = Schnittpunkt_X(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_EvolventeVerrundung_links = Schnittpunkt_Y(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Schnittpunktkoordinaten Verrundung - Fußkreis
            double x_SP_FußkreisradiusVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_FußkreisradiusVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Koordinaten Anfangspunkt Fußkreis
            double Hilfswinkel            = Totalangelrad - Math.Atan(Math.Abs(x_SP_FußkreisradiusVerrundung_links) / Math.Abs(y_SP_FußkreisradiusVerrundung_links));
            double x_AnfangspunktFußkreis = -Fußkreisradius *Math.Sin(Hilfswinkel);

            double y_AnfangspunktFußkreis = Fußkreisradius * Math.Cos(Hilfswinkel);

            //Ende

            //Skizze umbenennen
            hsp_catiaProfil.set_Name("Zahnrad-Test");
            Factory2D catfactory2D1 = hsp_catiaProfil.OpenEdition();

            //Punkte in Skizze
            Point2D point_Ursprung                   = catfactory2D1.CreatePoint(x0, y0);
            Point2D pointAnfangFußkreisLinks         = catfactory2D1.CreatePoint(x_AnfangspunktFußkreis, y_AnfangspunktFußkreis);
            Point2D pointFußkreisVerrundungLinks     = catfactory2D1.CreatePoint(x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D pointFußkreisVerrundungRechts    = catfactory2D1.CreatePoint(-x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D pointMittelpunktVerrundungLinks  = catfactory2D1.CreatePoint(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D pointMittelpunktVerrundungRechts = catfactory2D1.CreatePoint(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D pointVerrundungEvolventeLinks    = catfactory2D1.CreatePoint(x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D pointVerrundungEvolventeRechts   = catfactory2D1.CreatePoint(-x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D pointMittelpunktevolventeLinks   = catfactory2D1.CreatePoint(xMittelpunktaufEvol_links, xMittelpunktaufEvol_links);
            Point2D pointMittelpunktevolventeRechts  = catfactory2D1.CreatePoint(-xMittelpunktaufEvol_links, yMittelpunktaufEvol_links);
            Point2D pointEvolventenKopfkreisLinks    = catfactory2D1.CreatePoint(xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);
            Point2D pointEvolventenKopfkreisRechts   = catfactory2D1.CreatePoint(-xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);

            //Kreise
            Circle2D KreisFußkreis = catfactory2D1.CreateCircle(x0, y0, Fußkreisradius, 0, Math.PI * 2);

            KreisFußkreis.CenterPoint = point_Ursprung;
            KreisFußkreis.StartPoint  = pointFußkreisVerrundungLinks;
            KreisFußkreis.EndPoint    = pointAnfangFußkreisLinks;

            Circle2D KreisVerrundungLinks = catfactory2D1.CreateCircle(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            KreisVerrundungLinks.CenterPoint = pointMittelpunktVerrundungLinks;
            KreisVerrundungLinks.StartPoint  = pointFußkreisVerrundungLinks;
            KreisVerrundungLinks.EndPoint    = pointVerrundungEvolventeLinks;

            Circle2D KreisEvolventenkreisLinks = catfactory2D1.CreateCircle(xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, 0, Math.PI * 2);

            KreisEvolventenkreisLinks.CenterPoint = pointMittelpunktevolventeLinks;
            KreisEvolventenkreisLinks.StartPoint  = pointEvolventenKopfkreisLinks;
            KreisEvolventenkreisLinks.EndPoint    = pointVerrundungEvolventeLinks;

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

            KreisKopfkreis.CenterPoint = point_Ursprung;
            KreisKopfkreis.StartPoint  = pointEvolventenKopfkreisRechts;
            KreisKopfkreis.EndPoint    = pointEvolventenKopfkreisLinks;

            Circle2D KreisEvolventenkreisRechts = catfactory2D1.CreateCircle(-xMittelpunktaufEvol_links, yMittelpunktaufEvol_links, EvolventenkreisRadius, 0, Math.PI * 2);

            KreisEvolventenkreisRechts.CenterPoint = pointMittelpunktVerrundungRechts;
            KreisEvolventenkreisRechts.StartPoint  = pointVerrundungEvolventeRechts;
            KreisEvolventenkreisRechts.EndPoint    = pointEvolventenKopfkreisRechts;

            Circle2D KreisVerrundungRechts = catfactory2D1.CreateCircle(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            KreisVerrundungRechts.CenterPoint = pointMittelpunktVerrundungRechts;
            KreisVerrundungRechts.StartPoint  = pointVerrundungEvolventeRechts;
            KreisVerrundungRechts.EndPoint    = pointFußkreisVerrundungRechts;

            //Skizzierer schließen
            hsp_catiaProfil.CloseEdition();

            //Aktualisieren
            hsp_catiaPart.Part.Update();



            //Kreismuster erstellen
            //Deklarierung
            ShapeFactory       SF  = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;
            HybridShapeFactory HSF = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;
            Part myPart            = hsp_catiaPart.Part;

            Factory2D             Factory2D1  = 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);

            //Kreismuster Daten ausfüllen
            CircPattern Kreismuster = SF.AddNewSurfacicCircPattern(Factory2D1, 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;

            //geschlossene Kontur herstellen
            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();
        }
Beispiel #23
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 #24
0
        public void ErzeugeProfil(Zahnrad Zahnrad1)
        {
            // geometrisches Set auswaehlen und umbenennen
            HybridBodies catHybridBodies1 = hsp_catiaPart.Part.HybridBodies;
            HybridBody   catHybridBody1;

            try
            {
                catHybridBody1 = catHybridBodies1.Item("Geometrisches Set.1");
            }
            catch (Exception)
            {
                MessageBox.Show("Kein geometrisches Set gefunden! " + Environment.NewLine +
                                "Ein PART manuell erzeugen und ein darauf achten, dass 'Geometisches Set' aktiviert ist.",
                                "Fehler", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            catHybridBody1.set_Name("Profile");
            // neue Skizze im ausgewaehlten geometrischen Set anlegen
            Sketches       catSketches1      = catHybridBody1.HybridSketches;
            OriginElements catOriginElements = hsp_catiaPart.Part.OriginElements;
            Reference      catReference1     = (Reference)catOriginElements.PlaneYZ;

            hsp_catiaProfil = catSketches1.Add(catReference1);

            // Achsensystem in Skizze erstellen
            ErzeugeAchsensystem();

            // Part aktualisieren
            hsp_catiaPart.Part.Update();

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

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

            double Alpha         = 20;
            double Beta          = 90 / Zahnrad1.z;
            double Betarad       = Math.PI * Beta / 180;
            double Gamma         = 90 - (Alpha - Beta);
            double Gammarad      = Math.PI * Gamma / 180;
            double Totalangel    = 360.0 / Zahnrad1.z;
            double Totalangelrad = Math.PI * Totalangel / 180;


            //Punkte
            //LinkerEvolKreis Mittelp. Koordinaten
            double xMPEvo_links = Hilfskreisradius * Math.Cos(Gammarad);
            double yMPEvo_links = Hilfskreisradius * Math.Sin(Gammarad);

            //Schnittpkt. auf Evolvente und Teilkreisradius
            double xPunktAufEvolvente = -Teilkreisradius *Math.Sin(Betarad);

            double yPunktAufEvolvente = Teilkreisradius * Math.Cos(Betarad);

            //Evolventenkreis Radius
            double EvolventenkreisRadius = Math.Sqrt(Math.Pow((xMPEvo_links - xPunktAufEvolvente), 2) + Math.Pow((yMPEvo_links - yPunktAufEvolvente), 2));

            //Koordinaten Schnittpunkt Kopfkreis und Evolventenkreis
            double xEvolventenkopfkreis_links = Schnittpunkt_X(x0, y0, Kopfkreisradius, xMPEvo_links, yMPEvo_links, EvolventenkreisRadius);
            double yEvolventenkopfkreis_links = Schnittpunkt_Y(x0, y0, Kopfkreisradius, xMPEvo_links, yMPEvo_links, EvolventenkreisRadius);

            //Mittelpunktkoordinaten Verrundung
            double xMittelpunktVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius + Verrundungsradius, xMPEvo_links, yMPEvo_links, EvolventenkreisRadius + Verrundungsradius);
            double yMittelpunktVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius + Verrundungsradius, xMPEvo_links, yMPEvo_links, EvolventenkreisRadius + Verrundungsradius);

            //Schnittpubktkoordinaten Verrundung - Evolventenkreis
            double x_SP_EvolventeVerrundung_links = Schnittpunkt_X(xMPEvo_links, yMPEvo_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_EvolventeVerrundung_links = Schnittpunkt_Y(xMPEvo_links, yMPEvo_links, EvolventenkreisRadius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Schnittpunktkoordinaten Verrundung - Fußkreis
            double x_SP_FußkreisradiusVerrundung_links = Schnittpunkt_X(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);
            double y_SP_FußkreisradiusVerrundung_links = Schnittpunkt_Y(x0, y0, Fußkreisradius, xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius);

            //Koordinaten Anfangspunkt Fußkreis
            double Hilfswinkel            = Totalangelrad - Math.Atan(Math.Abs(x_SP_FußkreisradiusVerrundung_links) / Math.Abs(y_SP_FußkreisradiusVerrundung_links));
            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 Ursprung = catfactory2D1.CreatePoint(x0, y0);
            Point2D EndpunktEvolventenkreis = catfactory2D1.CreatePoint(x_AnfangspunktFußkreis, y_AnfangspunktFußkreis);
            Point2D VerrundungLinksAnfang   = catfactory2D1.CreatePoint(x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D VerrundungRechtsEnde    = catfactory2D1.CreatePoint(-x_SP_FußkreisradiusVerrundung_links, y_SP_FußkreisradiusVerrundung_links);
            Point2D MPVerrundungLinks       = catfactory2D1.CreatePoint(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D MPVerrundungRechts      = catfactory2D1.CreatePoint(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links);
            Point2D VerrundungEndeLinks     = catfactory2D1.CreatePoint(x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D VerrundungAnfangRechts  = catfactory2D1.CreatePoint(-x_SP_EvolventeVerrundung_links, y_SP_EvolventeVerrundung_links);
            Point2D MPEvolventeLinks        = catfactory2D1.CreatePoint(xMPEvo_links, yMPEvo_links);
            Point2D MPEvolventeRechts       = catfactory2D1.CreatePoint(-xMPEvo_links, yMPEvo_links);
            Point2D EvolventenEndeLinks     = catfactory2D1.CreatePoint(xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);
            Point2D EvolventenEndeRechts    = catfactory2D1.CreatePoint(-xEvolventenkopfkreis_links, yEvolventenkopfkreis_links);

            //Kreise

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

            Fußkreis.CenterPoint = Ursprung;
            Fußkreis.StartPoint  = EndpunktEvolventenkreis;
            Fußkreis.EndPoint    = VerrundungRechtsEnde;

            Circle2D VerrundungLinks = catfactory2D1.CreateCircle(xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            VerrundungLinks.CenterPoint = MPVerrundungLinks;
            VerrundungLinks.StartPoint  = VerrundungLinksAnfang;
            VerrundungLinks.EndPoint    = VerrundungEndeLinks;

            Circle2D EvolventenkreisLinks = catfactory2D1.CreateCircle(xMPEvo_links, yMPEvo_links, EvolventenkreisRadius, 0, Math.PI * 2);

            EvolventenkreisLinks.CenterPoint = MPEvolventeLinks;
            EvolventenkreisLinks.StartPoint  = EvolventenEndeLinks;
            EvolventenkreisLinks.EndPoint    = VerrundungEndeLinks;

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

            Kopfkreis.CenterPoint = Ursprung;
            Kopfkreis.StartPoint  = EvolventenEndeRechts;
            Kopfkreis.EndPoint    = EvolventenEndeLinks;

            Circle2D EvolventenkreisRechts = catfactory2D1.CreateCircle(-xMPEvo_links, yMPEvo_links, EvolventenkreisRadius, 0, Math.PI * 2);

            EvolventenkreisRechts.CenterPoint = MPEvolventeRechts;
            EvolventenkreisRechts.StartPoint  = VerrundungAnfangRechts;
            EvolventenkreisRechts.EndPoint    = EvolventenEndeRechts;

            Circle2D VerrundungRechts = catfactory2D1.CreateCircle(-xMittelpunktVerrundung_links, yMittelpunktVerrundung_links, Verrundungsradius, 0, Math.PI * 2);

            VerrundungRechts.CenterPoint = MPVerrundungRechts;
            VerrundungRechts.StartPoint  = VerrundungAnfangRechts;
            VerrundungRechts.EndPoint    = VerrundungRechtsEnde;

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();

            ShapeFactory       shapeFactory1       = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;
            HybridShapeFactory hybridShapeFactory1 = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;

            Factory2D factory2D1 = hsp_catiaProfil.Factory2D;

            HybridShapePointCoord ursprung    = hybridShapeFactory1.AddNewPointCoord(0, 0, 0);
            Reference             refUrsprung = hsp_catiaPart.Part.CreateReferenceFromObject(ursprung);

            HybridShapeDirection xRichtung    = hybridShapeFactory1.AddNewDirectionByCoord(1, 0, 0);
            Reference            refxRichtung = hsp_catiaPart.Part.CreateReferenceFromObject(xRichtung);

            CircPattern kreismuster = shapeFactory1.AddNewSurfacicCircPattern(factory2D1, 1, 2, 0, 0, 1, 1, refUrsprung, refxRichtung, false, 0, true, false);

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

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

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


            //Kreismusterenden verbinden

            Reference           refKreismuster = hsp_catiaPart.Part.CreateReferenceFromObject(kreismuster);
            HybridShapeAssemble verbindung     = hybridShapeFactory1.AddNewJoin(refKreismuster, refKreismuster);
            Reference           refVerbindung  = hsp_catiaPart.Part.CreateReferenceFromObject(verbindung);

            hybridShapeFactory1.GSMVisibility(refVerbindung, 0);

            hsp_catiaPart.Part.MainBody.InsertHybridShape(verbindung);

            hsp_catiaPart.Part.Update();

            ErzeugeBlock(Zahnrad1, refVerbindung, shapeFactory1);


            Sketches       sketchesBohrung   = catHybridBody1.HybridSketches;
            OriginElements catoriginelements = hsp_catiaPart.Part.OriginElements;
            Reference      refmxPlaneX       = (Reference)catoriginelements.PlaneYZ;

            hsp_catiaProfil = catSketches1.Add(refmxPlaneX);

            ErzeugeAchsensystem();

            hsp_catiaPart.Part.Update();

            hsp_catiaProfil.set_Name("Bohrung");

            Factory2D catfactory2D2 = hsp_catiaProfil.OpenEdition();

            Circle2D KreisFürBohrungsskizze = catfactory2D2.CreateClosedCircle(x0, y0, Zahnrad1.bd / 2);

            hsp_catiaProfil.CloseEdition();

            hsp_catiaPart.Part.Update();

            hsp_catiaPart.Part.InWorkObject = hsp_catiaPart.Part.MainBody;
            Pocket Tasche = shapeFactory1.AddNewPocket(hsp_catiaProfil, Zahnrad1.b);

            hsp_catiaPart.Part.Update();
        }
Beispiel #25
0
        //Außenverzahntes Stirnrad
        public void ErzeugeProfilAußen(Data dat)
        {
            //ERZEUGE SKIZZE
            //Geometrisches Set auswählen und umbennen

            HybridBodies catHybridBodies1 = hsp_catiaPart.Part.HybridBodies;
            HybridBody   catHybridBody1;

            try
            {
                catHybridBody1 = catHybridBodies1.Item("Geometrisches Set.1");
            }
            catch (Exception)
            {
                MessageBox.Show("Kein geometrisches Set gefunden! " + Environment.NewLine +
                                "Ein PART manuell erzeugen und ein darauf achten, dass 'Geometisches Set' aktiviert ist.",
                                "Fehler", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            catHybridBody1.set_Name("Profile");
            Sketches       catSketches1      = catHybridBody1.HybridSketches;
            OriginElements catOriginElements = hsp_catiaPart.Part.OriginElements;
            Reference      catReference1     = (Reference)catOriginElements.PlaneYZ;

            hsp_catiaProfil = catSketches1.Add(catReference1);

            //Erstelle Achsensystem

            ErzeugeAchsensystem();

            //Update
            hsp_catiaPart.Part.Update();



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

            //Radien und Winkel
            double teilkreisradius   = dat.getTeilkreisdurchmesser() / 2;
            double hilfskreisradius  = teilkreisradius * 0.94;
            double fußkreisradius    = teilkreisradius - (1.25 * dat.getModul());
            double kopfkreisradius   = teilkreisradius + dat.getModul();
            double verrundungsradius = 0.35 * dat.getModul();

            double alpha         = 20;
            double beta          = 90 / dat.getZähnezahl();
            double betarad       = Math.PI * beta / 180;
            double gamma         = 90 - (alpha - beta);
            double gammarad      = Math.PI * gamma / 180;
            double totalangle    = 360.0 / dat.getZähnezahl();
            double totalanglerad = Math.PI * totalangle / 180;

            //Schnittpunkte und Koordinaten
            //Evolventenkreis Center Koordinaten
            double mittelpunktEvol_x = hilfskreisradius * Math.Cos(gammarad);
            double mittelpunktEvol_y = hilfskreisradius * Math.Sin(gammarad);

            //Schnittpkt. der Evolvente und dem Teilkreisradius
            double punktEvol_x = -teilkreisradius *Math.Sin(betarad);

            double punktEvol_y = teilkreisradius * Math.Cos(betarad);

            //Evolvente Radius
            double EvolventenkreisRadius = Math.Sqrt(Math.Pow((mittelpunktEvol_x - punktEvol_x), 2) + Math.Pow((mittelpunktEvol_y - punktEvol_y), 2));

            //Schnittpunkt Kopfkreis und Evolventenkreis
            double evolventenKopfk_x = Schnittpunkt_X(x0, y0, kopfkreisradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius);
            double evolventenKopfk_y = Schnittpunkt_Y(x0, y0, kopfkreisradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius);

            //Center Verrundung
            double mittelpunktVer_x = Schnittpunkt_X(x0, y0, fußkreisradius + verrundungsradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius + verrundungsradius);
            double mittelpunktVer_y = Schnittpunkt_Y(x0, y0, fußkreisradius + verrundungsradius, mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius + verrundungsradius);

            //Schnittpunkt Verrundung Evolventenkreis
            double evolventenVer_x = Schnittpunkt_X(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);
            double evolventenVer_y = Schnittpunkt_Y(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);

            //Schnittpunkt Verrundung Fußkreis
            double fußkreisVer_x = Schnittpunkt_X(x0, y0, fußkreisradius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);
            double fußkreisVer_y = Schnittpunkt_Y(x0, y0, fußkreisradius, mittelpunktVer_x, mittelpunktVer_y, verrundungsradius);

            //Anfangspunkt Fußkreis
            double hilfswinkel        = totalanglerad - Math.Atan(Math.Abs(fußkreisVer_x) / Math.Abs(fußkreisVer_y));
            double anfangspunktFußk_x = -fußkreisradius *Math.Sin(hilfswinkel);

            double anfangspunktFußk_y = fußkreisradius * Math.Cos(hilfswinkel);

            //Skizze umbenennen und öffnen
            hsp_catiaProfil.set_Name("Außenverzahntes Stirnrad");
            Factory2D catfactory2D1 = hsp_catiaProfil.OpenEdition();

            //Punkte in Skizze einzeichnen
            Point2D point_Ursprung             = catfactory2D1.CreatePoint(x0, y0);
            Point2D pointAnfangFußkreis        = catfactory2D1.CreatePoint(anfangspunktFußk_x, anfangspunktFußk_y);
            Point2D pointFußkreisVer_l         = catfactory2D1.CreatePoint(fußkreisVer_x, fußkreisVer_y);
            Point2D pointFußkreisVer_r         = catfactory2D1.CreatePoint(-fußkreisVer_x, fußkreisVer_y);
            Point2D pointMittelpunktVer_l      = catfactory2D1.CreatePoint(mittelpunktVer_x, mittelpunktVer_y);
            Point2D pointMittelpunktVer_r      = catfactory2D1.CreatePoint(-mittelpunktVer_x, mittelpunktVer_y);
            Point2D pointVerrundungEvol_l      = catfactory2D1.CreatePoint(evolventenVer_x, evolventenVer_y);
            Point2D pointVerrundungEvol_r      = catfactory2D1.CreatePoint(-evolventenVer_x, evolventenVer_y);
            Point2D pointMittelpunktevol_l     = catfactory2D1.CreatePoint(mittelpunktEvol_x, mittelpunktEvol_y);
            Point2D pointMittelpunktevol_r     = catfactory2D1.CreatePoint(-mittelpunktEvol_x, mittelpunktEvol_y);
            Point2D pointEvolventenKopfkreis_l = catfactory2D1.CreatePoint(evolventenKopfk_x, evolventenKopfk_y);
            Point2D pointEvolventenKopfkreis_r = catfactory2D1.CreatePoint(-evolventenKopfk_x, evolventenKopfk_y);

            //Kreise in Skizze einzeichnen
            Circle2D kreisFußkreis = catfactory2D1.CreateCircle(x0, y0, fußkreisradius, 0, Math.PI * 2);

            kreisFußkreis.CenterPoint = point_Ursprung;
            kreisFußkreis.StartPoint  = pointFußkreisVer_l;
            kreisFußkreis.EndPoint    = pointAnfangFußkreis;

            Circle2D kreisVerrundung_l = catfactory2D1.CreateCircle(mittelpunktVer_x, mittelpunktVer_y, verrundungsradius, 0, Math.PI * 2);

            kreisVerrundung_l.CenterPoint = pointMittelpunktVer_l;
            kreisVerrundung_l.StartPoint  = pointFußkreisVer_l;
            kreisVerrundung_l.EndPoint    = pointVerrundungEvol_l;

            Circle2D kreisEvolventenkreis_l = catfactory2D1.CreateCircle(mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, 0, Math.PI * 2);

            kreisEvolventenkreis_l.CenterPoint = pointMittelpunktevol_l;
            kreisEvolventenkreis_l.StartPoint  = pointEvolventenKopfkreis_l;
            kreisEvolventenkreis_l.EndPoint    = pointVerrundungEvol_l;

            Circle2D kreisKopfkreis = catfactory2D1.CreateCircle(x0, y0, kopfkreisradius, 0, Math.PI * 2);

            kreisKopfkreis.CenterPoint = point_Ursprung;
            kreisKopfkreis.StartPoint  = pointEvolventenKopfkreis_r;
            kreisKopfkreis.EndPoint    = pointEvolventenKopfkreis_l;

            Circle2D kreisEvolventenkreis_r = catfactory2D1.CreateCircle(-mittelpunktEvol_x, mittelpunktEvol_y, EvolventenkreisRadius, 0, Math.PI * 2);

            kreisEvolventenkreis_r.CenterPoint = pointMittelpunktevol_r;
            kreisEvolventenkreis_r.StartPoint  = pointVerrundungEvol_r;
            kreisEvolventenkreis_r.EndPoint    = pointEvolventenKopfkreis_r;

            Circle2D kreisVerrundung_r = catfactory2D1.CreateCircle(-mittelpunktVer_x, mittelpunktVer_y, verrundungsradius, 0, Math.PI * 2);

            kreisVerrundung_r.CenterPoint = pointMittelpunktVer_r;
            kreisVerrundung_r.StartPoint  = pointVerrundungEvol_r;
            kreisVerrundung_r.EndPoint    = pointFußkreisVer_r;


            //Skizze schließen
            hsp_catiaProfil.CloseEdition();

            //Update
            hsp_catiaPart.Part.Update();



            //ERSTELLE KREISMUSTER
            ShapeFactory       shapeFactory1       = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;
            HybridShapeFactory hybridShapeFactory1 = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;

            Factory2D factory2D1 = hsp_catiaProfil.Factory2D;

            HybridShapePointCoord ursprung    = hybridShapeFactory1.AddNewPointCoord(0, 0, 0);
            Reference             refUrsprung = hsp_catiaPart.Part.CreateReferenceFromObject(ursprung);

            HybridShapeDirection xRichtung    = hybridShapeFactory1.AddNewDirectionByCoord(1, 0, 0);
            Reference            refxRichtung = hsp_catiaPart.Part.CreateReferenceFromObject(xRichtung);

            CircPattern kreismuster = shapeFactory1.AddNewSurfacicCircPattern(factory2D1, 1, 2, 0, 0, 1, 1, refUrsprung, refxRichtung, false, 0, true, false);

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

            angle1.Value = Convert.ToDouble(360 / dat.getZähnezahl());
            AngularRepartition angularRepartition2 = kreismuster.AngularRepartition;
            IntParam           intParam1           = angularRepartition2.InstancesCount;

            intParam1.Value = Convert.ToInt32(dat.getZähnezahl()) + 1;


            //Kreismusterenden verbinden

            Reference           refKreismuster = hsp_catiaPart.Part.CreateReferenceFromObject(kreismuster);
            HybridShapeAssemble verbindung     = hybridShapeFactory1.AddNewJoin(refKreismuster, refKreismuster);
            Reference           refVerbindung  = hsp_catiaPart.Part.CreateReferenceFromObject(verbindung);

            hybridShapeFactory1.GSMVisibility(refVerbindung, 0);

            hsp_catiaPart.Part.MainBody.InsertHybridShape(verbindung);

            //Update
            hsp_catiaPart.Part.Update();


            //ERSTELLE BLOCK
            ErzeugeBlock(refVerbindung, shapeFactory1, dat);


            if (dat.Bohrungsauswahl == 1)
            {
                //Skizze
                Sketches       sketchesBohrung   = catHybridBody1.HybridSketches;
                OriginElements catoriginelements = hsp_catiaPart.Part.OriginElements;
                Reference      refmxPlaneX       = (Reference)catoriginelements.PlaneYZ;
                hsp_catiaProfil = catSketches1.Add(refmxPlaneX);

                //Achsensystem
                ErzeugeAchsensystem();

                //Update
                hsp_catiaPart.Part.Update();

                //Skizze Umbennen
                hsp_catiaProfil.set_Name("Bohrung");

                //Öffnen
                Factory2D catfactory2D2 = hsp_catiaProfil.OpenEdition();

                //Kreis
                Circle2D KreisFürBohrungsskizze = catfactory2D2.CreateClosedCircle(x0, y0, dat.getBohrung());

                //Schließen
                hsp_catiaProfil.CloseEdition();

                //Update
                hsp_catiaPart.Part.Update();

                //Tasche
                hsp_catiaPart.Part.InWorkObject = hsp_catiaPart.Part.MainBody;
                Pocket Tasche = shapeFactory1.AddNewPocket(hsp_catiaProfil, dat.getBreite());
                hsp_catiaPart.Part.Update();
            }
            if (dat.Bohrungsauswahl == 2)
            {
                //Schnittpunkte und Koordinaten
                //LH Schnittpunkt Passfederhöhe mit Bohrung
                double x_AnfangkreisZuPassfeder = -dat.getPassfederbreite() / 2;
                double y_AnfangkreisZuPassfeder = Math.Sqrt(Math.Pow(dat.getBohrung(), 2) - Math.Pow((dat.getPassfederbreite() / 2), 2));

                //LH Schnittpunkt Breite und Höhe
                double x_Passfederecke = -dat.getPassfederbreite() / 2;
                double y_Passfederecke = dat.getPassfederhöhe();

                //Skizze
                Sketches       sketchesBohrung   = catHybridBody1.HybridSketches;
                OriginElements catoriginelements = hsp_catiaPart.Part.OriginElements;
                Reference      refmxPlaneX       = (Reference)catoriginelements.PlaneYZ;
                hsp_catiaProfil = catSketches1.Add(refmxPlaneX);

                //Achsensystem
                ErzeugeAchsensystem();

                //Update
                hsp_catiaPart.Part.Update();

                //Umbennen und öffnen
                hsp_catiaProfil.set_Name("Bohrung mit Passfedernut");
                Factory2D catfactory2D2 = hsp_catiaProfil.OpenEdition();



                //Punkte in Skizze einzeichnen
                Point2D POINTLinksAnfangKreisZuPassfeder  = catfactory2D2.CreatePoint(x_AnfangkreisZuPassfeder, y_AnfangkreisZuPassfeder);
                Point2D POINTLinksPassfederEcke           = catfactory2D2.CreatePoint(x_Passfederecke, y_Passfederecke);
                Point2D POINTRechtsPassfederEcke          = catfactory2D2.CreatePoint(-x_Passfederecke, y_Passfederecke);
                Point2D POINTRechtsAnfangKreisZuPassfeder = catfactory2D2.CreatePoint(-x_AnfangkreisZuPassfeder, y_AnfangkreisZuPassfeder);

                //Linien einzeichnen
                Line2D PassfederKanteLinks = catfactory2D2.CreateLine(x_AnfangkreisZuPassfeder, y_AnfangkreisZuPassfeder, x_Passfederecke, y_Passfederecke);
                PassfederKanteLinks.StartPoint = POINTLinksAnfangKreisZuPassfeder;
                PassfederKanteLinks.EndPoint   = POINTLinksPassfederEcke;

                Line2D PassfederHöhenkante = catfactory2D2.CreateLine(x_Passfederecke, y_Passfederecke, -x_Passfederecke, y_Passfederecke);
                PassfederHöhenkante.StartPoint = POINTLinksPassfederEcke;
                PassfederHöhenkante.EndPoint   = POINTRechtsPassfederEcke;

                Line2D PassfederKanteRechts = catfactory2D2.CreateLine(-x_Passfederecke, y_Passfederecke, -x_AnfangkreisZuPassfeder, y_AnfangkreisZuPassfeder);
                PassfederKanteRechts.StartPoint = POINTRechtsPassfederEcke;
                PassfederKanteRechts.EndPoint   = POINTRechtsAnfangKreisZuPassfeder;

                Circle2D KreisFürPassfeder = catfactory2D2.CreateCircle(x0, y0, dat.getBohrung(), 0, Math.PI * 2);
                KreisFürPassfeder.CenterPoint = point_Ursprung;
                KreisFürPassfeder.EndPoint    = POINTRechtsAnfangKreisZuPassfeder;
                KreisFürPassfeder.StartPoint  = POINTLinksAnfangKreisZuPassfeder;

                //Skizze schließen
                hsp_catiaProfil.CloseEdition();


                //Update
                hsp_catiaPart.Part.Update();

                //Tasche
                hsp_catiaPart.Part.InWorkObject = hsp_catiaPart.Part.MainBody;
                Pocket Tasche = shapeFactory1.AddNewPocket(hsp_catiaProfil, dat.getBreite());
                hsp_catiaPart.Part.Update();
            }
        }
Beispiel #26
0
        private void ErstelleTascheProfil(object[] ParameterListe)
        {
            double Kopfhöhe       = Convert.ToDouble(ParameterListe[7]);
            double Durchmesser    = Convert.ToDouble(ParameterListe[1]);
            double Schlüsseltiefe = 0 - Durchmesser / 2;

            // Listen Werte wieder in richtige Datentypen umwandeln
            int    Kopf              = Convert.ToInt32(ParameterListe[0]);
            double Gewindelänge      = Convert.ToDouble(ParameterListe[2]);
            double Schaftlänge       = Convert.ToDouble(ParameterListe[3]);
            double Steigung          = Convert.ToDouble(ParameterListe[4]);
            int    Gewindeart        = Convert.ToInt32(ParameterListe[5]);
            double Schlüsselweite    = Convert.ToDouble(ParameterListe[6]);
            double Kopfdurchmesser   = Convert.ToDouble(ParameterListe[8]);
            string Schraubenrichtung = Convert.ToString(ParameterListe[9]);

            // Skizze umbenennen
            hsp_catiaProfil_Schlüssel.set_Name("Schlüssel");
            // Skizze oeffnen
            Factory2D catFactory2D3 = hsp_catiaProfil_Schlüssel.OpenEdition();

            //Eckkoordinaten berechnen
            double Grad      = 30;
            double Halbkreis = 180;
            double Winkel    = Grad / Halbkreis * Math.PI;
            double swr       = Schlüsselweite / 2;
            double x         = Math.Tan(Winkel) * swr;
            double h         = Schlüsselweite / (2 * Math.Cos(Winkel));


            //Punkte zeichnen
            Point2D catPoint2D1 = catFactory2D3.CreatePoint(-x, swr);
            Point2D catPoint2D2 = catFactory2D3.CreatePoint(x, swr);
            Point2D catPoint2D3 = catFactory2D3.CreatePoint(h, 0);
            Point2D catPoint2D4 = catFactory2D3.CreatePoint(x, -swr);
            Point2D catPoint2D5 = catFactory2D3.CreatePoint(-x, -swr);
            Point2D catPoint2D6 = catFactory2D3.CreatePoint(-h, 0);

            //Linien zeichnen
            Line2D catLine2D1 = catFactory2D3.CreateLine(-x, swr, x, swr);

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

            Line2D catLine2D2 = catFactory2D3.CreateLine(x, swr, h, 0);

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

            Line2D catLine2D3 = catFactory2D3.CreateLine(h, 0, x, -swr);

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

            Line2D catLine2D4 = catFactory2D3.CreateLine(x, -swr, -x, -swr);

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

            Line2D catLine2D5 = catFactory2D3.CreateLine(-x, -swr, -h, 0);

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

            Line2D catLine2D6 = catFactory2D3.CreateLine(-h, 0, -x, swr);

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

            // Skizzierer verlassen
            hsp_catiaProfil_Schlüssel.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.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 #28
0
        // Separate Skizzenerzeugung für de Helix
        public Sketch makeGewindeSkizze(object[] ParameterListe)
        {
            // Listen Werte wieder in richtige Datentypen umwandeln
            int    Kopf              = Convert.ToInt32(ParameterListe[0]);
            double Durchmesser       = Convert.ToDouble(ParameterListe[1]);
            double Gewindelänge      = Convert.ToDouble(ParameterListe[2]);
            double Schaftlänge       = Convert.ToDouble(ParameterListe[3]);
            double Steigung          = Convert.ToDouble(ParameterListe[4]);
            int    Gewindeart        = Convert.ToInt32(ParameterListe[5]);
            double Schlüsselweite    = Convert.ToDouble(ParameterListe[6]);
            double Kopfhöhe          = Convert.ToDouble(ParameterListe[7]);
            double Kopfdurchmesser   = Convert.ToDouble(ParameterListe[8]);
            string Schraubenrichtung = Convert.ToString(ParameterListe[9]);

            double Gesamtlänge = Gewindelänge + Schaftlänge + Kopfhöhe;
            Double P           = Steigung;
            Double Ri          = Durchmesser / 2;

            OriginElements catOriginElements = hsp_catiaPart.Part.OriginElements;

            //Reference catReference3 = (Reference)catOriginElements.PlaneXY;

            hsp_catiaPart.Part.InWorkObject = hsp_catiaProfil_Gewinde;
            hsp_catiaProfil_Gewinde.set_Name("Gewinde");

            double V_oben_links = Gesamtlänge - (((((Math.Sqrt(3) / 2) * P) / 6) + 0.6134 * P) * Math.Tan((30 * Math.PI) / 180));
            double H_oben_links = Ri;

            double V_oben_rechts = Gesamtlänge + (((((Math.Sqrt(3) / 2) * P) / 6) + 0.6134 * P) * Math.Tan((30 * Math.PI) / 180));
            double H_oben_rechts = Ri;

            double V_unten_links = Gesamtlänge - ((0.1443 * P) * Math.Sin((60 * Math.PI) / 180));
            double H_unten_links = Ri - (0.6134 * P - 0.1443 * P) - Math.Sqrt(Math.Pow((0.1443 * P), 2) - Math.Pow((0.1443 * P) * Math.Sin((60 * Math.PI) / 180), 2));

            double V_unten_rechts = Gesamtlänge + (0.1443 * P) * Math.Sin((60 * Math.PI) / 180);
            double H_unten_rechts = Ri - (0.6134 * P - 0.1443 * P) - Math.Sqrt(Math.Pow((0.1443 * P), 2) - Math.Pow((0.1443 * P) * Math.Sin((60 * Math.PI) / 180), 2));

            double V_Mittelpunkt = Gesamtlänge;
            double H_Mittelpunkt = Ri - ((0.6134 * P) - 0.1443 * P);

            Factory2D catFactory2D2 = hsp_catiaProfil_Gewinde.OpenEdition();

            Point2D Oben_links   = catFactory2D2.CreatePoint(H_oben_links, V_oben_links);
            Point2D Oben_rechts  = catFactory2D2.CreatePoint(H_oben_rechts, V_oben_rechts);
            Point2D Unten_links  = catFactory2D2.CreatePoint(H_unten_links, V_unten_links);
            Point2D Unten_rechts = catFactory2D2.CreatePoint(H_unten_rechts, V_unten_rechts);
            Point2D Mittelpunkt  = catFactory2D2.CreatePoint(H_Mittelpunkt, V_Mittelpunkt);

            Line2D Oben = catFactory2D2.CreateLine(H_oben_links, V_oben_links, H_oben_rechts, V_oben_rechts);

            Oben.StartPoint = Oben_links;
            Oben.EndPoint   = Oben_rechts;

            Line2D Rechts = catFactory2D2.CreateLine(H_oben_rechts, V_oben_rechts, H_unten_rechts, V_unten_rechts);

            Rechts.StartPoint = Oben_rechts;
            Rechts.EndPoint   = Unten_rechts;

            Circle2D Verrundung = catFactory2D2.CreateCircle(H_Mittelpunkt, V_Mittelpunkt, 0.1443 * P, 0, 0);

            Verrundung.CenterPoint = Mittelpunkt;
            Verrundung.StartPoint  = Unten_rechts;
            Verrundung.EndPoint    = Unten_links;

            Line2D Links = catFactory2D2.CreateLine(H_oben_links, V_oben_links, H_unten_links, V_unten_links);

            Links.StartPoint = Unten_links;
            Links.EndPoint   = Oben_links;

            hsp_catiaProfil_Gewinde.CloseEdition();
            hsp_catiaPart.Part.Update();

            return(hsp_catiaProfil_Gewinde);
        }
        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();
        }
        public void Rechteck_hohl_DrawSketch(double Rechteck_hohl_Breite, double Rechteck_hohl_Hoehe, double Wandstaerke)
        {
            double b = Rechteck_hohl_Breite;
            double h = Rechteck_hohl_Hoehe;
            double t = Wandstaerke;
            double bi = b - 2 * t;
            double hi = h - 2 * t;
            double ra, ri;

            // Berechnung der Eckenradien nach DIN EN 10219-2:2006 für Hohlprofile
            if (t <= 6)
            {
                ra = 1.6 * t;
            }
            else if (t <= 10)
            {
                ra = 2 * t;
            }
            else if (t > 10)
            {
                ra = 2.4 * t;
            }
            else
            {
                ra = 2.4 * t;
            }

            ri = ra - t;

            CATIA_Rechteck_hohl_2D.set_Name("Rechteck-Hohlprofil");

            Factory2D Rechteck_hohl_Factory = CATIA_Rechteck_hohl_2D.OpenEdition();

            // Definition der Radienmittelpunkte
            Point2D Mittelpunkt1            = Rechteck_hohl_Factory.CreatePoint(ra, ra);
            Point2D Mittelpunkt2            = Rechteck_hohl_Factory.CreatePoint((b - ra), ra);
            Point2D Mittelpunkt3            = Rechteck_hohl_Factory.CreatePoint((b - ra), (h - ra));
            Point2D Mittelpunkt4            = Rechteck_hohl_Factory.CreatePoint(ra, (h - ra));

            // Definition des äußeren Rechtecks
            Point2D Konturpunkt1 = Rechteck_hohl_Factory.CreatePoint(ra, 0);
            Point2D Konturpunkt2 = Rechteck_hohl_Factory.CreatePoint((b - ra), 0);
            Point2D Konturpunkt3 = Rechteck_hohl_Factory.CreatePoint(b, ra);
            Point2D Konturpunkt4 = Rechteck_hohl_Factory.CreatePoint(b, (h - ra));
            Point2D Konturpunkt5 = Rechteck_hohl_Factory.CreatePoint((b - ra), h);
            Point2D Konturpunkt6 = Rechteck_hohl_Factory.CreatePoint(ra, h);
            Point2D Konturpunkt7 = Rechteck_hohl_Factory.CreatePoint(0, (h - ra));
            Point2D Konturpunkt8 = Rechteck_hohl_Factory.CreatePoint(0, ra);

            Line2D Linie12 = Rechteck_hohl_Factory.CreateLine(ra, 0, (b - ra), 0);

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

            Line2D Linie34 = Rechteck_hohl_Factory.CreateLine(b, ra, b, (h - ra));

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

            Line2D Linie56 = Rechteck_hohl_Factory.CreateLine((b - ra), h, ra, h);

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

            Line2D Linie78 = Rechteck_hohl_Factory.CreateLine(0, (h - ra), 0, ra);

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

            Circle2D Eckenverrundung81 = Rechteck_hohl_Factory.CreateCircle(ra, ra, ra, 0, 0);

            Eckenverrundung81.CenterPoint = Mittelpunkt1;
            Eckenverrundung81.StartPoint  = Konturpunkt8;
            Eckenverrundung81.EndPoint    = Konturpunkt1;

            Circle2D Eckenverrundung23 = Rechteck_hohl_Factory.CreateCircle(0, 0, ra, 0, 0);

            Eckenverrundung23.CenterPoint = Mittelpunkt2;
            Eckenverrundung23.StartPoint  = Konturpunkt2;
            Eckenverrundung23.EndPoint    = Konturpunkt3;

            Circle2D Eckenverrundung45 = Rechteck_hohl_Factory.CreateCircle(0, 0, ra, 0, 0);

            Eckenverrundung45.CenterPoint = Mittelpunkt3;
            Eckenverrundung45.StartPoint  = Konturpunkt4;
            Eckenverrundung45.EndPoint    = Konturpunkt5;

            Circle2D Eckenverrundung67 = Rechteck_hohl_Factory.CreateCircle(0, 0, ra, 0, 0);

            Eckenverrundung67.CenterPoint = Mittelpunkt4;
            Eckenverrundung67.StartPoint  = Konturpunkt6;
            Eckenverrundung67.EndPoint    = Konturpunkt7;

            // Definition des inneren Rechtecks
            Point2D Konturpunkt_i1 = Rechteck_hohl_Factory.CreatePoint(ra, t);
            Point2D Konturpunkt_i2 = Rechteck_hohl_Factory.CreatePoint((b - ra), t);
            Point2D Konturpunkt_i3 = Rechteck_hohl_Factory.CreatePoint((b - t), ra);
            Point2D Konturpunkt_i4 = Rechteck_hohl_Factory.CreatePoint((b - t), (h - ra));
            Point2D Konturpunkt_i5 = Rechteck_hohl_Factory.CreatePoint((b - ra), (h - t));
            Point2D Konturpunkt_i6 = Rechteck_hohl_Factory.CreatePoint(ra, (h - t));
            Point2D Konturpunkt_i7 = Rechteck_hohl_Factory.CreatePoint(t, (h - ra));
            Point2D Konturpunkt_i8 = Rechteck_hohl_Factory.CreatePoint(t, ra);

            Line2D Linie_i12 = Rechteck_hohl_Factory.CreateLine(ra, t, (b - ra), t);

            Linie_i12.StartPoint = Konturpunkt_i1;
            Linie_i12.EndPoint   = Konturpunkt_i2;

            Line2D Linie_i34 = Rechteck_hohl_Factory.CreateLine((b - t), ra, (b - t), (h - ra));

            Linie_i34.StartPoint = Konturpunkt_i3;
            Linie_i34.EndPoint   = Konturpunkt_i4;

            Line2D Linie_i56 = Rechteck_hohl_Factory.CreateLine((b - ra), (h - t), ra, (h - t));

            Linie_i56.StartPoint = Konturpunkt_i5;
            Linie_i56.EndPoint   = Konturpunkt_i6;

            Line2D Linie_i78 = Rechteck_hohl_Factory.CreateLine(t, (h - ra), t, ra);

            Linie_i78.StartPoint = Konturpunkt_i7;
            Linie_i78.EndPoint   = Konturpunkt_i8;

            Circle2D Eckenverrundung_i81 = Rechteck_hohl_Factory.CreateCircle(ra, ra, ri, 0, 0);

            Eckenverrundung_i81.CenterPoint = Mittelpunkt1;
            Eckenverrundung_i81.StartPoint  = Konturpunkt_i8;
            Eckenverrundung_i81.EndPoint    = Konturpunkt_i1;

            Circle2D Eckenverrundung_i23 = Rechteck_hohl_Factory.CreateCircle((b - ra), ra, ri, 0, 0);

            Eckenverrundung_i23.CenterPoint = Mittelpunkt2;
            Eckenverrundung_i23.StartPoint  = Konturpunkt_i2;
            Eckenverrundung_i23.EndPoint    = Konturpunkt_i3;

            Circle2D Eckenverrundung_i45 = Rechteck_hohl_Factory.CreateCircle((b - ra), (h - ra), ri, 0, 0);

            Eckenverrundung_i45.CenterPoint = Mittelpunkt3;
            Eckenverrundung_i45.StartPoint  = Konturpunkt_i4;
            Eckenverrundung_i45.EndPoint    = Konturpunkt_i5;

            Circle2D Eckenverrundung_i67 = Rechteck_hohl_Factory.CreateCircle(ra, (h - ra), ri, 0, 0);

            Eckenverrundung_i67.CenterPoint = Mittelpunkt4;
            Eckenverrundung_i67.StartPoint  = Konturpunkt_i6;
            Eckenverrundung_i67.EndPoint    = Konturpunkt_i7;


            CATIA_Rechteck_hohl_2D.CloseEdition();

            CATIA_Rechteck_hohl_Part.Part.Update();
        }