Beispiel #1
0
 public override void Bild(ModelDoc2 swModel)
 {
     base.Bild(swModel);
     swModel.ClearSelection2(true);
     if (Sselect == null || Sselect.Count == 0)
     {
         base.SelectByAll();
     }
     else
     {
         SmartTools.SelectFromList(swModel, Sselect);
     }
     swModel.FeatureManager.FeatureRevolve2(SingleDir,
                                            IsSolid,
                                            IsThin,
                                            IsCut,
                                            ReverseDir,
                                            BothDirectionUpToSameEntity,
                                            Dir1Type,
                                            Dir2Type,
                                            Dir1Angle,
                                            Dir2Angle,
                                            OffsetReverse1,
                                            OffsetReverse2,
                                            OffsetDistance1,
                                            OffsetDistance2,
                                            ThinType,
                                            ThinThickness1,
                                            ThinThickness2,
                                            Merge,
                                            UseFeatScope,
                                            UseAutoSelect);
 }
Beispiel #2
0
 public override void Bild(ModelDoc2 swModel)
 {
     swModel.ActivateSelectedFeature();
     swModel.ClearSelection2(true);
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.FeatureCircularPattern4(Number, Spacing, FlipDirection, DName, GeometryPattern, EqualSpacing, VaryInstance);
 }
Beispiel #3
0
 public static void SelectFromList(ModelDoc2 swModel, BindingList <String> Sselect)
 {
     swModel.ClearSelection2(true);
     foreach (String str in Sselect)
     {
         SmartTools.SelectByID(swModel, str);
     }
 }
Beispiel #4
0
 //відкрити програму Solidworks та створити Модель
 public void OpenProgramNewPart()
 {
     if (obj.isEpmty())
     {
         swModel = SmartTools.WorkSolid();
     }
     else
     {
         MessageBox.Show("Загрузіть модель!");
     }
 }
Beispiel #5
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectByID(swModel, SmartSelect);
     swModel.SketchManager.InsertSketch(true);
     foreach (Icurve I in line)
     {
         I.Trace(swModel);
     }
     binding.makeBindings(swModel);
     dimension.makeDimensions(swModel);
     swModel.SketchManager.InsertSketch(true);
 }
Beispiel #6
0
        //зберегти параметри даної моделі
        public void SaveDialog()
        {
            SaveFileDialog saveFile1 = new SaveFileDialog();

            saveFile1.DefaultExt = "*.xml";
            saveFile1.Filter     = "xml files (*.xml)|*.xml";

            if (saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK && saveFile1.FileName.Length > 0)
            {
                SmartTools.SaveXML(obj, saveFile1.FileName.ToString());
            }
        }
Beispiel #7
0
        public void makeDimensions(ModelDoc2 swModel)
        {
            foreach (string[] list in pack)
            {
                swModel.ClearSelection2(true);

                for (int i = 6; i < list.Length; i++)
                {
                    SmartTools.SelectByID(swModel, list[i]);
                }

                swModel.AddDimension2(Convert.ToDouble(list[3]), Convert.ToDouble(list[4]), Convert.ToDouble(list[5]));
            }
        }
Beispiel #8
0
        //відкрити параметри
        public void OpenDialog()
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = "./";
            openFileDialog1.Filter           = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                obj = (Parts)SmartTools.OpenXML(typeof(Parts), openFileDialog1.FileName);
            }
        }
Beispiel #9
0
        public void makeBindings(ModelDoc2 swModel)
        {
            foreach (string[] list in pack)
            {
                swModel.ClearSelection2(true);

                for (int i = 1; i < list.Length; i++)
                {
                    SmartTools.SelectByID(swModel, list[i]);
                }

                swModel.SketchAddConstraints(list[0]);
            }
        }
Beispiel #10
0
        public void changeDimensions(ModelDoc2 swModel)
        {
            Dimension myDimension;

            foreach (string[] list in pack)
            {
                if (list[0] != "")
                {
                    myDimension             = swModel.Parameter(list[1]);
                    myDimension.SystemValue = Convert.ToDouble(list[2]) / 1000.0;
                }
            }

            SmartTools.UpdateModel(swModel);
        }
Beispiel #11
0
 //змінити матеріал
 public void ChangeMaterial(ComboBox namematerial)
 {
     if (obj != null)
     {
         obj.material = namematerial.Text;
         if (swModel != null)
         {
             SmartTools.SetMaterial(swModel, namematerial.Text);
         }
     }
     else
     {
         MessageBox.Show("Загрузіть модель!");
     }
 }
Beispiel #12
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.FeatureFillet(Options, R1, Ftyp, OverflowType, Radii, SetBackDistances, PointRadiusArray);
 }
Beispiel #13
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.InsertMirrorFeature(BMirrorBody, BGeometryPattern, BMerge, BKnit);
 }
Beispiel #14
0
 public override void Trace(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.SketchMirror();
 }
Beispiel #15
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.InsertAxis2(true);
 }
Beispiel #16
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.InsertFeatureChamfer(Options, ChamferType, Width, Angle, OtherDist, VertexChamDist1, VertexChamDist2, VertexChamDist3);
 }
Beispiel #17
0
 public override void Trace(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.SketchManager.CreateCircularSketchStepAndRepeat(ArcRadius, ArcAngle, PatternNum, PatternSpacing,
                                                             PatternRotate, DeleteInstances, RadiusDim, AngleDim, CreateNumOfInstancesDim);
 }