Esempio n. 1
0
        private void drawParallepiped()
        {
            double height, width, length;
            int    angle;

            if (
                double.TryParse(numericUpDown3.Value.ToString(), out height)
                & double.TryParse(numericUpDown4.Value.ToString(), out width)
                & double.TryParse(numericUpDown5.Value.ToString(), out length)
                & int.TryParse(numericUpDown6.Value.ToString(), out angle)
                )
            {
                height /= 100;
                width  /= 100;
                length /= 100;


                Pekok.SolidWorks.OpenDoc();

                Pekok.SolidWorks.swDoc.ClearSelection();
                Pekok.SolidWorks.swDoc.SketchManager.Insert3DSketch(false);

                Pekok.Figure.Parallelepiped circle = new Pekok.Figure.Parallelepiped(0, 0, 0,
                                                                                     length, 0, 0,
                                                                                     length + width / Math.Tan(angle * Math.PI / 180), width, 0);

                object[] ss = circle.draw(Pekok.SolidWorks.swDoc.SketchManager);
                foreach (object b in ss)
                {
                    ((SketchSegment)b).Select(true);
                }

                Feature f = Puller.Extrude(Pekok.SolidWorks.swDoc, height);
                if (f != null)
                {
                    isCreatedCub = true;
                }
                Pekok.SolidWorks.swDoc.ClearSelection();
            }
        }