Example #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);
 }
Example #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);
 }
Example #3
0
 public static void SelectFromList(ModelDoc2 swModel, BindingList <String> Sselect)
 {
     swModel.ClearSelection2(true);
     foreach (String str in Sselect)
     {
         SmartTools.SelectByID(swModel, str);
     }
 }
Example #4
0
 //відкрити програму Solidworks та створити Модель
 public void OpenProgramNewPart()
 {
     if (obj.isEpmty())
     {
         swModel = SmartTools.WorkSolid();
     }
     else
     {
         MessageBox.Show("Загрузіть модель!");
     }
 }
Example #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);
 }
Example #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());
            }
        }
Example #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]));
            }
        }
Example #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);
            }
        }
Example #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]);
            }
        }
Example #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);
        }
Example #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("Загрузіть модель!");
     }
 }
Example #12
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.FeatureFillet(Options, R1, Ftyp, OverflowType, Radii, SetBackDistances, PointRadiusArray);
 }
Example #13
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.InsertMirrorFeature(BMirrorBody, BGeometryPattern, BMerge, BKnit);
 }
Example #14
0
 public override void Trace(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.SketchMirror();
 }
Example #15
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.InsertAxis2(true);
 }
Example #16
0
 public override void Bild(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.FeatureManager.InsertFeatureChamfer(Options, ChamferType, Width, Angle, OtherDist, VertexChamDist1, VertexChamDist2, VertexChamDist3);
 }
Example #17
0
 public override void Trace(ModelDoc2 swModel)
 {
     SmartTools.SelectFromList(swModel, Sselect);
     swModel.SketchManager.CreateCircularSketchStepAndRepeat(ArcRadius, ArcAngle, PatternNum, PatternSpacing,
                                                             PatternRotate, DeleteInstances, RadiusDim, AngleDim, CreateNumOfInstancesDim);
 }