Beispiel #1
0
        //Ende RundVoll


        //Halbrund
        //Erzeugen der Geometrie Halbrund
        internal void ErzeugeProfilHalbRund(HalbrundProfil neuHalbRund)
        {
            hspB1_catia_Profil.set_Name("Halbrund");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();

            //Setzen der Punkte
            Point2D catPoint2D1 = factory2D.CreatePoint(-neuHalbRund.Radius, 0);
            Point2D catPoint2D2 = factory2D.CreatePoint(neuHalbRund.Radius, 0);

            //Kreis Erzeugen
            Circle2D circle2D1 = factory2D.CreateClosedCircle(0.000000, 0.000000, neuHalbRund.Radius);

            circle2D1.StartPoint = catPoint2D2;
            circle2D1.EndPoint   = catPoint2D1;

            //Linie Ziehen
            Line2D line2D1 = factory2D.CreateLine(-(neuHalbRund.Radius), 0.000000, neuHalbRund.Radius, 0.000000);

            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
Beispiel #2
0
    public void ErzeugeDreieckprofil(string currentItemName, double[] parameterListe)
    {
        double b = parameterListe[0];
        double h = parameterListe[1];

        // 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(0, h / 2);
        Point2D catPoint2D3 = catFactory2D1.CreatePoint(-b / 2, -h / 2);
        // dann die Linien
        Line2D catLine2D1 = catFactory2D1.CreateLine(b / 2, -h / 2, 0, h / 2);

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

        Line2D catLine2D2 = catFactory2D1.CreateLine(0, 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   = catPoint2D1;

        // Skizzierer verlassen
        hsp_catiaProfil.CloseEdition();
        // Part aktualisieren
        hsp_catiaPart.Part.Update();
    }
Beispiel #3
0
        //Ende I Profil


        //Hier Enden die Formprofile!!!



        // Hier beginnen die runden Profile!!!

        //Anfang RundHohlProfil!!

        internal void ErzeugeProfilRundHohlProfil(RundHohlProfil rundHohlProfil)
        {
            hspB1_catia_Profil.set_Name("RundHohlProfil");
            Factory2D factory2D = hspB1_catia_Profil.OpenEdition();


            //Setzen der Punkte/Kreise

            Point2D catpoint2D1 = factory2D.CreatePoint(0, 0);

            Circle2D catCircle2D1 = factory2D.CreateCircle(0, 0, rundHohlProfil.Durchmesser / 2, 0, 0);

            catCircle2D1.CenterPoint = catpoint2D1;

            Circle2D catCircle2D2 = factory2D.CreateCircle(0, 0, (rundHohlProfil.Durchmesser / 2 - rundHohlProfil.Wandstärke), 0, 0);

            catCircle2D2.CenterPoint = catpoint2D1;


            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();

            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
        public bool ErzeugeProfilRohr(Double aussendurchmesser)
        {
            if (aussendurchmesser > 0)
            {
                // Skizze umbenennen
                catiaSketch.set_Name("Rohr");

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

                Circle2D circle2D1   = catFactory2D1.CreateClosedCircle(0.000000, 0.000000, aussendurchmesser / 2);
                Point2D  catPoint2D1 = catFactory2D1.CreatePoint(0, 0);
                circle2D1.CenterPoint = catPoint2D1;

                catiaSketch.CloseEdition();
                catiaPart.Part.Update();
                skizzeerstellt = true;
            }
            else
            {
                MessageBox.Show("Fehler beim Erstellen des Profils:\rDie Werte dürfen nicht null sein!");
                skizzeerstellt = false;
            }
            return(skizzeerstellt);
        }
Beispiel #5
0
        public virtual void Cleanup()
        {
            Context?.ClearState();
            Context?.Flush();

            BackBuffer?.Dispose();
            BackBuffer = null;
            ZBuffer?.Dispose();
            ZBuffer = null;

            RenderTargetViewRef?.Dispose();
            RenderTargetViewRef = null;

            DepthStencilSRVRef?.Dispose();
            DepthStencilSRVRef = null;

            DepthStencilViewRef?.Dispose();
            DepthStencilViewRef = null;

            FactoryDWrite?.Dispose();
            FactoryDWrite = null;
            Factory2D?.Dispose();
            Factory2D = null;
            RenderTarget2D?.Dispose();
            RenderTarget2D = null;

            Context?.Dispose();
            DeviceRef?.Dispose();
            DeviceRef = null;
        }
Beispiel #6
0
        public void ErzeugeRechteck(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 #7
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();
        }
        public static Line2D DrawLine(this Factory2D F, Point2D Start, Point2D End)
        {
            Line2D L = F.CreateLine(Start.GetPos(), End.GetPos());

            L.StartPoint = Start;
            L.EndPoint   = End;
            return(L);
        }
Beispiel #9
0
        public void ErzeugeRechteckRohr(Double r_ah, Double r_ih, Double r_ab, Double r_ib)
        {
            hsp_catiaProfil.set_Name("RechteckRohr");
            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            hsp_catiaProfil.CloseEdition();
            hsp_catiaPart.Part.Update();
        }
Beispiel #10
0
        private Sketch Gewindeskizze(Schraube arr)
        {
            // Referenzen für Skizze festlegen
            OriginElements catoriginElements = part_Schraube.OriginElements;
            Reference      RefPlanezx        = (Reference)catoriginElements.PlaneZX;

            //Neue Skizze erstellen
            Sketch Skizze_gewinde = sketches_Schraube.Add(RefPlanezx);

            part_Schraube.InWorkObject = Skizze_gewinde;
            Skizze_gewinde.set_Name("Gewinde");

            //Koordinaten Für gewindeSkizze berechnen
            double zInnen = 0.5 * arr.kerndurchmesser + arr.gewinderundung - Math.Sin((30 * Math.PI) / 180) * arr.gewinderundung;
            double xInnen = Math.Cos((30 * Math.PI) / 180) * arr.gewinderundung;

            double zAußen = 0.5 * arr.durchmesser;
            double xAußen = 2 * 0.1875 * arr.gewindesteigung;

            double zRadius = 0.5 * (arr.kerndurchmesser + arr.gewinderundung);
            double xRadius = 0;

            // Geometrie zeichnen
            Factory2D catfactory2D2 = Skizze_gewinde.OpenEdition();

            Point2D geweindepunkt1 = catfactory2D2.CreatePoint(zInnen, -xInnen);
            Point2D geweindepunkt2 = catfactory2D2.CreatePoint(zInnen, xInnen);

            Point2D geweindepunkt3 = catfactory2D2.CreatePoint(zAußen, xAußen);
            Point2D geweindepunkt4 = catfactory2D2.CreatePoint(zAußen, -xAußen);

            Point2D geweindepunkt5 = catfactory2D2.CreatePoint(zRadius, xRadius);

            Line2D linieOben = catfactory2D2.CreateLine(zInnen, xInnen, zAußen, xAußen);

            linieOben.StartPoint = geweindepunkt2;
            linieOben.EndPoint   = geweindepunkt3;

            Line2D linieAußen = catfactory2D2.CreateLine(zAußen, xAußen, zAußen, -xAußen);

            linieAußen.StartPoint = geweindepunkt3;
            linieAußen.EndPoint   = geweindepunkt4;

            Line2D linieUnten = catfactory2D2.CreateLine(zAußen, -xAußen, zInnen, -xInnen);

            linieUnten.StartPoint = geweindepunkt4;
            linieUnten.EndPoint   = geweindepunkt1;

            Circle2D gewindeRundung = catfactory2D2.CreateCircle(zRadius, xRadius, arr.gewinderundung, 0, 0);

            gewindeRundung.CenterPoint = geweindepunkt5;
            gewindeRundung.EndPoint    = geweindepunkt1;
            gewindeRundung.StartPoint  = geweindepunkt2;

            Skizze_gewinde.CloseEdition();

            return(Skizze_gewinde);
        }
        public override void ErzeugeProfil(Double b, Double h, Double p, Double q)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("L-Profil");

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

            // Rechteck erzeugen

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

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

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

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

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

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

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

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

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

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

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

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

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



            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #12
0
 public void Dispose()
 {
     ImagingFactory.Dispose();
     Factory2D.Dispose();
     FontFactory.Dispose();
     SwapChain.Dispose();
     Device2D.Dispose();
     DeviceContext.Dispose();
 }
Beispiel #13
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 #14
0
        public void ErzeugeLProfil(Double Hoehe, Double Breite, Double Wandstaerke)
        {
            // Skizze umbenennen
            hsp_catiaProfil.set_Name("L-Profil");

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

            // U-Profil erzeugen

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

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

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

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

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

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

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

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

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

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

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

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

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

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();

            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #15
0
        //Ende RundVoll

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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



            // Skizzierer verlassen
            hspB1_catia_Profil.CloseEdition();


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

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

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

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

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

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

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

            UpperCircle.EndPoint   = LeftUpper.StartPoint;
            UpperCircle.StartPoint = RightUpperUpper.StartPoint;

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

            LowerCircle.StartPoint = LeftLower.StartPoint;
            LowerCircle.EndPoint   = RightLower.StartPoint;

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

            BarLower.StartPoint = BarLowerStart;

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

            BarUpper.StartPoint = BarUpperStart;

            double   UpperX    = BarUpper.EndPoint.GetPos().X;
            double   UpperY    = BarUpper.EndPoint.GetPos().Y;
            double   LowerY    = BarLower.EndPoint.GetPos().Y;
            double   R         = (UpperY - LowerY) / 2;
            Circle2D BarCircle = F.CreateCircle(UpperX, LowerY + R, R, -Math.PI / 2, Math.PI / 2);

            BarCircle.EndPoint   = BarUpper.EndPoint;
            BarCircle.StartPoint = BarLower.EndPoint;
        }
Beispiel #17
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 #18
0
        public static void CreateCylinder(double thickness, double radius)
        {
            oCurrentSketch = oPartBody.Sketches.Add(oPlaneYZ);
            Factory2D oFactory2D = (Factory2D)oCurrentSketch.OpenEdition();

            oCurrentCircle1 = oFactory2D.CreateClosedCircle(iCenterX, iCenterY, radius);
            oCurrentSketch.CloseEdition();
            ShapeFactory oShapeFactory = (ShapeFactory)oPart;
            Pad          oPad          = oShapeFactory.AddNewPad(oCurrentSketch, thickness + iCurrentLevel);

            oPad.SecondLimit.Dimension.Value = iCurrentLevel * -1;
            iCurrentLevel = iCurrentLevel + thickness;
        }
Beispiel #19
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();
        }
        public bool ErzeugeProfilRechteckrohr(Double breite, Double laenge)
        {
            if (breite == 0 | laenge == 0)
            {
                MessageBox.Show("Fehler beim Erstellen des Profils:\rDie Werte dürfen nicht null sein!");
                skizzeerstellt = false;
            }
            else
            {
                breite = breite / 2;
                laenge = laenge / 2;
                // Skizze umbenennen
                catiaSketch.set_Name("Rechteckrohr");

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

                // Rechteck erzeugen

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

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

                Line2D catLine2D2 = catFactory2D1.CreateLine(breite, laenge, breite, -laenge);
                catLine2D2.StartPoint = catPoint2D2;
                catLine2D2.EndPoint   = catPoint2D3;

                Line2D catLine2D3 = catFactory2D1.CreateLine(breite, -laenge, -breite, -laenge);
                catLine2D3.StartPoint = catPoint2D3;
                catLine2D3.EndPoint   = catPoint2D4;

                Line2D catLine2D4 = catFactory2D1.CreateLine(-breite, -laenge, -breite, laenge);
                catLine2D4.StartPoint = catPoint2D4;
                catLine2D4.EndPoint   = catPoint2D1;

                // Skizzierer verlassen
                catiaSketch.CloseEdition();
                // Part aktualisieren
                catiaPart.Part.Update();
                skizzeerstellt = true;
            }
            return(skizzeerstellt);
        }
        public bool ErzeugeProfilDoppelTTräger(Double b, Double h)
        {
            b = b / 2;
            h = h / 2;
            if (b > 0 & h > 0)
            {
                // Skizze umbenennen
                catiaSketch.set_Name("Doppel T-Träger");

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

                // Rechteck erzeugen

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

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

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

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

                Line2D catLine2D4 = catFactory2D1.CreateLine(-b, -h, -b, h);
                catLine2D4.StartPoint = catPoint2D4;
                catLine2D4.EndPoint   = catPoint2D1;

                // Skizzierer verlassen
                catiaSketch.CloseEdition();
                // Part aktualisieren
                catiaPart.Part.Update();
                skizzeerstellt = true;
            }
            else
            {
                MessageBox.Show("Fehler beim Erstellen des Profils:\rDie Werte dürfen nicht null sein!");
                skizzeerstellt = false;
            }
            return(skizzeerstellt);
        }
        public void ErzeugeProfil(int z, double b, double m, double p, double c, double df, double hf, double h, double ha, double da)
        {
            //                                                Punkte
            //Nullpunkte
            double x0     = 0;
            double y0     = 0;
            double radius = 20;

            //Startpunkte
            double StartPkt_Fußkreis_x  = x0;
            double StartPkt_Fußkreis_y  = df / 2;
            double StartPkt_Kopfkreis_x = x0;
            double StartPkt_Kopfkreis_y = da / 2;
            //Endpunkte
            double EndPkt_Kopfkreis_x = p / 2;
            double EndPkt_Kopfkreis_y = da / 2;
            double EndPkt_Fußkreis_x  = p / 2;
            double EndPkt_Fußkreis_y  = df / 2;
            //Winkelpunkt
            double Alpha           = z / 2 * Math.PI;
            double EndPkt_Radius_x = Math.Sin(90 * Math.PI / 180 - Alpha) * df / 2;
            double EndPkt_Radius_y = Math.Cos(90 * Math.PI / 180 - Alpha) * df / 2;



            Factory2D catFactory2D1 = hsp_catiaProfil.OpenEdition();

            Point2D catP2D_MPkt_Radius = catFactory2D1.CreatePoint(x0, y0);

            Point2D catP2D_StartPkt_Fußkreis  = catFactory2D1.CreatePoint(StartPkt_Fußkreis_x, StartPkt_Fußkreis_y);
            Point2D catP2D_StartPkt_Kopfkreis = catFactory2D1.CreatePoint(StartPkt_Kopfkreis_x, StartPkt_Kopfkreis_y);
            Point2D catP2D_EndPkt_Kopfkreis   = catFactory2D1.CreatePoint(EndPkt_Kopfkreis_x, EndPkt_Kopfkreis_y);
            Point2D catP2D_EndPkt_Fußkreis    = catFactory2D1.CreatePoint(EndPkt_Fußkreis_x, EndPkt_Fußkreis_y);
            Point2D catP2D_EndPkt_Radius      = catFactory2D1.CreatePoint(EndPkt_Radius_x, EndPkt_Radius_y);


            //                                               Linien

            Line2D catLine2D1 = catFactory2D1.CreateLine(StartPkt_Fußkreis_x, StartPkt_Fußkreis_y, StartPkt_Kopfkreis_x, StartPkt_Kopfkreis_y);
            Line2D catLine2D2 = catFactory2D1.CreateLine(StartPkt_Kopfkreis_x, StartPkt_Kopfkreis_y, EndPkt_Kopfkreis_x, EndPkt_Kopfkreis_y);
            Line2D catLine2D3 = catFactory2D1.CreateLine(EndPkt_Kopfkreis_x, EndPkt_Kopfkreis_y, EndPkt_Fußkreis_x, EndPkt_Fußkreis_y);
            //  Line2D catLine2D4 = catFactory2D1.CreateLine(EndPkt_Fußkreis_x, EndPkt_Fußkreis_y,EndPkt_Radius_x, EndPkt_Radius_y);

            Circle2D catC2D_Fußkreis = catFactory2D1.CreateCircle(catP2D_MPkt_Radius, radius);

            // Skizzierer verlassen
            hsp_catiaProfil.CloseEdition();
            // Part aktualisieren
            hsp_catiaPart.Part.Update();
        }
Beispiel #23
0
        public void Dispose()
        {
#if DEBUG
            _debug.ReportLiveDeviceObjects(ReportingLevel.Detail | ReportingLevel.IgnoreInternal);
            _debug.Dispose();
#endif
            Device.Dispose();
            _swapChain.Dispose();
            _backBuffer.Dispose();
            _renderTarget.Dispose();
            Context.Dispose();
            Factory2D.Dispose();
            FactoryDWrite.Dispose();
        }
Beispiel #24
0
        public void ErzeugeKreismusterAußenverzahnung(Data dat)
        {
            ShapeFactory       SF  = (ShapeFactory)hsp_catiaPart.Part.ShapeFactory;
            HybridShapeFactory HSF = (HybridShapeFactory)hsp_catiaPart.Part.HybridShapeFactory;

            //Skizze und Referenzen
            Factory2D Factory2D1 = hsp_catiaProfil.Factory2D;

            HybridShapePointCoord Ursprung    = HSF.AddNewPointCoord(0, 0, 0);
            Reference             RefUrsprung = hsp_catiaPart.Part.CreateReferenceFromObject(Ursprung);
            HybridShapeDirection  XDir        = HSF.AddNewDirectionByCoord(1, 0, 0);
            Reference             RefXDir     = hsp_catiaPart.Part.CreateReferenceFromObject(XDir);

            //Kreismuster mit Daten fü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 / dat.getZaehnezahlZahnrad1());
            AngularRepartition angularRepartition2 = Kreismuster.AngularRepartition;
            IntParam           intParam1           = angularRepartition2.InstancesCount;

            intParam1.Value = Convert.ToInt32(dat.getZaehnezahlZahnrad1()) + 1;

            //geschlossene Kontur
            Reference           Ref_Kreismuster = hsp_catiaPart.Part.CreateReferenceFromObject(Kreismuster);
            HybridShapeAssemble Verbindung      = HSF.AddNewJoin(Ref_Kreismuster, Ref_Kreismuster);
            Reference           Ref_Verbindung  = hsp_catiaPart.Part.CreateReferenceFromObject(Verbindung);

            HSF.GSMVisibility(Ref_Verbindung, 0);

            hsp_catiaPart.Part.Update();

            Bodies bodies = hsp_catiaPart.Part.Bodies;
            Body   myBody = bodies.Add();

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

            hsp_catiaPart.Part.Update();

            //Erzeuge Block aus Skizze
            hsp_catiaPart.Part.InWorkObject = myBody;
            Pad myPad = SF.AddNewPadFromRef(Ref_Verbindung, dat.getBreiteZahnrad1());

            hsp_catiaPart.Part.Update();
        }
Beispiel #25
0
        public static void CreateCam(double angle)
        {
            double dRad   = angle * dPi / 180;
            double dDSin1 = iCircle1Rad * Math.Sin(dRad);
            double dDCos1 = iCircle1Rad * Math.Cos(dRad);
            double dDSin2 = iCircle2Rad * Math.Sin(dRad);
            double dDCos2 = iCircle2Rad * Math.Cos(dRad);
            double dCSin  = iCircleDist * Math.Sin(dRad);
            double dCCos  = iCircleDist * Math.Cos(dRad);

            oCurrentSketch = oPartBody.Sketches.Add(oPlaneYZ);
            Factory2D oFactory2D = oCurrentSketch.OpenEdition();
            double    dRad1      = dRad - dPi / 4;
            double    dRad2      = dRad + dPi / 4;

            oCurrentLine1   = oFactory2D.CreateLine(iCenterX - dDSin1, iCenterY + dDCos1, iCenterX + dCCos + dDSin2, iCenterY - dCSin + dDCos2);
            oCurrentLine2   = oFactory2D.CreateLine(iCenterX + dDSin1, iCenterY - dDCos1, iCenterX + dCCos - dDSin2, iCenterY - dCSin - dDCos2);
            oCurrentCircle1 = oFactory2D.CreateCircle(iCenterX, iCenterY, iCircle1Rad, dRad2, dRad1);
            oCurrentCircle2 = oFactory2D.CreateCircle(iCenterX + dCCos, iCenterY + dCSin, iCircle2Rad, dRad1, dRad2);
            Reference   oRefLine1          = oPart.CreateReferenceFromObject(oCurrentLine1);
            Reference   oRefCircle1        = oPart.CreateReferenceFromObject(oCurrentCircle1);
            Reference   oRefLine2          = oPart.CreateReferenceFromObject(oCurrentLine2);
            Reference   oRefCircle2        = oPart.CreateReferenceFromObject(oCurrentCircle2);
            Reference   oRefLine1StartPt   = oPart.CreateReferenceFromObject(oCurrentLine1.StartPoint);
            Reference   oRefLine1EndPt     = oPart.CreateReferenceFromObject(oCurrentLine1.EndPoint);
            Reference   oRefLine2StartPt   = oPart.CreateReferenceFromObject(oCurrentLine2.StartPoint);
            Reference   oRefLine2EndPt     = oPart.CreateReferenceFromObject(oCurrentLine2.EndPoint);
            Reference   oRefCircle1StartPt = oPart.CreateReferenceFromObject(oCurrentCircle1.StartPoint);
            Reference   oRefCircle1EndPt   = oPart.CreateReferenceFromObject(oCurrentCircle1.EndPoint);
            Reference   oRefCircle2StartPt = oPart.CreateReferenceFromObject(oCurrentCircle2.StartPoint);
            Reference   oRefCircle2EndPt   = oPart.CreateReferenceFromObject(oCurrentCircle2.EndPoint);
            Constraints oConstraints       = oCurrentSketch.Constraints;
            Constraint  oConstraint        = oConstraints.AddMonoEltCst(CatConstraintType.catCstTypeReference, oRefCircle1);

            oConstraint = oConstraints.AddMonoEltCst(CatConstraintType.catCstTypeReference, oRefCircle2);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeTangency, oRefLine1, oRefCircle1);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeTangency, oRefCircle2, oRefLine1);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeOn, oRefCircle1StartPt, oRefLine1StartPt);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeOn, oRefCircle2EndPt, oRefLine1EndPt);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeTangency, oRefLine2, oRefCircle1);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeTangency, oRefLine2, oRefCircle2);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeOn, oRefCircle1EndPt, oRefLine2StartPt);
            oConstraint = oConstraints.AddBiEltCst(CatConstraintType.catCstTypeOn, oRefCircle2StartPt, oRefLine2EndPt);
            oCurrentSketch.CloseEdition();
            ShapeFactory oShapeFactory = (ShapeFactory)oPart.ShapeFactory;
            Pad          oPad          = oShapeFactory.AddNewPad(oCurrentSketch, iCamThickness + iCurrentLevel);

            oPad.SecondLimit.Dimension.Value = iCurrentLevel * -1;
        }
Beispiel #26
0
        /// <summary>
        /// 设置无尺寸约束的孔属性
        /// </summary>
        /// <param name="Nwhole">孔对象</param>
        /// <param name="LengthDis">孔距离长边距离</param>
        /// <param name="WeightDis">孔距离短边距离</param>
        /// <param name="Diameter">孔直径</param>
        /// <param name="HoleType">孔类型</param>
        /// <param name="Comstraints">1:宽边,2:长边</param>
        private void RxSetHoleType(Part Tpart, Hole Nwhole, double LengthDis, double WeightDis, double Diameter, RxHoleType HoleType, Edge WidthEdge, Edge LengthEdge)
        {
            Nwhole.Type       = CatHoleType.catSimpleHole;
            Nwhole.AnchorMode = CatHoleAnchorMode.catExtremPointHoleAnchor;
            Nwhole.BottomType = CatHoleBottomType.catVHoleBottom;
            Limit BottomLimit = Nwhole.BottomLimit;

            BottomLimit.LimitMode    = CatLimitMode.catOffsetLimit;
            Nwhole.Diameter.Value    = Diameter;
            Nwhole.BottomAngle.Value = 120;
            Nwhole.ThreadingMode     = CatHoleThreadingMode.catSmoothHoleThreading;
            Sketch Hosketch = Nwhole.Sketch;

            MECMOD.Constraints HoleConstraint = Hosketch.Constraints;
            int       Cont            = Hosketch.GeometricElements.Count;
            string    Type            = Hosketch.GeometricElements.Item(2).get_Name();
            Point2D   HoleCenterPoint = (Point2D)Hosketch.GeometricElements.Item(2);
            Reference refPoint        = Tpart.CreateReferenceFromObject(HoleCenterPoint);

            if (HoleConstraint.Count < 3)
            {
                Tpart.InWorkObject = Hosketch;
                Factory2D         factory2D     = Hosketch.OpenEdition();
                GeometricElements geWidthEdge   = factory2D.CreateProjections(WidthEdge);
                GeometricElements geLengthEdge  = factory2D.CreateProjections(LengthEdge);
                Geometry2D        geoWidthEdge  = (Geometry2D)geWidthEdge.Item("标记.1");
                Geometry2D        geoLengthEdge = (Geometry2D)geLengthEdge.Item("标记.1");
                geoWidthEdge.Construction  = true;
                geoLengthEdge.Construction = true;
                Reference EpWidth  = Tpart.CreateReferenceFromObject(geoWidthEdge);
                Reference EpLength = Tpart.CreateReferenceFromObject(geoLengthEdge);
                //geo1.Construction = true;
                Constraint holeConstraintL = HoleConstraint.AddBiEltCst(CatConstraintType.catCstTypeDistance, refPoint, EpWidth);
                Constraint holeConstraintW = HoleConstraint.AddBiEltCst(CatConstraintType.catCstTypeDistance, refPoint, EpLength);
                holeConstraintL.Dimension.Value = WeightDis; //孔距离宽边的距离
                holeConstraintW.Dimension.Value = LengthDis; //孔距离长边的距离
                Hosketch.CloseEdition();
            }
            else
            {
                HoleConstraint.Item(1).Dimension.Value = WeightDis; //孔距离宽边的距离
                HoleConstraint.Item(2).Dimension.Value = LengthDis; //孔距离长边的距离
            }

            //HoleConstraint.Item(2).Dimension.Value = 10;
            Nwhole.ThreadSide     = CatHoleThreadSide.catRightThreadSide;
            BottomLimit.LimitMode = CatLimitMode.catUpThruNextLimit;
            ChangeHoleColor(Nwhole, HoleType);
        }
Beispiel #27
0
            public void erstelleLprofilSkizze(double dL1, double dL2, double dL3, double dL4)
            {
                Factory2D fact2D = hsp_catiaProfil.OpenEdition();

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

                // Eckpunkte erstellen

                double dStartpunktx = 0;
                double dStartpunkty = 0;

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

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

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

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

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

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

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

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


                hsp_catiaProfil.CloseEdition();

                hsp_catiaPart.Part.Update();
            }
Beispiel #28
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 #29
0
        public static void CreatePatternBearing()
        {
            oCurrentSketch = oPartBody.Sketches.Add(oPlaneYZ);
            Factory2D oFactory2D = oCurrentSketch.OpenEdition();

            oCurrentCircle1 = oFactory2D.CreateClosedCircle(iCenterX, iCenterY, iBearingDiam / 2);
            oCurrentSketch.CloseEdition();
            ShapeFactory   oShapeFactory   = (ShapeFactory)oPart.ShapeFactory;
            Pad            oPad            = oShapeFactory.AddNewPad(oCurrentSketch, iBearingLength);
            OriginElements originElements1 = oPart.OriginElements;
            Reference      oRefPlaneXY     = oPart.CreateReferenceFromGeometry(oPart.OriginElements.PlaneXY);
            RectPattern    rectPattern1    = oShapeFactory.AddNewRectPattern(oPad, iNumberOfCylinders + 1, 1, iCylinderSpacing, 0, 1, 1, oRefPlaneXY, oRefPlaneXY, true, true, 0);

            iCurrentLevel = iBearingLength;
        }
        private static Line2D CreateLine(Factory2D fac, Point2D p1, Point2D p2)
        {
            object[] ob1 = new object[2];
            p1.GetCoordinates(ob1);

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

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

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

            return(line);
        }
Beispiel #31
0
        static void Logo(Factory2D F, float X, float Y, float Height, float Fatness)
        {
            const double AngleOffset = 0.09;

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

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

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

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

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

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

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

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

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

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