Ejemplo n.º 1
0
        private ModelObject CopyObject(ModelObject sourceObject)
        {
            ModelObject result = Operation.CopyObject(sourceObject, _sourceCoordsys, _targetCoordsys);

            if (_operationEnum == TreeOperationEnum.CUT)
            {
                sourceObject.Delete();
            }

            return(result);
        }
Ejemplo n.º 2
0
        private void CreatePadFootings(object sender, EventArgs e)
        {
            // Always remember to check that you really have working connection
            if (MyModel.GetConnectionStatus())
            {
                double wsp3 = int.Parse(textBox1.Text);
                double wsp4 = double.Parse(textBox2.Text);

                Picker piku = new Picker();

                //askjdhygausgfdyzjusrgfafsa
                ArrayList info = new ArrayList();
                info = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ArrayList info2 = new ArrayList();
                info2 = new ArrayList {
                    "END_X", "END_Y", "END_Z", "START_X", "START_Y", "START_Z"
                };
                ModelObject part  = new Beam();
                ModelObject part2 = new Beam();
                Hashtable   p1    = new Hashtable();
                Hashtable   p2    = new Hashtable();

                part = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part.GetDoubleReportProperties(info, ref p1);
                part2 = piku.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
                part2.GetDoubleReportProperties(info2, ref p2);
                Point st1 = new Point();
                Point st2 = new Point();
                st1 = piku.PickPoint();
                st2 = piku.PickPoint();
                Point st3 = new Point(st1);
                Point st4 = new Point(st2);

                //wektory belek
                Vector v1 = new Vector((Convert.ToDouble(p1["START_X"]) - Convert.ToDouble(p1["END_X"])) / 10000, (Convert.ToDouble(p1["START_Y"]) - Convert.ToDouble(p1["END_Y"])) / 10000, (Convert.ToDouble(p1["START_Z"]) - Convert.ToDouble(p1["END_Z"])) / 10000);
                Vector v2 = new Vector((Convert.ToDouble(p2["START_X"]) - Convert.ToDouble(p2["END_X"])) / 10000, (Convert.ToDouble(p2["START_Y"]) - Convert.ToDouble(p2["END_Y"])) / 10000, (Convert.ToDouble(p2["START_Z"]) - Convert.ToDouble(p2["END_Z"])) / 10000);
                double v1d = v1.GetLength(); double ile1 = 30 / v1d;
                double v2d = v2.GetLength(); double ile2 = 30 / v2d;
                double v1dd = v1.GetLength(); double ile3 = wsp4 / v1d;
                double v2dd = v2.GetLength(); double ile4 = wsp4 / v2d;

                st3.Translate((-v1.X) * ile3, (-v1.Y) * ile3, (-v1.Z) * ile3);
                st1.Translate((v1.X) * ile1, (v1.Y) * ile1, (v1.Z) * ile1);
                st4.Translate((-v2.X) * ile2, (-v2.Y) * ile2, (-v2.Z) * ile2);
                st2.Translate((v2.X) * ile4, (v2.Y) * ile4, (v2.Z) * ile4);

                Contour      testowy = new Contour();
                ContourPoint point1  = new ContourPoint(st1, null);
                ContourPoint point2  = new ContourPoint(st3, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point3  = new ContourPoint(st4, null);
                testowy.AddContourPoint(point1);
                testowy.AddContourPoint(point2);
                testowy.AddContourPoint(point3);

                Contour      testowy3 = new Contour();
                ContourPoint point10  = new ContourPoint(st4, null);
                ContourPoint point20  = new ContourPoint(st2, new Chamfer(45, 0, Chamfer.ChamferTypeEnum.CHAMFER_ROUNDING));
                ContourPoint point30  = new ContourPoint(st3, null);
                testowy3.AddContourPoint(point10);
                testowy3.AddContourPoint(point20);
                testowy3.AddContourPoint(point30);

                bool strona = radioButton1.Checked;

                ModelObject nb  = CreateBlacha(testowy, strona);
                ModelObject nb3 = CreateBlacha(testowy3, strona);
                nb.Insert();
                nb3.Insert();

                double l1 = 0.0;
                nb.GetReportProperty("LENGTH", ref l1);


                double l2 = 0.0;
                nb3.GetReportProperty("LENGTH", ref l2);

                nb.Delete();
                nb3.Delete();



                Contour testowy2 = new Contour();
                testowy2.AddContourPoint(point1);
                testowy2.AddContourPoint(point2);
                Point        point4v = new Point(dlugosc(point2, point3, l1));
                ContourPoint point4  = new ContourPoint(point4v, null);
                testowy2.AddContourPoint(point4);
                ModelObject nb2 = CreateBlacha(testowy2, strona);

                Contour testowy4 = new Contour();
                testowy4.AddContourPoint(point10);
                testowy4.AddContourPoint(point20);
                Point        point40v = new Point(dlugosc(point20, point30, l2));
                ContourPoint point40  = new ContourPoint(point40v, null);
                testowy4.AddContourPoint(point40);
                ModelObject nb4 = CreateBlacha(testowy4, strona);


                nb2.Insert();
                BoltArray b2 = sruby(point1, point2, nb2 as Part);
                b2.PartToBoltTo = part as Part;
                b2.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b2.BoltStandard = comboBox2.Text;
                b2.Insert();
                nb4.Insert();
                BoltArray b4 = sruby(point10, point20, nb4 as Part);
                b4.BoltSize     = Convert.ToDouble(comboBox3.Text);
                b4.BoltStandard = comboBox2.Text;
                b4.PartToBoltTo = part2 as Part;
                b4.Insert();

                Point point4st  = new Point(dlugosc(point40, point4, 130));
                Point point40st = new Point(dlugosc(point4, point40, 130));

                Point pointsplit = new Point(dlugosc(point4st, point40st, wsp3 + 180));

                if (comboBox1.Text == "D16")
                {
                    Beam st16 = CreateStezenie16(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M16");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D20")
                {
                    Beam st16 = CreateStezenie20(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M20");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
                if (comboBox1.Text == "D12")
                {
                    Beam st16 = CreateStezenie12(point4st, point40st, strona);
                    st16.Insert();
                    Weld w  = new Weld();
                    Weld w2 = new Weld();
                    w.MainObject      = st16;
                    w.SecondaryObject = nb2;
                    w.ShopWeld        = true;
                    w.Insert();
                    w2.MainObject      = st16;
                    w2.SecondaryObject = nb4;
                    w2.ShopWeld        = true;
                    w2.Insert();
                    Beam       st161 = Operation.Split(st16, pointsplit);
                    Connection sr    = new Connection();
                    sr.Name   = "Po³¹czenie œrub¹ rzymsk¹";
                    sr.Number = 126;
                    sr.LoadAttributesFromFile("82269_M12");
                    sr.SetPrimaryObject(st161);
                    sr.SetSecondaryObject(st16);
                    sr.Insert();
                }
            }
            MyModel.CommitChanges();
        }
Ejemplo n.º 3
0
 public static void MyClassCleanup()
 {
     modelObject.Delete();
 }
Ejemplo n.º 4
0
 public virtual bool Delete()
 {
     return(Found && ModelObject.Delete());
 }