예제 #1
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();
        }
예제 #2
0
        //Erzeugen der Extrusionfür Sechseck
        internal void ErzeugeExtrusionSechseck(SechseckVoll neuSechseckVoll)
        {
            hspB1_catiaPart.Part.InWorkObject = hspB1_catiaPart.Part.MainBody;


            // Extrusion erzeugen
            ShapeFactory catShapeFactory1 = (ShapeFactory)hspB1_catiaPart.Part.ShapeFactory;
            Pad          catPad1          = catShapeFactory1.AddNewPad(hspB1_catia_Profil, neuSechseckVoll.Länge);

            // Block umbenennen
            catPad1.set_Name("Sechseck");

            // Part aktualisieren
            hspB1_catiaPart.Part.Update();
        }
예제 #3
0
파일: ExcelApi.cs 프로젝트: HSPB1/HSPB1
        public void ExcelSeVo(SechseckVoll sechseckVoll)
        {
            mySheet = (Excel.Worksheet)excelApp.ActiveSheet;


            mySheet.Cells[z, "A"] = i;
            mySheet.Cells[z, "B"] = "Sechseckk voll";
            mySheet.Cells[z, "C"] = "";
            mySheet.Cells[z, "D"] = "";
            mySheet.Cells[z, "E"] = sechseckVoll.Radius * 2;
            mySheet.Cells[z, "F"] = "";
            mySheet.Cells[z, "G"] = "";
            mySheet.Cells[z, "H"] = sechseckVoll.Länge;
            mySheet.Cells[z, "I"] = sechseckVoll.QFläche();
            mySheet.Cells[z, "J"] = sechseckVoll.Volumen();
            mySheet.Cells[z, "K"] = sechseckVoll.WiederstandsMoment_Wy() / 1000;
            mySheet.Cells[z, "L"] = sechseckVoll.WiederstandsMoment_Wz() / 1000;
            mySheet.Cells[z, "M"] = sechseckVoll.FTM_Iy() / 10000;
            mySheet.Cells[z, "N"] = sechseckVoll.FTM_Iz() / 10000;
            mySheet.Cells[z, "O"] = sechseckVoll.FTM_Polar() / 10000;

            i++;
            z++;
        }