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