public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.Grid) { Grid grid = (Grid)modelObjectEnum.Current; coordinateX = grid.CoordinateX; coordinateY = grid.CoordinateY; coordinateZ = grid.CoordinateZ; labelX = grid.LabelX; labelY = grid.LabelY; labelZ = grid.LabelZ; } } } if (modelObjectEnum.GetSize() > 1) { coordinateX = ""; coordinateY = ""; coordinateZ = ""; labelX = ""; labelY = ""; labelZ = ""; } }
public SwapHandles() { var selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var myEnum = selector.GetSelectedObjects(); while (myEnum.MoveNext()) { if (myEnum.Current is Tekla.Structures.Model.ContourPlate) { ContourPlate cPlate = myEnum.Current as ContourPlate; cPlate.Position.Depth = SwapEndForces(cPlate.Position.Depth); cPlate.Modify(); } else if (myEnum.Current is Tekla.Structures.Model.BooleanPart) { BooleanPart boolPart = myEnum.Current as Tekla.Structures.Model.BooleanPart; ContourPlate boolConturPlate = boolPart.OperativePart as Tekla.Structures.Model.ContourPlate; if (boolConturPlate != null) { boolConturPlate.Position.Depth = SwapEndForces(boolConturPlate.Position.Depth); boolConturPlate.Modify(); } } } new Model().CommitChanges(); }
public List <Assembly> GetPartsAssemblies() { var modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var selectedObjects = modelObjectSelector.GetSelectedObjects(); var assemblies = new List <Assembly>(); while (selectedObjects.MoveNext()) { var currentObject = selectedObjects.Current; if (currentObject is Part currentPart) { var assembly = currentPart.GetAssembly(); if (IsPartAssembly(assembly) && !IsListContainsAssembly(assemblies, assembly)) { assemblies.Add(assembly); } } if (currentObject is Assembly currentAssembly) { var partAssemblies = GetPartAssemblies(currentAssembly); foreach (var partAssembly in partAssemblies) { if (!IsListContainsAssembly(assemblies, partAssembly)) { assemblies.Add(partAssembly); } } } } return(assemblies); }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.Grid) { Grid grid = (Grid)modelObjectEnum.Current; coordinateX = grid.CoordinateX; coordinateY = grid.CoordinateY; coordinateZ = grid.CoordinateZ; labelX = grid.LabelX; labelY = grid.LabelY; labelZ = grid.LabelZ; } } } if (modelObjectEnum.GetSize() > 1) { coordinateX = ""; coordinateY = ""; coordinateZ = ""; labelX = ""; labelY = ""; labelZ = ""; } }
static private ModelObjectEnumerator getSelectedObjects() { var selector = new TSM.UI.ModelObjectSelector(); ModelObjectEnumerator selectionEnum = selector.GetSelectedObjects(); return(selectionEnum); }
public List <Part> GetSelectedParts() { var modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var selectedObjects = modelObjectSelector.GetSelectedObjects(); var parts = new List <Part>(); while (selectedObjects.MoveNext()) { var currentObject = selectedObjects.Current; if (currentObject is Part currentPart) { parts.Add(currentPart); } if (currentObject is Assembly currentAssembly) { var assemblyParts = GetAssemblyParts(currentAssembly); foreach (var part in assemblyParts) { parts.Add(part); } } } return(parts); }
private static ModelObjectEnumerator getSelectedObjects() { var selector = new TSM.UI.ModelObjectSelector(); ModelObjectEnumerator selectionEnum = selector.GetSelectedObjects(); return selectionEnum; }
public string GetInfo() { Model model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator enumerator = selector.GetSelectedObjects(); return(enumerator.GetSize().ToString()); }
private static void changePartToSubAssembly(TSM.Assembly assembly, ArrayList wrongParts, Tekla.Technology.Akit.IScript akit) { TSM.UI.ModelObjectSelector selector = new TSM.UI.ModelObjectSelector(); selector.Select(wrongParts); akit.Callback("acmdRemoveFromAssemblyActionCB", "", "View_01 window_1"); //assembly.Modify(); selector = new TSM.UI.ModelObjectSelector(); TSM.ModelObjectEnumerator selectionEnum = selector.GetSelectedObjects(); while (selectionEnum.MoveNext()) { if (selectionEnum.Current is TSM.Part) { TSM.Part newPart = selectionEnum.Current as TSM.Part; TSM.Assembly partNewAssembly = newPart.GetAssembly() as TSM.Assembly; ArrayList currentSelection = new ArrayList(); currentSelection.Add(assembly); selector.Select(currentSelection); TSM.ModelObjectEnumerator selectionEnum2 = selector.GetSelectedObjects(); while (selectionEnum2.MoveNext()) { if (selectionEnum2.Current is TSM.Assembly) { TSM.Assembly newAssembly = selectionEnum2.Current as TSM.Assembly; newAssembly.Add(partNewAssembly); newAssembly.Modify(); } } } } foreach (TSM.Part part in wrongParts) { TSM.Assembly newAssembly = part.GetAssembly() as TSM.Assembly; removeAssemblyPropertys(newAssembly, akit); } }
private static void changePartToSubAssembly(TSM.Assembly assembly, ArrayList wrongParts, Tekla.Technology.Akit.IScript akit) { TSM.UI.ModelObjectSelector selector = new TSM.UI.ModelObjectSelector(); selector.Select(wrongParts); akit.Callback("acmdRemoveFromAssemblyActionCB", "", "View_01 window_1"); //assembly.Modify(); selector = new TSM.UI.ModelObjectSelector(); TSM.ModelObjectEnumerator selectionEnum = selector.GetSelectedObjects(); while (selectionEnum.MoveNext()) { if (selectionEnum.Current is TSM.Part) { TSM.Part newPart = selectionEnum.Current as TSM.Part; TSM.Assembly partNewAssembly = newPart.GetAssembly() as TSM.Assembly; ArrayList currentSelection = new ArrayList(); currentSelection.Add(assembly); selector.Select(currentSelection); TSM.ModelObjectEnumerator selectionEnum2 = selector.GetSelectedObjects(); while (selectionEnum2.MoveNext()) { if (selectionEnum2.Current is TSM.Assembly) { TSM.Assembly newAssembly = selectionEnum2.Current as TSM.Assembly; newAssembly.Add(partNewAssembly); newAssembly.Modify(); } } } } foreach (TSM.Part part in wrongParts) { TSM.Assembly newAssembly = part.GetAssembly() as TSM.Assembly; removeAssemblyPropertys(newAssembly, akit); } }
ArrayList GetModelObjectsByType(string ObjectType) { ArrayList ObjectsToBeSelected = new ArrayList(); Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); foreach (Tekla.Structures.Model.ModelObject modelObject in modelObjectSelector.GetSelectedObjects()) { if (modelObject.GetType().ToString() == ObjectType) { ObjectsToBeSelected.Add(modelObject); } } return(ObjectsToBeSelected); }
public List <Assembly> GetSelectedSubAssemblies() { var modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var selectedObjects = modelObjectSelector.GetSelectedObjects(); var subAssemblies = new List <Assembly>(); while (selectedObjects.MoveNext()) { if (selectedObjects.Current is Assembly assembly && assembly.AssemblyNumber.Prefix.StartsWith("SA")) { subAssemblies.Add(assembly); } } return(subAssemblies); }
private void button2_Click(object sender, EventArgs e) { Model _model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector mos = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator moe = mos.GetSelectedObjects(); while (moe.MoveNext()) { ModelObject mo = moe.Current as ModelObject; // mo. } }
private static List <BaseWeld> GetSelectesWelds() { var selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var selectedObjects = selector.GetSelectedObjects(); var result = new List <BaseWeld>(); while (selectedObjects.MoveNext()) { var currentObject = selectedObjects.Current; if (currentObject is BaseWeld currentWeld) { result.Add(currentWeld); } } return(result); }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Connection) { Connection connection = (Connection)modelObjectEnum.Current; if (label == "Code") connection.Code = code; connection.Modify(); } } }
public Magic() { var selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var myEnum = selector.GetSelectedObjects(); while (myEnum.MoveNext()) { if (myEnum.Current is Tekla.Structures.Model.Beam) { var myBeam = myEnum.Current as Beam; double dX = Math.Abs(myBeam.StartPoint.X - myBeam.EndPoint.X); double dY = Math.Abs(myBeam.StartPoint.Y - myBeam.EndPoint.Y); double dZ = Math.Abs(myBeam.StartPoint.Z - myBeam.EndPoint.Z); //MessageBox.Show(dX.ToString() + ", " + dY.ToString() + ", " + dZ.ToString()); if (dX > 0.006 && dX < 0.70) { MessageBox.Show(dX.ToString()); myBeam.EndPoint.X = myBeam.StartPoint.X; myBeam.Modify(); //MessageBox.Show("fixed X"); } if (dY > 0.006 && dY < 0.70) { MessageBox.Show(dY.ToString()); myBeam.EndPoint.Y = myBeam.StartPoint.Y; myBeam.Modify(); //MessageBox.Show("fixed Y"); } if (dZ > 0.006 && dZ < 0.70) { MessageBox.Show(dZ.ToString()); myBeam.EndPoint.Z = myBeam.StartPoint.Z; myBeam.Modify(); //MessageBox.Show("fixed Z"); } } } //Update model with changes new Model().CommitChanges(); }
public Magic() { var selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var myEnum = selector.GetSelectedObjects(); while (myEnum.MoveNext()) { if (myEnum.Current is Tekla.Structures.Model.Beam) { var myBeam = myEnum.Current as Beam; double dX = Math.Abs(myBeam.StartPoint.X - myBeam.EndPoint.X); double dY = Math.Abs(myBeam.StartPoint.Y - myBeam.EndPoint.Y); double dZ = Math.Abs(myBeam.StartPoint.Z - myBeam.EndPoint.Z); //MessageBox.Show(dX.ToString() + ", " + dY.ToString() + ", " + dZ.ToString()); if (dX > 0.006 && dX < 0.70) { MessageBox.Show(dX.ToString()); myBeam.EndPoint.X = myBeam.StartPoint.X; myBeam.Modify(); //MessageBox.Show("fixed X"); } if (dY > 0.006 && dY < 0.70) { MessageBox.Show(dY.ToString()); myBeam.EndPoint.Y = myBeam.StartPoint.Y; myBeam.Modify(); //MessageBox.Show("fixed Y"); } if (dZ > 0.006 && dZ < 0.70) { MessageBox.Show(dZ.ToString()); myBeam.EndPoint.Z = myBeam.StartPoint.Z; myBeam.Modify(); //MessageBox.Show("fixed Z"); } } } //Update model with changes new Model().CommitChanges(); }
private void button2_Click(object sender, EventArgs e) { Model _model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector mos = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator moe = mos.GetSelectedObjects(); while (moe.MoveNext()) { Part angle = moe.Current as Part; if (angle != null) { ModelObjectEnumerator cuts = angle.GetBooleans(); while (cuts.MoveNext()) { BooleanPart cutpart = cuts.Current as BooleanPart; if (cutpart != null) { Part cutpt = cutpart.OperativePart; if (cutpt.Profile.ProfileString.StartsWith("SPD")) { string prof = cutpt.Profile.ProfileString; prof = prof.Replace("SPD", "PIPE"); cutpt.Profile.ProfileString = prof; cutpt.Modify(); } //string prof = cutpart.OperativePar .Profile.ProfileString; //prof.Replace("SPD", "PIPE"); //cutpart.Profile.ProfileString = prof; //cutpart.Modify(); } } } } _model.CommitChanges(); }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Grid) { Grid Grid = (Grid)modelObjectEnum.Current; if (label == "CoordinateX") { Grid.CoordinateX = coordinateX; } if (label == "CoordinateY") { Grid.CoordinateY = coordinateY; } if (label == "CoordinateZ") { Grid.CoordinateZ = coordinateZ; } if (label == "LabelX") { Grid.LabelX = labelX; } if (label == "LabelY") { Grid.LabelY = labelY; } if (label == "LabelZ") { Grid.LabelZ = labelZ; } Grid.Modify(); } } }
public bool IsAnyConnectionSelected() { var selector = new TSM.UI.ModelObjectSelector(); var selectedObjects = selector.GetSelectedObjects(); if (selectedObjects.GetSize() == 0) { return(false); } while (selectedObjects.MoveNext()) { if (selectedObjects.Current is TSM.BaseComponent) { return(true); } } return(false); }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.Connection) { Connection connection = (Connection)modelObjectEnum.Current; code = connection.Code; name = connection.Name; number = connection.Number.ToString(); //connection.SetAttribute } } } if (modelObjectEnum.GetSize() > 1) { } }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.Connection) { Connection connection = (Connection)modelObjectEnum.Current; code = connection.Code; name = connection.Name; number = connection.Number.ToString(); //connection.SetAttribute } } } if (modelObjectEnum.GetSize() > 1) { } }
public static List <TSM.ModelObject> getMdlObjectsFromSelection(Type filterType1, Type filterType2 = null, Type filterType3 = null) { TSM.UI.ModelObjectSelector modelSelector = new TSM.UI.ModelObjectSelector(); TSM.ModelObjectEnumerator modelObjEnum; List <TSM.ModelObject> mdlObjs = new List <TSM.ModelObject>(); modelObjEnum = modelSelector.GetSelectedObjects(); if (modelObjEnum.GetSize() == 0) { return(null); } foreach (TSM.ModelObject modelObject in modelObjEnum) { if (modelObject != null && (modelObject.GetType() == filterType1 | modelObject.GetType().IsSubclassOf(filterType1))) { mdlObjs.Add(modelObject); } if (filterType2 != null) { if (modelObject != null && (modelObject.GetType() == filterType2 | modelObject.GetType().IsSubclassOf(filterType2))) { mdlObjs.Add(modelObject); } } if (filterType3 != null) { if (modelObject != null && (modelObject.GetType() == filterType3 | modelObject.GetType().IsSubclassOf(filterType3))) { mdlObjs.Add(modelObject); } } } return(mdlObjs); }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.ContourPlate) { Tekla.Structures.Model.ContourPlate contourPlate = (Tekla.Structures.Model.ContourPlate)modelObjectEnum.Current; if (label == "Name") contourPlate.Name = name; if (label == "Profile") contourPlate.Profile.ProfileString = profile; if (label == "Material") contourPlate.Material.MaterialString = material; if (label == "Finish") contourPlate.Finish = finish; if (label == "Class") contourPlate.Class = classValue; if (label == "PartPrefix") contourPlate.PartNumber.Prefix = partPrefix; if (label == "PartStartNo") contourPlate.PartNumber.StartNumber = int.Parse(partStartNo); if (label == "AssemblyPrefix") contourPlate.AssemblyNumber.Prefix = assemblyPrefix; if (label == "AssemblyStartNo") contourPlate.AssemblyNumber.StartNumber = int.Parse(assemblyStartNo); if (label == "Phase") contourPlate.SetPhase(new Phase(int.Parse(phase))); if (label == "PositionOnPlane") { if (positionOnPlane == PositionPlaneEnum.Left) contourPlate.Position.Plane = Position.PlaneEnum.LEFT; if (positionOnPlane == PositionPlaneEnum.Middle) contourPlate.Position.Plane = Position.PlaneEnum.MIDDLE; if (positionOnPlane == PositionPlaneEnum.Right) contourPlate.Position.Plane = Position.PlaneEnum.RIGHT; } if (label == "PositionOnPlaneOffset") contourPlate.Position.PlaneOffset = double.Parse(positionOnPlaneOffset); if (label == "PositionRotation") { if (positionRotation == PositionRotationEnum.Top) contourPlate.Position.Rotation = Position.RotationEnum.TOP; if (positionRotation == PositionRotationEnum.Front) contourPlate.Position.Rotation = Position.RotationEnum.FRONT; if (positionRotation == PositionRotationEnum.Back) contourPlate.Position.Rotation = Position.RotationEnum.BACK; if (positionRotation == PositionRotationEnum.Below) contourPlate.Position.Rotation = Position.RotationEnum.BELOW; } if (label == "PositionRotationOffset") contourPlate.Position.RotationOffset = double.Parse(positionRotationOffset); if (label == "PositionAtDepth") { if (positionAtDepth == PositionDepthEnum.Behind) contourPlate.Position.Depth = Position.DepthEnum.BEHIND; if (positionAtDepth == PositionDepthEnum.Front) contourPlate.Position.Depth = Position.DepthEnum.FRONT; if (positionAtDepth == PositionDepthEnum.Middle) contourPlate.Position.Depth = Position.DepthEnum.MIDDLE; } if (label == "AtDepthOffset") contourPlate.Position.DepthOffset = double.Parse(positionAtDepthOffset); //if (label == "Userfield1") contourPlate.SetUserProperty("USER_FIELD_1", userfield1); //if (label == "Userfield2") contourPlate.SetUserProperty("USER_FIELD_2", userfield2); //if (label == "Userfield3") contourPlate.SetUserProperty("USER_FIELD_3", userfield3); //if (label == "Userfield4") contourPlate.SetUserProperty("USER_FIELD_4", userfield4); //if (label == "NotesComments") contourPlate.SetUserProperty("comment", notesComments); //if (label == "FittingNotes") contourPlate.SetUserProperty("FIT_NOTES", fittingNotes); //if (label == "FittingNotes2") contourPlate.SetUserProperty("FIT_NOTES2", fittingNotes2); //if (label == "Cambering") contourPlate.SetUserProperty("cambering", cambering); //if (label == "Paint") contourPlate.SetUserProperty("PAINT", paint); //if (label == "PreliminaryMark") contourPlate.SetUserProperty("PRELIM_MARK", preliminaryMark); //if (label == "PaintWFT") contourPlate.SetUserProperty("PAINT_WFT", paintWFT); //if (label == "PaintDFT") contourPlate.SetUserProperty("PAINT_DFT", paintDFT); //if (label == "ShearStart") contourPlate.SetUserProperty("shear1", double.Parse(shearStart) * 1000); //if (label == "ShearEnd") contourPlate.SetUserProperty("shear2", double.Parse(shearEnd) * 1000); //if (label == "AxialStart") contourPlate.SetUserProperty("axial1", double.Parse(axialStart) * 1000); //if (label == "AxialEnd") contourPlate.SetUserProperty("axial2", double.Parse(axialEnd) * 1000); //if (label == "MomentStart") contourPlate.SetUserProperty("moment1", double.Parse(momentStart) * 1000); //if (label == "MomentEnd") contourPlate.SetUserProperty("moment2", double.Parse(momentEnd) * 1000); //if (label == "ConnCodeStart") contourPlate.SetUserProperty("CONN_CODE_END1", connCodeStart); //if (label == "ConnCodeEnd") contourPlate.SetUserProperty("CONN_CODE_END2", connCodeEnd); contourPlate.Modify(); model.CommitChanges(); } } }
/// <summary> /// select all parts that need to be renumbered /// </summary> /// <param name="model"></param> /// <returns>quantity of selected parts</returns> public static int SelectPartsToBeRenumbered(TSM.Model model) { ArrayList partsToBeSelected = new ArrayList(); foreach (PartCustom part in partList) { if (part.NeedsToChange) { partsToBeSelected.Add(model.SelectModelObject(part.Identifier)); } } TSM.UI.ModelObjectSelector mos = new TSM.UI.ModelObjectSelector(); mos.Select(partsToBeSelected); return mos.GetSelectedObjects().GetSize(); }
private void UpdateProperties() { if (this.propertyGrid1.InvokeRequired) { UpdatePropertiesCallback d = new UpdatePropertiesCallback(UpdateProperties); this.Invoke(d); } else { Drawing drawing = drawingHandler.GetActiveDrawing(); if (drawing != null) { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); statusLabel.Text = drawingObjectEnum.GetSize().ToString() + " objects selected"; ArrayList arraySelectedObjects = new ArrayList(); if (drawingObjectEnum.GetSize() == 0) { activeDrawing.GetProperties(); propertyGrid1.SelectedObject = activeDrawing; } while (drawingObjectEnum.MoveNext()) { string objectType = drawingObjectEnum.Current.GetType().ToString(); if (!arraySelectedObjects.Contains(objectType)) { arraySelectedObjects.Add(objectType); } } comboBox1.Text = ""; comboBox1.Items.Clear(); arraySelectedObjects.Sort(); foreach (string objectName in arraySelectedObjects) { comboBox1.Items.Add(objectName); } if (arraySelectedObjects.Count == 1) { if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Part") { drawingPart.GetProperties(); propertyGrid1.SelectedObject = drawingPart; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Weld") { drawingWeld.GetProperties(); propertyGrid1.SelectedObject = drawingWeld; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.View") { view.GetProperties(); propertyGrid1.SelectedObject = view; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Bolt") { drawingBolt.GetProperties(); propertyGrid1.SelectedObject = drawingBolt; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.StraightDimensionSet") { straightDim.GetProperties(); propertyGrid1.SelectedObject = straightDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.RadiusDimension") { radiusDim.GetProperties(); propertyGrid1.SelectedObject = radiusDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.CurvedDimensionSetRadial") { radialDim.GetProperties(); propertyGrid1.SelectedObject = radialDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.AngleDimension") { angleDim.GetProperties(); propertyGrid1.SelectedObject = angleDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.GridLine") { drawingGrid.GetProperties(); propertyGrid1.SelectedObject = drawingGrid; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Line") { line.GetProperties(); propertyGrid1.SelectedObject = line; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Arc") { arc.GetProperties(); propertyGrid1.SelectedObject = arc; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Polyline") { polyline.GetProperties(); propertyGrid1.SelectedObject = polyline; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Rectangle") { rectangle.GetProperties(); propertyGrid1.SelectedObject = rectangle; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Circle") { circle.GetProperties(); propertyGrid1.SelectedObject = circle; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Polygon") { polygon.GetProperties(); propertyGrid1.SelectedObject = polygon; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Text") { text.GetProperties(); propertyGrid1.SelectedObject = text; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Symbol") { symbol.GetProperties(); propertyGrid1.SelectedObject = symbol; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Mark") { mark.GetProperties(); propertyGrid1.SelectedObject = mark; } else { activeDrawing.GetProperties(); propertyGrid1.SelectedObject = activeDrawing; } comboBox1.SelectedText = arraySelectedObjects[0].ToString(); propertyGrid1.Focus(); } if (arraySelectedObjects.Count > 1) { propertyGrid1.SelectedObject = null; } } if (drawing == null) { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); statusLabel.Text = modelObjectEnum.GetSize().ToString() + " objects selected"; ArrayList arraySelectedObjects = new ArrayList(); if (modelObjectEnum.GetSize() == 0) { propertyGrid1.SelectedObject = null; } while (modelObjectEnum.MoveNext()) { string objectType = modelObjectEnum.Current.GetType().ToString(); if (!arraySelectedObjects.Contains(objectType)) { arraySelectedObjects.Add(objectType); } } comboBox1.Text = ""; comboBox1.Items.Clear(); arraySelectedObjects.Sort(); foreach (string objectName in arraySelectedObjects) { comboBox1.Items.Add(objectName); } if (arraySelectedObjects.Count == 0) { Tekla.Structures.Model.UI.ModelViewEnumerator modelViewEnum = Tekla.Structures.Model.UI.ViewHandler.GetSelectedViews(); if (modelViewEnum.Count == 1) { modelView.GetProperties(); propertyGrid1.SelectedObject = modelView; comboBox1.SelectedText = "Tekla.Structures.Model.UI.View"; propertyGrid1.Focus(); } } if (arraySelectedObjects.Count == 1) { if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Beam") { beam.GetProperties(); propertyGrid1.SelectedObject = beam; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.ContourPlate") { contourPlate.GetProperties(); propertyGrid1.SelectedObject = contourPlate; } else if (arraySelectedObjects[0].ToString().Contains("Tekla.Structures.Model.Weld")) { modelWeld.GetProperties(); propertyGrid1.SelectedObject = modelWeld; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.PolygonWeld") { modelWeld.GetProperties(); propertyGrid1.SelectedObject = modelWeld; } else if (arraySelectedObjects[0].ToString().Contains("Tekla.Structures.Model.Bolt")) { modelBolt.GetProperties(); propertyGrid1.SelectedObject = modelBolt; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Grid") { modelGrid.GetProperties(); propertyGrid1.SelectedObject = modelGrid; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Connection") { modelConnection.GetProperties(); propertyGrid1.SelectedObject = modelConnection; } comboBox1.SelectedText = arraySelectedObjects[0].ToString(); propertyGrid1.Focus(); } if (arraySelectedObjects.Count > 1) { propertyGrid1.SelectedObject = null; } } } }
public SwapHandles() { //Get selected objects and put them in an enumerator/container var selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); var myEnum = selector.GetSelectedObjects(); //Cycle through selected objects while (myEnum.MoveNext()) { //Cast beam if (myEnum.Current is Tekla.Structures.Model.Beam) { var myBeam = myEnum.Current as Beam; // Get part current handles var startPoint = myBeam.StartPoint; var endPoint = myBeam.EndPoint; // Switch part handles myBeam.StartPoint = endPoint; myBeam.EndPoint = startPoint; //Swap uda's for design forces SwapEndForces(myBeam); // modify beam and refresh model + undo myBeam.Modify(); } else if (myEnum.Current is Tekla.Structures.Model.PolyBeam) { var myBeam = myEnum.Current as PolyBeam; // Get part current handles var newPoints = new ArrayList(); var oldPoints = myBeam.Contour.ContourPoints; //Copy points to new seperate list first foreach (var cp in oldPoints) { newPoints.Add(cp); } newPoints.Reverse(); //Swap uda's for design forces SwapEndForces(myBeam); // modify beam and refresh model + undo myBeam.Contour.ContourPoints = newPoints; myBeam.Modify(); } else if (myEnum.Current is Tekla.Structures.Model.ContourPlate) { var myBeam = myEnum.Current as ContourPlate; var newTochki = new ArrayList(); var oldTochki = myBeam.Contour.ContourPoints; foreach (var cp in oldTochki) { newTochki.Add(cp); } newTochki.Reverse(); SwapEndForces(myBeam); myBeam.Contour.ContourPoints = newTochki; myBeam.Modify(); } else if (myEnum.Current is Tekla.Structures.Model.BooleanPart) { BooleanPart boolPart = myEnum.Current as Tekla.Structures.Model.BooleanPart; ContourPlate boolConturPlate = boolPart.OperativePart as Tekla.Structures.Model.ContourPlate; if (boolConturPlate != null) { var newTochki = new ArrayList(); var oldTochki = boolConturPlate.Contour.ContourPoints; foreach (var cp in oldTochki) { newTochki.Add(cp); } newTochki.Reverse(); SwapEndForces(boolConturPlate); boolConturPlate.Contour.ContourPoints = newTochki; boolConturPlate.Modify(); } } } //Update model with changes new Model().CommitChanges(); }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.ContourPlate) { Tekla.Structures.Model.ContourPlate contourPlate = (Tekla.Structures.Model.ContourPlate)modelObjectEnum.Current; TransformationPlane currentTP = new TransformationPlane(); currentTP = model.GetWorkPlaneHandler().GetCurrentTransformationPlane(); model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane()); contourPlate.Select(); Assembly assembly = contourPlate.GetAssembly() as Tekla.Structures.Model.Assembly; assembly.GetReportProperty("ASSEMBLY_POSITION_CODE", ref gridLocation); partType = contourPlate.GetType().Name; partID = contourPlate.Identifier.ID.ToString(); contourPlate.GetReportProperty("OWNER", ref owner); partPrefix = contourPlate.PartNumber.Prefix; partStartNo = contourPlate.PartNumber.StartNumber.ToString(); assemblyPrefix = contourPlate.AssemblyNumber.Prefix; assemblyStartNo = contourPlate.AssemblyNumber.StartNumber.ToString(); Phase CurrentPhase = new Phase(); contourPlate.GetPhase(out CurrentPhase); phase = CurrentPhase.PhaseNumber.ToString(); name = contourPlate.Name; profile = contourPlate.Profile.ProfileString; material = contourPlate.Material.MaterialString; finish = contourPlate.Finish; classValue = contourPlate.Class; if (contourPlate.Position.Plane == Position.PlaneEnum.LEFT) { positionOnPlane = PositionPlaneEnum.Left; } else if (contourPlate.Position.Plane == Position.PlaneEnum.MIDDLE) { positionOnPlane = PositionPlaneEnum.Middle; } else if (contourPlate.Position.Plane == Position.PlaneEnum.RIGHT) { positionOnPlane = PositionPlaneEnum.Right; } positionOnPlaneOffset = contourPlate.Position.PlaneOffset.ToString("F02"); if (contourPlate.Position.Rotation == Position.RotationEnum.BACK) { positionRotation = PositionRotationEnum.Back; } else if (contourPlate.Position.Rotation == Position.RotationEnum.BELOW) { positionRotation = PositionRotationEnum.Below; } else if (contourPlate.Position.Rotation == Position.RotationEnum.FRONT) { positionRotation = PositionRotationEnum.Front; } else if (contourPlate.Position.Rotation == Position.RotationEnum.TOP) { positionRotation = PositionRotationEnum.Top; } positionRotationOffset = contourPlate.Position.RotationOffset.ToString("F02"); if (contourPlate.Position.Depth == Position.DepthEnum.BEHIND) { positionAtDepth = PositionDepthEnum.Behind; } else if (contourPlate.Position.Depth == Position.DepthEnum.FRONT) { positionAtDepth = PositionDepthEnum.Front; } else if (contourPlate.Position.Depth == Position.DepthEnum.MIDDLE) { positionAtDepth = PositionDepthEnum.Middle; } positionAtDepthOffset = contourPlate.Position.DepthOffset.ToString("F02"); //contourPlate.GetUserProperty("USER_FIELD_1", ref userfield1); //contourPlate.GetUserProperty("USER_FIELD_2", ref userfield2); //contourPlate.GetUserProperty("USER_FIELD_3", ref userfield3); //contourPlate.GetUserProperty("USER_FIELD_4", ref userfield4); //contourPlate.GetUserProperty("comment", ref notesComments); //contourPlate.GetUserProperty("FIT_NOTES", ref fittingNotes); //contourPlate.GetUserProperty("FIT_NOTES2", ref fittingNotes2); //contourPlate.GetUserProperty("cambering", ref cambering); //contourPlate.GetUserProperty("PAINT", ref paint); //contourPlate.GetUserProperty("PRELIM_MARK", ref preliminaryMark); //contourPlate.GetUserProperty("PAINT_WFT", ref paintWFT); //contourPlate.GetUserProperty("PAINT_DFT", ref paintDFT); //double dblshear1 = 0; contourPlate.GetUserProperty("shear1", ref dblshear1); dblshear1 = dblshear1 * 0.001; shearStart = dblshear1.ToString(); //double dblshear2 = 0; contourPlate.GetUserProperty("shear2", ref dblshear2); dblshear2 = dblshear2 * 0.001; shearEnd = dblshear2.ToString(); //double dblaxial1 = 0; contourPlate.GetUserProperty("axial1", ref dblaxial1); dblaxial1 = dblaxial1 * 0.001; axialStart = dblaxial1.ToString(); //double dblaxial2 = 0; contourPlate.GetUserProperty("axial2", ref dblaxial2); dblaxial2 = dblaxial2 * 0.001; axialEnd = dblaxial2.ToString(); //double dblmoment1 = 0; contourPlate.GetUserProperty("moment1", ref dblmoment1); dblmoment1 = dblmoment1 * 0.001; momentStart = dblmoment1.ToString(); //double dblmoment2 = 0; contourPlate.GetUserProperty("moment2", ref dblmoment2); dblmoment2 = dblmoment2 * 0.001; momentEnd = dblmoment2.ToString(); //contourPlate.GetUserProperty("CONN_CODE_END1", ref connCodeStart); //contourPlate.GetUserProperty("CONN_CODE_END2", ref connCodeEnd); model.GetWorkPlaneHandler().SetCurrentTransformationPlane(currentTP); } } } if (modelObjectEnum.GetSize() > 1) { partType = ""; partID = ""; owner = ""; gridLocation = ""; partPrefix = ""; partStartNo = ""; assemblyPrefix = ""; assemblyStartNo = ""; phase = ""; name = ""; profile = ""; material = ""; finish = ""; classValue = ""; //userfield1 = ""; //userfield2 = ""; //userfield3 = ""; //userfield4 = ""; //notesComments = ""; //fittingNotes = ""; //fittingNotes2 = ""; //cambering = ""; //paint = ""; //preliminaryMark = ""; //paintWFT = ""; //paintDFT = ""; //shearStart = ""; //shearEnd = ""; //axialStart = ""; //axialEnd = ""; //momentStart = ""; //momentEnd = ""; //connCodeStart = ""; //connCodeEnd = ""; positionOnPlane = new PositionPlaneEnum(); positionOnPlaneOffset = ""; positionRotation = new PositionRotationEnum(); positionRotationOffset = ""; positionAtDepth = new PositionDepthEnum(); positionAtDepthOffset = ""; } }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is BoltGroup) { BoltGroup bolt = (BoltGroup)modelObjectEnum.Current; if (label == "BoltSize") { bolt.BoltSize = double.Parse(boltSize); } if (label == "BoltStandard") { bolt.BoltStandard = boltStandard; // list to sort } if (label == "BoltType") { if (boltType == BoltTypeEnum.Site) { bolt.BoltType = BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE; } if (boltType == BoltTypeEnum.Workshop) { bolt.BoltType = BoltGroup.BoltTypeEnum.BOLT_TYPE_WORKSHOP; } } if (label == "ThreadMaterial") { if (threadMaterial == ThreadMaterialEnum.No) { bolt.ThreadInMaterial = BoltGroup.BoltThreadInMaterialEnum.THREAD_IN_MATERIAL_NO; } if (threadMaterial == ThreadMaterialEnum.Yes) { bolt.ThreadInMaterial = BoltGroup.BoltThreadInMaterialEnum.THREAD_IN_MATERIAL_YES; } } if (label == "CutLength") { bolt.CutLength = double.Parse(cutLength); } if (label == "ExtraLength") { bolt.ExtraLength = double.Parse(extraLength); } if (label == "BoltShaft") { bolt.Bolt = bool.Parse(boltShaft.ToString()); } if (label == "Washer1") { bolt.Washer1 = bool.Parse(washer1.ToString()); } if (label == "Washer2") { bolt.Washer2 = bool.Parse(washer2.ToString()); } if (label == "Washer3") { bolt.Washer3 = bool.Parse(washer3.ToString()); } if (label == "Nut1") { bolt.Nut1 = bool.Parse(nut1.ToString()); } if (label == "Nut2") { bolt.Nut2 = bool.Parse(nut2.ToString()); } if (label == @"BoltDistX \ No Bolts") { if (bolt is BoltArray) { BoltArray boltArray = (BoltArray)bolt; int boltArrayCount = boltArray.GetBoltDistXCount(); for (int i = boltArrayCount - 1; i >= 0; i--) { boltArray.RemoveBoltDistX(i); boltArray.Modify(); } if (boltDistX != "") { string[] splitSpaces = boltDistX.Split(new Char[] { ' ' }); System.Collections.ArrayList arr = new System.Collections.ArrayList(); foreach (string stringText in splitSpaces) { if (stringText.Contains("*")) { string[] splitMultiplier = stringText.Split(new Char[] { '*' }); for (int i = 0; i < int.Parse(splitMultiplier[0]); i++) { arr.Add(double.Parse(splitMultiplier[1].ToString())); } } else { arr.Add(double.Parse(stringText)); } } for (int i = 0; i < arr.Count; i++) { boltArray.SetBoltDistX(i, double.Parse(arr[i].ToString())); } } } else if (bolt is BoltXYList) { MessageBox.Show("Buggered"); } else if (bolt is BoltCircle) { BoltCircle boltCircle = (BoltCircle)bolt; boltCircle.NumberOfBolts = double.Parse(boltDistX); } } if (label == @"BoltDistY \ Diameter") { if (bolt is BoltArray) { BoltArray boltArray = (BoltArray)bolt; int boltArrayCount = boltArray.GetBoltDistYCount(); for (int i = boltArrayCount - 1; i >= 0; i--) { boltArray.RemoveBoltDistY(i); boltArray.Modify(); } if (boltDistY != "") { string[] splitSpaces = boltDistY.Split(new Char[] { ' ' }); System.Collections.ArrayList arr = new System.Collections.ArrayList(); foreach (string stringText in splitSpaces) { if (stringText.Contains("*")) { string[] splitMultiplier = stringText.Split(new Char[] { '*' }); for (int i = 0; i < int.Parse(splitMultiplier[0]); i++) { arr.Add(double.Parse(splitMultiplier[1].ToString())); } } else { arr.Add(double.Parse(stringText)); } } for (int i = 0; i < arr.Count; i++) { boltArray.SetBoltDistY(i, double.Parse(arr[i].ToString())); } } } else if (bolt is BoltXYList) { } else if (bolt is BoltCircle) { BoltCircle boltCircle = (BoltCircle)bolt; boltCircle.Diameter = double.Parse(boltDistY); } } if (label == "Tolerance") { bolt.Tolerance = double.Parse(tolerance); } if (label == "HoleType") { if (holeType == HoleTypeEnum.Standard) { bolt.Hole1 = false; bolt.Hole2 = false; bolt.Hole3 = false; bolt.Hole4 = false; bolt.Hole5 = false; } if (holeType == HoleTypeEnum.Slotted) { bolt.HoleType = BoltGroup.BoltHoleTypeEnum.HOLE_TYPE_SLOTTED; } if (holeType == HoleTypeEnum.Oversized) { bolt.HoleType = BoltGroup.BoltHoleTypeEnum.HOLE_TYPE_OVERSIZED; } } if (label == "SlottedHoleX") { bolt.SlottedHoleX = double.Parse(slottedHoleX); } if (label == "SlottedHoleY") { bolt.SlottedHoleY = double.Parse(slottedHoleY); } if (label == "RotateSlots") { if (rotateSlots == RotateSlotEnum.Even) { bolt.RotateSlots = BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_EVEN; } if (rotateSlots == RotateSlotEnum.Odd) { bolt.RotateSlots = BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_ODD; } if (rotateSlots == RotateSlotEnum.Parallel) { bolt.RotateSlots = BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_PARALLEL; } } if (label == "Hole1") { bolt.Hole1 = bool.Parse(hole1.ToString()); } if (label == "Hole2") { bolt.Hole2 = bool.Parse(hole2.ToString()); } if (label == "Hole3") { bolt.Hole3 = bool.Parse(hole3.ToString()); } if (label == "Hole4") { bolt.Hole4 = bool.Parse(hole4.ToString()); } if (label == "Hole5") { bolt.Hole5 = bool.Parse(hole5.ToString()); } if (label == "OffsetFromStartX") { bolt.StartPointOffset.Dx = double.Parse(offsetFromStartX); } if (label == "OffsetFromStartY") { bolt.StartPointOffset.Dy = double.Parse(offsetFromStartY); } if (label == "OffsetFromStartZ") { bolt.StartPointOffset.Dz = double.Parse(offsetFromStartZ); } if (label == "OffsetFromEndX") { bolt.EndPointOffset.Dx = double.Parse(offsetFromEndX); } if (label == "OffsetFromEndY") { bolt.EndPointOffset.Dy = double.Parse(offsetFromEndY); } if (label == "OffsetFromEndZ") { bolt.EndPointOffset.Dz = double.Parse(offsetFromEndZ); } if (label == "PositionOnPlaneOffset") { bolt.Position.PlaneOffset = double.Parse(positionOnPlaneOffset); } if (label == "PositionRotation") { if (positionRotation == PositionRotationEnum.Back) { bolt.Position.Rotation = Position.RotationEnum.BACK; } if (positionRotation == PositionRotationEnum.Below) { bolt.Position.Rotation = Position.RotationEnum.BELOW; } if (positionRotation == PositionRotationEnum.Front) { bolt.Position.Rotation = Position.RotationEnum.FRONT; } if (positionRotation == PositionRotationEnum.Top) { bolt.Position.Rotation = Position.RotationEnum.TOP; } } if (label == "PositionRotationOffset") { bolt.Position.RotationOffset = double.Parse(positionRotationOffset); } if (label == "At Depth Offset") { bolt.Position.DepthOffset = double.Parse(positionAtDepthOffset); } bolt.Modify(); } } }
public void GetProperties() { Model model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.BaseWeld) { BaseWeld weld = (BaseWeld)modelObjectEnum.Current; refText = weld.ReferenceText; if (weld.AroundWeld) { around = Bool.True; } else { around = Bool.False; } sizeAbove = weld.SizeAbove.ToString(); if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_NONE) { weldTypeAbove = WeldType.WELD_TYPE_NONE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET) { weldTypeAbove = WeldType.WELD_TYPE_FILLET; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weldTypeAbove = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weldTypeAbove = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weldTypeAbove = WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weldTypeAbove = WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weldTypeAbove = WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weldTypeAbove = WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT) { weldTypeAbove = WeldType.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE) { weldTypeAbove = WeldType.WELD_TYPE_FLARE_V_GROOVE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE) { weldTypeAbove = WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE) { weldTypeAbove = WeldType.WELD_TYPE_EDGE_FLANGE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE) { weldTypeAbove = WeldType.WELD_TYPE_CORNER_FLANGE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG) { weldTypeAbove = WeldType.WELD_TYPE_PLUG; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING) { weldTypeAbove = WeldType.WELD_TYPE_BEVEL_BACKING; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT) { weldTypeAbove = WeldType.WELD_TYPE_SPOT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM) { weldTypeAbove = WeldType.WELD_TYPE_SEAM; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT) { weldTypeAbove = WeldType.WELD_TYPE_SLOT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weldTypeAbove = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weldTypeAbove = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH) { weldTypeAbove = WeldType.WELD_TYPE_MELT_THROUGH; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weldTypeAbove = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weldTypeAbove = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE) { weldTypeAbove = WeldType.WELD_TYPE_EDGE; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING) { weldTypeAbove = WeldType.WELD_TYPE_ISO_SURFACING; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD) { weldTypeAbove = WeldType.WELD_TYPE_FOLD; } else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED) { weldTypeAbove = WeldType.WELD_TYPE_INCLINED; } else { Console.WriteLine(weld.TypeAbove); } if (weld.ContourAbove == BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE) { contourTypeAbove = ContourType.None; } else if (weld.ContourAbove == BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH) { contourTypeAbove = ContourType.Flush; } sizeBelow = weld.SizeBelow.ToString(); if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_NONE) { weldTypeBelow = WeldType.WELD_TYPE_NONE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET) { weldTypeBelow = WeldType.WELD_TYPE_FILLET; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weldTypeBelow = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weldTypeBelow = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weldTypeBelow = WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weldTypeBelow = WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weldTypeBelow = WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weldTypeBelow = WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT) { weldTypeBelow = WeldType.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE) { weldTypeBelow = WeldType.WELD_TYPE_FLARE_V_GROOVE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE) { weldTypeBelow = WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE) { weldTypeBelow = WeldType.WELD_TYPE_EDGE_FLANGE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE) { weldTypeBelow = WeldType.WELD_TYPE_CORNER_FLANGE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG) { weldTypeBelow = WeldType.WELD_TYPE_PLUG; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING) { weldTypeBelow = WeldType.WELD_TYPE_BEVEL_BACKING; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT) { weldTypeBelow = WeldType.WELD_TYPE_SPOT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM) { weldTypeBelow = WeldType.WELD_TYPE_SEAM; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT) { weldTypeBelow = WeldType.WELD_TYPE_SLOT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weldTypeBelow = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weldTypeBelow = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH) { weldTypeBelow = WeldType.WELD_TYPE_MELT_THROUGH; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weldTypeBelow = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weldTypeBelow = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE) { weldTypeBelow = WeldType.WELD_TYPE_EDGE; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING) { weldTypeBelow = WeldType.WELD_TYPE_ISO_SURFACING; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD) { weldTypeBelow = WeldType.WELD_TYPE_FOLD; } else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED) { weldTypeBelow = WeldType.WELD_TYPE_INCLINED; } else { Console.WriteLine(weld.TypeBelow); } if (weld.ContourBelow == BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE) { contourTypeBelow = ContourType.None; } else if (weld.ContourBelow == BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH) { contourTypeBelow = ContourType.Flush; } } } } else { sizeAbove = ""; weldTypeAbove = new WeldType(); contourTypeAbove = new ContourType(); sizeBelow = ""; weldTypeBelow = new WeldType(); contourTypeBelow = new ContourType(); refText = ""; around = new Bool(); } }
internal static void Run() { try { Operation.DisplayPrompt("Обработка…"); PleaseWaitForm pleaseWait = new PleaseWaitForm(); pleaseWait.Show(); Application.DoEvents(); Model model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator selectedObjects = selector.GetSelectedObjects(); ModelObjectEnumerator objects; if (selectedObjects.GetSize() > 0) { objects = selectedObjects; } else { objects = model.GetModelObjectSelector().GetAllObjectsWithType(new Type[] { typeof(Assembly) }); } List <Detail> details = new List <Detail>(); List <Detail> unknownDetails = new List <Detail>(); if (objects.GetSize() > 0) { string ru_shifr = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_shifr", ref ru_shifr); model.GetProjectInfo().GetUserProperty("grafa_1", ref ru_shifr); string ru_object_stroit_1 = string.Empty; string ru_object_stroit_2 = string.Empty; string ru_object_stroit_3 = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_objekt_stroit_1", ref ru_object_stroit_1); //model.GetProjectInfo().GetUserProperty("ru_objekt_stroit_2", ref ru_object_stroit_2); //model.GetProjectInfo().GetUserProperty("ru_objekt_stroit_3", ref ru_object_stroit_3); model.GetProjectInfo().GetUserProperty("grafa_2", ref ru_object_stroit_1); string ru_naimen_stroit_1 = string.Empty; string ru_naimen_stroit_2 = string.Empty; string ru_naimen_stroit_3 = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_naimen_stroit_1", ref ru_naimen_stroit_1); //model.GetProjectInfo().GetUserProperty("ru_naimen_stroit_2", ref ru_naimen_stroit_2); //model.GetProjectInfo().GetUserProperty("ru_naimen_stroit_3", ref ru_naimen_stroit_3); model.GetProjectInfo().GetUserProperty("grafa_3", ref ru_naimen_stroit_1); string ru_6 = string.Empty; string ru_7 = string.Empty; string ru_8 = string.Empty; string ru_9 = string.Empty; string ru_10 = string.Empty; string ru_11 = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_6", ref ru_6); //model.GetProjectInfo().GetUserProperty("ru_7", ref ru_7); //model.GetProjectInfo().GetUserProperty("ru_8", ref ru_8); //model.GetProjectInfo().GetUserProperty("ru_9", ref ru_9); //model.GetProjectInfo().GetUserProperty("ru_10", ref ru_10); //model.GetProjectInfo().GetUserProperty("ru_11", ref ru_11); string ru_6_fam = string.Empty; string ru_7_fam = string.Empty; string ru_8_fam = string.Empty; string ru_9_fam = string.Empty; string ru_10_fam = string.Empty; string ru_11_fam = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_6_fam", ref ru_6_fam); //model.GetProjectInfo().GetUserProperty("ru_7_fam", ref ru_7_fam); //model.GetProjectInfo().GetUserProperty("ru_8_fam", ref ru_8_fam); //model.GetProjectInfo().GetUserProperty("ru_9_fam", ref ru_9_fam); //model.GetProjectInfo().GetUserProperty("ru_10_fam", ref ru_10_fam); //model.GetProjectInfo().GetUserProperty("ru_11_fam", ref ru_11_fam); model.GetProjectInfo().GetUserProperty("razrabotal", ref ru_6_fam); model.GetProjectInfo().GetUserProperty("proveril", ref ru_7_fam); model.GetProjectInfo().GetUserProperty("nach_gruppy", ref ru_8_fam); model.GetProjectInfo().GetUserProperty("n_control", ref ru_9_fam); model.GetProjectInfo().GetUserProperty("nach_otdela", ref ru_10_fam); model.GetProjectInfo().GetUserProperty("glav_eng", ref ru_11_fam); string ru_stadiya = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_stadiya", ref ru_stadiya); model.GetProjectInfo().GetUserProperty("grafa_6", ref ru_stadiya); string ru_listov = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_listov", ref ru_listov); model.GetProjectInfo().GetUserProperty("grafa_8", ref ru_listov); int ru_listov_int = 0; int.TryParse(ru_listov, out ru_listov_int); string ru_nazvanie_org_1 = string.Empty; string ru_nazvanie_org_2 = string.Empty; string ru_nazvanie_org_3 = string.Empty; //model.GetProjectInfo().GetUserProperty("ru_nazvanie_org_1", ref ru_nazvanie_org_1); //model.GetProjectInfo().GetUserProperty("ru_nazvanie_org_2", ref ru_nazvanie_org_2); //model.GetProjectInfo().GetUserProperty("ru_nazvanie_org_3", ref ru_nazvanie_org_3); model.GetProjectInfo().GetUserProperty("grafa_9", ref ru_nazvanie_org_1); string[] categories = new string[14]; model.GetProjectInfo().GetUserProperty("cm_kat_5", ref categories[0]); model.GetProjectInfo().GetUserProperty("cm_kat_6", ref categories[1]); model.GetProjectInfo().GetUserProperty("cm_kat_7", ref categories[2]); model.GetProjectInfo().GetUserProperty("cm_kat_8", ref categories[3]); model.GetProjectInfo().GetUserProperty("cm_kat_9", ref categories[4]); model.GetProjectInfo().GetUserProperty("cm_kat_10", ref categories[5]); model.GetProjectInfo().GetUserProperty("cm_kat_11", ref categories[6]); model.GetProjectInfo().GetUserProperty("cm_kat_12", ref categories[7]); model.GetProjectInfo().GetUserProperty("cm_kat_13", ref categories[8]); model.GetProjectInfo().GetUserProperty("cm_kat_14", ref categories[9]); model.GetProjectInfo().GetUserProperty("cm_kat_15", ref categories[10]); model.GetProjectInfo().GetUserProperty("cm_kat_16", ref categories[11]); model.GetProjectInfo().GetUserProperty("cm_kat_17", ref categories[12]); model.GetProjectInfo().GetUserProperty("cm_kat_18", ref categories[13]); bool isNonAssemblyExist = false; while (objects.MoveNext()) { ModelObject obj = objects.Current as ModelObject; if (obj != null) { if (obj is Assembly) { Assembly assy = obj as Assembly; if (assy.GetAssemblyType() == Assembly.AssemblyTypeEnum.STEEL_ASSEMBLY) { int assyCategory = 0; bool result = assy.GetUserProperty("cm_kat", ref assyCategory); if (result) { assyCategory += 5; } List <Part> descendants = new List <Part>(); TeklaUtils.GetDescendants(assy, ref descendants); foreach (Part part in descendants) { string standard = string.Empty; string profile = part.Profile.ProfileString; string material = string.Empty; part.GetReportProperty("MATERIAL", ref material); double weight = 0.0; part.GetReportProperty("WEIGHT", ref weight); weight /= 1000; double length = 0.0; part.GetReportProperty("LENGTH", ref length); int sortOrder = 0; string fireResist = string.Empty; part.GetUserProperty("FIRE_RESIST_VNP", ref fireResist); if ((part is Beam) || (part is PolyBeam)) { string temp = part.Profile.ProfileString.ToUpper(); if (temp.StartsWith("—") || (temp.StartsWith("PL")) || (temp.StartsWith("BL")) || (temp.StartsWith("FL")) || (temp.StartsWith("BPL")) || (temp.StartsWith("FLT")) || (temp.StartsWith("FPL")) || (temp.StartsWith("PLT")) || (temp.StartsWith("PLATE")) || (temp.StartsWith("TANKO")) || (temp.StartsWith("ПОЛОСА"))) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(temp.IndexOf("*") + 1)}", material, weight, 4, fireResist)); } else if (temp.StartsWith("ПВ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8706-78", $"Лист {temp.Substring(temp.IndexOf("*") + 1)}", "C235", weight, 13, fireResist)); } else if (temp.StartsWith("РИФ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8568-77", $"Лист {temp.Substring(temp.IndexOf("*") + 1)}", "C235", weight, 14, fireResist)); } else if (temp.StartsWith("ЧРИФ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8568-77", $"Лист {temp.Substring(temp.IndexOf("*") + 1)}", "C235", weight, 15, fireResist)); } else { LibraryProfileItem profileItem = new LibraryProfileItem(); profileItem.ProfileName = part.Profile.ProfileString; profileItem.Select(); ArrayList parameters = profileItem.aProfileItemUserParameters; if (parameters.Count > 0) { foreach (ProfileItemParameter parameter in parameters) { if (parameter.Property == "GOST_NAME") { standard = parameter.StringValue; } if (parameter.Property == "TPL_SORT") { int.TryParse(parameter.StringValue, out sortOrder); } } details.Add(new Detail(part, assyCategory, standard, profile, material, weight, sortOrder, fireResist)); } else { unknownDetails.Add(new Detail(part, assyCategory, "???", profile, material, weight, 999, fireResist)); } } } else if (part is ContourPlate) { string temp = part.Profile.ProfileString.ToUpper(); if (temp.StartsWith("—")) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(1)}", material, weight, 4, fireResist)); } else if ((temp.StartsWith("PL")) || (temp.StartsWith("BL")) || (temp.StartsWith("FL"))) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(2)}", material, weight, 4, fireResist)); } else if ((temp.StartsWith("BPL")) || (temp.StartsWith("FLT")) || (temp.StartsWith("FPL")) || (temp.StartsWith("PLT"))) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(3)}", material, weight, 4, fireResist)); } else if ((temp.StartsWith("PLATE")) || (temp.StartsWith("TANKO"))) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(5)}", material, weight, 4, fireResist)); } else if (temp.StartsWith("ПОЛОСА")) { details.Add(new Detail(part, assyCategory, "ГОСТ 19903-74", $"Лист {temp.Substring(6)}", material, weight, 4, fireResist)); } else if (temp.StartsWith("ПВ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8706-78", $"Лист {temp.Substring(2)}", "C235", weight, 13, fireResist)); } else if (temp.StartsWith("РИФ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8568-77", $"Лист {temp.Substring(3)}", "C235", weight, 14, fireResist)); } else if (temp.StartsWith("ЧРИФ")) { details.Add(new Detail(part, assyCategory, "ГОСТ 8568-77", $"Лист {temp.Substring(4)}", "C235", weight, 15, fireResist)); } else { unknownDetails.Add(new Detail(part, assyCategory, "???", $"{part.Profile.ProfileString}", material, weight, 999, fireResist)); } } } } } else { if (!(obj is Grid)) { isNonAssemblyExist = true; } } } } if (isNonAssemblyExist == true) { MessageBox.Show("Среди выбранных объектов есть объекты не являющиеся сборками.\r\nВыберите только сборки или не выбирайте ничего и запустите программу снова.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); pleaseWait.Close(); pleaseWait.Dispose(); Operation.DisplayPrompt("Ошибка."); return; } IEnumerable <StandardGroup> groups = from d in details orderby d.SortOrder group d by d.StandardFull into g select new StandardGroup() { Key = g.Key, materials = from d in g orderby d.MaterialFull group d by d.MaterialFull into g2 select new MaterialGroup() { Key = g2.Key, profiles = from d in g2 orderby d.Profile group d by d.Profile into g3 select new ProfileGroup() { Key = g3.Key, categories = from d in g3 orderby d.Category group d by d.Category into g4 select new CategoryGroup() { Key = g4.Key, fireResists = from d in g4 group d by d.FireResist into g5 select g5 } } } }; JObject json = new JObject( new JProperty("ID", 0), new JProperty("Name", null), new JProperty("Profiles", null), new JProperty("Revision", 0), new JProperty("AntiCor", false), new JProperty("Cipher", ru_shifr), new JProperty("BuildingObject1", ru_object_stroit_1), new JProperty("BuildingObject2", ru_object_stroit_2), new JProperty("BuildingObject3", ru_object_stroit_3), new JProperty("BuildingName1", ru_naimen_stroit_1), new JProperty("BuildingName2", ru_naimen_stroit_2), new JProperty("BuildingName3", ru_naimen_stroit_3), new JProperty("AttName6", ru_6), new JProperty("AttName7", ru_7), new JProperty("AttName8", ru_8), new JProperty("AttName9", ru_9), new JProperty("AttName10", ru_10), new JProperty("AttName11", ru_11), new JProperty("AttValue6", ru_6_fam), new JProperty("AttValue7", ru_7_fam), new JProperty("AttValue8", ru_8_fam), new JProperty("AttValue9", ru_9_fam), new JProperty("AttValue10", ru_10_fam), new JProperty("AttValue11", ru_11_fam), new JProperty("Stage", ru_stadiya), new JProperty("Sheets", ru_listov_int), new JProperty("OrganzitaionName1", ru_nazvanie_org_1), new JProperty("OrganzitaionName2", ru_nazvanie_org_2), new JProperty("OrganzitaionName3", ru_nazvanie_org_3), new JProperty("Headers", new JArray(categories)), new JProperty("Documents", new JArray( from p in groups select new JObject( new JProperty("ID", 0), new JProperty("Name", p.Key), new JProperty("ProfilesTotal", new JArray()), new JProperty("ProfilesCount", 0), new JProperty("TotalWeight", 0), new JProperty("IsSelected", false), new JProperty("IsModified", false), new JProperty("Materials", new JArray( from q in p.materials select new JObject( new JProperty("ID", 0), new JProperty("Name", q.Key), new JProperty("TotalConstructionsWeight", new JArray()), new JProperty("TotalWeight", 0), new JProperty("IsSelected", false), new JProperty("IsModified", false), new JProperty("Profiles", new JArray( from r in q.profiles select new JObject( new JProperty("ID", 0), new JProperty("Name", r.Key), new JProperty("Tag", null), new JProperty("ProfileItems", new JArray()), new JProperty("Weight", 0), new JProperty("IsModified", false), new JProperty("ConstructionTypes", new JArray( new JObject( new JProperty("Name", ""), new JProperty("Constructions", new JArray( from s in r.categories select new JObject( new JProperty("ID", s.Key), new JProperty("Name", ""), new JProperty("Count", GetConstructionWeight(s)), new JProperty("Profiles", null), new JProperty("IsModified", false), new JProperty("FireResists", new JArray( from t in s.fireResists select new JObject( new JProperty("Name", t.Key), new JProperty("Count", GetFireResistWeight(t)) ))))))))))))))))))); string jsonFilePath = $"{Environment.GetEnvironmentVariable("USERPROFILE")}\\TeklaMetalSpec.json"; using (StreamWriter writer = new StreamWriter(jsonFilePath, false, Encoding.UTF8)) { writer.Write(json.ToString()); } } pleaseWait.Close(); pleaseWait.Dispose(); Operation.DisplayPrompt("Завершено."); } catch (Exception ex) { MessageBox.Show($"{ex.StackTrace}\r\n\r\n{ex.Message}"); } }
internal List <TSM.BaseComponent> GetSelectedComponents() { var selector = new TSM.UI.ModelObjectSelector(); return(selector.GetSelectedObjects().ToList <TSM.BaseComponent>(true)); }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is BaseWeld) { BaseWeld weld = (BaseWeld)modelObjectEnum.Current; if (label == "SizeAbove") weld.SizeAbove = double.Parse(sizeAbove); if (label == "WeldTypeAbove") { if (weldTypeAbove == WeldType.WELD_TYPE_NONE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; else if (weldTypeAbove == WeldType.WELD_TYPE_FILLET) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; else if (weldTypeAbove == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_V_GROOVE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE_FLANGE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; else if (weldTypeAbove == WeldType.WELD_TYPE_CORNER_FLANGE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; else if (weldTypeAbove == WeldType.WELD_TYPE_PLUG) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_BACKING) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; else if (weldTypeAbove == WeldType.WELD_TYPE_SPOT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; else if (weldTypeAbove == WeldType.WELD_TYPE_SEAM) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; else if (weldTypeAbove == WeldType.WELD_TYPE_SLOT) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; else if (weldTypeAbove == WeldType.WELD_TYPE_MELT_THROUGH) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; else if (weldTypeAbove == WeldType.WELD_TYPE_ISO_SURFACING) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; else if (weldTypeAbove == WeldType.WELD_TYPE_FOLD) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; else if (weldTypeAbove == WeldType.WELD_TYPE_INCLINED) weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } if (label == "ContourTypeAbove") { if (contourTypeAbove == ContourType.None) weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; else if (contourTypeAbove == ContourType.Flush) weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } if (label == "SizeBelow") weld.SizeBelow = double.Parse(sizeBelow); if (label == "WeldTypeBelow") { if (weldTypeBelow == WeldType.WELD_TYPE_NONE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; else if (weldTypeBelow == WeldType.WELD_TYPE_FILLET) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; else if (weldTypeBelow == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_V_GROOVE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE_FLANGE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; else if (weldTypeBelow == WeldType.WELD_TYPE_CORNER_FLANGE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; else if (weldTypeBelow == WeldType.WELD_TYPE_PLUG) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_BACKING) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; else if (weldTypeBelow == WeldType.WELD_TYPE_SPOT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; else if (weldTypeBelow == WeldType.WELD_TYPE_SEAM) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; else if (weldTypeBelow == WeldType.WELD_TYPE_SLOT) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; else if (weldTypeBelow == WeldType.WELD_TYPE_MELT_THROUGH) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; else if (weldTypeBelow == WeldType.WELD_TYPE_ISO_SURFACING) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; else if (weldTypeBelow == WeldType.WELD_TYPE_FOLD) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; else if (weldTypeBelow == WeldType.WELD_TYPE_INCLINED) weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } if (label == "ContourTypeBelow") { if (contourTypeBelow == ContourType.None) weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; else if (contourTypeBelow == ContourType.Flush) weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } if (label == "RefText") weld.ReferenceText = refText; if (label == "Around") { if (around == Bool.True) weld.AroundWeld = true; else weld.AroundWeld = false; } weld.Modify(); } } }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Connection) { Connection connection = (Connection)modelObjectEnum.Current; if (label == "Code") connection.Code = code; connection.Modify(); } } }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.BoltGroup) { BoltGroup boltGroup = (BoltGroup)modelObjectEnum.Current; boltSize = boltGroup.BoltSize.ToString(); boltStandard = boltGroup.BoltStandard.ToString(); if (boltGroup.BoltType == BoltGroup.BoltTypeEnum.BOLT_TYPE_SITE) { boltType = BoltTypeEnum.Site; } else if (boltGroup.BoltType == BoltGroup.BoltTypeEnum.BOLT_TYPE_WORKSHOP) { boltType = BoltTypeEnum.Workshop; } if (boltGroup.ThreadInMaterial == BoltGroup.BoltThreadInMaterialEnum.THREAD_IN_MATERIAL_YES) { threadMaterial = ThreadMaterialEnum.Yes; } else if (boltGroup.ThreadInMaterial == BoltGroup.BoltThreadInMaterialEnum.THREAD_IN_MATERIAL_NO) { threadMaterial = ThreadMaterialEnum.No; } cutLength = boltGroup.CutLength.ToString(); extraLength = boltGroup.ExtraLength.ToString(); boltGroupShape = boltGroup.GetType().Name; if (boltGroup is BoltArray) { BoltArray boltArray = (BoltArray)boltGroup; string boltPositionX = ""; for (int i = 0; i < boltArray.GetBoltDistXCount(); i++) { boltPositionX = boltPositionX + boltArray.GetBoltDistX(i).ToString() + " "; } boltDistX = boltPositionX.Trim(); string boltPositionY = ""; for (int i = 0; i < boltArray.GetBoltDistYCount(); i++) { boltPositionY = boltPositionY + boltArray.GetBoltDistY(i).ToString() + " "; } boltDistY = boltPositionY.Trim(); } else if (boltGroup is BoltXYList) { BoltXYList boltXYList = (BoltXYList)boltGroup; string boltPositionX = ""; for (int i = 0; i < boltXYList.GetBoltDistXCount(); i++) { boltPositionX = boltPositionX + boltXYList.GetBoltDistX(i).ToString() + " "; } boltDistX = boltPositionX.Trim(); string boltPositionY = ""; for (int i = 0; i < boltXYList.GetBoltDistYCount(); i++) { boltPositionY = boltPositionY + boltXYList.GetBoltDistY(i).ToString() + " "; } boltDistY = boltPositionY.Trim(); } else if (boltGroup is BoltCircle) { BoltCircle boltCircle = (BoltCircle)boltGroup; boltDistX = boltCircle.NumberOfBolts.ToString(); boltDistY = boltCircle.Diameter.ToString(); } tolerance = boltGroup.Tolerance.ToString(); if (boltGroup.HoleType == BoltGroup.BoltHoleTypeEnum.HOLE_TYPE_SLOTTED) { holeType = HoleTypeEnum.Slotted; } else if (boltGroup.HoleType == BoltGroup.BoltHoleTypeEnum.HOLE_TYPE_OVERSIZED) { holeType = HoleTypeEnum.Oversized; } slottedHoleX = boltGroup.SlottedHoleX.ToString(); slottedHoleY = boltGroup.SlottedHoleY.ToString(); if (boltGroup.RotateSlots == BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_ODD) { rotateSlots = RotateSlotEnum.Odd; } else if (boltGroup.RotateSlots == BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_EVEN) { rotateSlots = RotateSlotEnum.Even; } else if (boltGroup.RotateSlots == BoltGroup.BoltRotateSlotsEnum.ROTATE_SLOTS_PARALLEL) { rotateSlots = RotateSlotEnum.Parallel; } if (boltGroup.Position.Plane == Position.PlaneEnum.LEFT) { positionOnPlane = PositionPlaneEnum.Left; } else if (boltGroup.Position.Plane == Position.PlaneEnum.MIDDLE) { positionOnPlane = PositionPlaneEnum.Middle; } else if (boltGroup.Position.Plane == Position.PlaneEnum.RIGHT) { positionOnPlane = PositionPlaneEnum.Right; } positionOnPlaneOffset = boltGroup.Position.PlaneOffset.ToString("F02"); if (boltGroup.Position.Rotation == Position.RotationEnum.FRONT) { positionRotation = PositionRotationEnum.Front; } else if (boltGroup.Position.Rotation == Position.RotationEnum.TOP) { positionRotation = PositionRotationEnum.Top; } else if (boltGroup.Position.Rotation == Position.RotationEnum.BACK) { positionRotation = PositionRotationEnum.Back; } else if (boltGroup.Position.Rotation == Position.RotationEnum.BELOW) { positionRotation = PositionRotationEnum.Below; } positionRotationOffset = boltGroup.Position.RotationOffset.ToString("F02"); if (boltGroup.Position.Depth == Position.DepthEnum.BEHIND) { positionAtDepth = PositionDepthEnum.Behind; } else if (boltGroup.Position.Depth == Position.DepthEnum.FRONT) { positionAtDepth = PositionDepthEnum.Front; } else if (boltGroup.Position.Depth == Position.DepthEnum.MIDDLE) { positionAtDepth = PositionDepthEnum.Middle; } positionAtDepthOffset = boltGroup.Position.DepthOffset.ToString("F02"); offsetFromStartX = boltGroup.StartPointOffset.Dx.ToString("F02"); offsetFromStartY = boltGroup.StartPointOffset.Dy.ToString("F02"); offsetFromStartZ = boltGroup.StartPointOffset.Dz.ToString("F02"); offsetFromEndX = boltGroup.EndPointOffset.Dx.ToString("F02"); offsetFromEndY = boltGroup.EndPointOffset.Dy.ToString("F02"); offsetFromEndZ = boltGroup.EndPointOffset.Dz.ToString("F02"); if (boltGroup.Hole1) { hole1 = Bool.True; } else { hole1 = Bool.False; } if (boltGroup.Hole2) { hole2 = Bool.True; } else { hole2 = Bool.False; } if (boltGroup.Hole3) { hole3 = Bool.True; } else { hole3 = Bool.False; } if (boltGroup.Hole4) { hole4 = Bool.True; } else { hole4 = Bool.False; } if (boltGroup.Hole5) { hole5 = Bool.True; } else { hole5 = Bool.False; } if (boltGroup.Washer1) { washer1 = Bool.True; } else { washer1 = Bool.False; } if (boltGroup.Washer2) { washer2 = Bool.True; } else { washer2 = Bool.False; } if (boltGroup.Washer3) { washer3 = Bool.True; } else { washer3 = Bool.False; } if (boltGroup.Nut1) { nut1 = Bool.True; } else { nut1 = Bool.False; } if (boltGroup.Nut2) { nut2 = Bool.True; } else { nut2 = Bool.False; } if (boltGroup.Bolt) { boltShaft = Bool.True; } else { boltShaft = Bool.False; } } } } if (modelObjectEnum.GetSize() > 1) { boltSize = ""; boltStandard = ""; boltType = new BoltTypeEnum(); threadMaterial = new ThreadMaterialEnum(); cutLength = ""; extraLength = ""; boltGroupShape = ""; boltDistX = ""; boltDistY = ""; tolerance = ""; slottedHoleX = ""; slottedHoleY = ""; rotateSlots = new RotateSlotEnum(); holeType = new HoleTypeEnum(); positionOnPlane = new PositionPlaneEnum(); positionOnPlaneOffset = ""; positionRotation = new PositionRotationEnum(); positionRotationOffset = ""; positionAtDepth = new PositionDepthEnum(); positionAtDepthOffset = ""; offsetFromStartX = ""; offsetFromStartY = ""; offsetFromStartZ = ""; offsetFromEndX = ""; offsetFromEndY = ""; offsetFromEndZ = ""; hole1 = new Bool(); hole2 = new Bool(); hole3 = new Bool(); hole4 = new Bool(); hole5 = new Bool(); boltShaft = new Bool(); washer1 = new Bool(); washer2 = new Bool(); washer3 = new Bool(); nut1 = new Bool(); nut2 = new Bool(); } }
private void UpdateProperties() { if (this.propertyGrid1.InvokeRequired) { UpdatePropertiesCallback d = new UpdatePropertiesCallback(UpdateProperties); this.Invoke(d); } else { Drawing drawing = drawingHandler.GetActiveDrawing(); if (drawing != null) { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); statusLabel.Text = drawingObjectEnum.GetSize().ToString() + " objects selected"; ArrayList arraySelectedObjects = new ArrayList(); if (drawingObjectEnum.GetSize() == 0) { activeDrawing.GetProperties(); propertyGrid1.SelectedObject = activeDrawing; } while (drawingObjectEnum.MoveNext()) { string objectType = drawingObjectEnum.Current.GetType().ToString(); if (!arraySelectedObjects.Contains(objectType)) arraySelectedObjects.Add(objectType); } comboBox1.Text = ""; comboBox1.Items.Clear(); arraySelectedObjects.Sort(); foreach (string objectName in arraySelectedObjects) comboBox1.Items.Add(objectName); if (arraySelectedObjects.Count == 1) { if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Part") { drawingPart.GetProperties(); propertyGrid1.SelectedObject = drawingPart; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Weld") { drawingWeld.GetProperties(); propertyGrid1.SelectedObject = drawingWeld; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.View") { view.GetProperties(); propertyGrid1.SelectedObject = view; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Bolt") { drawingBolt.GetProperties(); propertyGrid1.SelectedObject = drawingBolt; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.StraightDimensionSet") { straightDim.GetProperties(); propertyGrid1.SelectedObject = straightDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.RadiusDimension") { radiusDim.GetProperties(); propertyGrid1.SelectedObject = radiusDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.CurvedDimensionSetRadial") { radialDim.GetProperties(); propertyGrid1.SelectedObject = radialDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.AngleDimension") { angleDim.GetProperties(); propertyGrid1.SelectedObject = angleDim; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.GridLine") { drawingGrid.GetProperties(); propertyGrid1.SelectedObject = drawingGrid; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Line") { line.GetProperties(); propertyGrid1.SelectedObject = line; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Arc") { arc.GetProperties(); propertyGrid1.SelectedObject = arc; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Polyline") { polyline.GetProperties(); propertyGrid1.SelectedObject = polyline; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Rectangle") { rectangle.GetProperties(); propertyGrid1.SelectedObject = rectangle; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Circle") { circle.GetProperties(); propertyGrid1.SelectedObject = circle; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Polygon") { polygon.GetProperties(); propertyGrid1.SelectedObject = polygon; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Text") { text.GetProperties(); propertyGrid1.SelectedObject = text; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Symbol") { symbol.GetProperties(); propertyGrid1.SelectedObject = symbol; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Drawing.Mark") { mark.GetProperties(); propertyGrid1.SelectedObject = mark; } else { activeDrawing.GetProperties(); propertyGrid1.SelectedObject = activeDrawing; } comboBox1.SelectedText = arraySelectedObjects[0].ToString(); propertyGrid1.Focus(); } if (arraySelectedObjects.Count > 1) propertyGrid1.SelectedObject = null; } if (drawing == null) { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); statusLabel.Text = modelObjectEnum.GetSize().ToString() + " objects selected"; ArrayList arraySelectedObjects = new ArrayList(); if (modelObjectEnum.GetSize() == 0) propertyGrid1.SelectedObject = null; while (modelObjectEnum.MoveNext()) { string objectType = modelObjectEnum.Current.GetType().ToString(); if (!arraySelectedObjects.Contains(objectType)) arraySelectedObjects.Add(objectType); } comboBox1.Text = ""; comboBox1.Items.Clear(); arraySelectedObjects.Sort(); foreach (string objectName in arraySelectedObjects) comboBox1.Items.Add(objectName); if (arraySelectedObjects.Count == 0) { Tekla.Structures.Model.UI.ModelViewEnumerator modelViewEnum = Tekla.Structures.Model.UI.ViewHandler.GetSelectedViews(); if (modelViewEnum.Count == 1) { modelView.GetProperties(); propertyGrid1.SelectedObject = modelView; comboBox1.SelectedText = "Tekla.Structures.Model.UI.View"; propertyGrid1.Focus(); } } if (arraySelectedObjects.Count == 1) { if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Beam") { beam.GetProperties(); propertyGrid1.SelectedObject = beam; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.ContourPlate") { contourPlate.GetProperties(); propertyGrid1.SelectedObject = contourPlate; } else if (arraySelectedObjects[0].ToString().Contains("Tekla.Structures.Model.Weld")) { modelWeld.GetProperties(); propertyGrid1.SelectedObject = modelWeld; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.PolygonWeld") { modelWeld.GetProperties(); propertyGrid1.SelectedObject = modelWeld; } else if (arraySelectedObjects[0].ToString().Contains("Tekla.Structures.Model.Bolt")) { modelBolt.GetProperties(); propertyGrid1.SelectedObject = modelBolt; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Grid") { modelGrid.GetProperties(); propertyGrid1.SelectedObject = modelGrid; } else if (arraySelectedObjects[0].ToString() == "Tekla.Structures.Model.Connection") { modelConnection.GetProperties(); propertyGrid1.SelectedObject = modelConnection; } comboBox1.SelectedText = arraySelectedObjects[0].ToString(); propertyGrid1.Focus(); } if (arraySelectedObjects.Count > 1) propertyGrid1.SelectedObject = null; } } }
public void GetProperties() { Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.ContourPlate) { Tekla.Structures.Model.ContourPlate contourPlate = (Tekla.Structures.Model.ContourPlate)modelObjectEnum.Current; TransformationPlane currentTP = new TransformationPlane(); currentTP = model.GetWorkPlaneHandler().GetCurrentTransformationPlane(); model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane()); contourPlate.Select(); Assembly assembly = contourPlate.GetAssembly() as Tekla.Structures.Model.Assembly; assembly.GetReportProperty("ASSEMBLY_POSITION_CODE", ref gridLocation); partType = contourPlate.GetType().Name; partID = contourPlate.Identifier.ID.ToString(); contourPlate.GetReportProperty("OWNER", ref owner); partPrefix = contourPlate.PartNumber.Prefix; partStartNo = contourPlate.PartNumber.StartNumber.ToString(); assemblyPrefix = contourPlate.AssemblyNumber.Prefix; assemblyStartNo = contourPlate.AssemblyNumber.StartNumber.ToString(); Phase CurrentPhase = new Phase(); contourPlate.GetPhase(out CurrentPhase); phase = CurrentPhase.PhaseNumber.ToString(); name = contourPlate.Name; profile = contourPlate.Profile.ProfileString; material = contourPlate.Material.MaterialString; finish = contourPlate.Finish; classValue = contourPlate.Class; if (contourPlate.Position.Plane == Position.PlaneEnum.LEFT) positionOnPlane = PositionPlaneEnum.Left; else if (contourPlate.Position.Plane == Position.PlaneEnum.MIDDLE) positionOnPlane = PositionPlaneEnum.Middle; else if (contourPlate.Position.Plane == Position.PlaneEnum.RIGHT) positionOnPlane = PositionPlaneEnum.Right; positionOnPlaneOffset = contourPlate.Position.PlaneOffset.ToString("F02"); if (contourPlate.Position.Rotation == Position.RotationEnum.BACK) positionRotation = PositionRotationEnum.Back; else if (contourPlate.Position.Rotation == Position.RotationEnum.BELOW) positionRotation = PositionRotationEnum.Below; else if (contourPlate.Position.Rotation == Position.RotationEnum.FRONT) positionRotation = PositionRotationEnum.Front; else if (contourPlate.Position.Rotation == Position.RotationEnum.TOP) positionRotation = PositionRotationEnum.Top; positionRotationOffset = contourPlate.Position.RotationOffset.ToString("F02"); if (contourPlate.Position.Depth == Position.DepthEnum.BEHIND) positionAtDepth = PositionDepthEnum.Behind; else if (contourPlate.Position.Depth == Position.DepthEnum.FRONT) positionAtDepth = PositionDepthEnum.Front; else if (contourPlate.Position.Depth == Position.DepthEnum.MIDDLE) positionAtDepth = PositionDepthEnum.Middle; positionAtDepthOffset = contourPlate.Position.DepthOffset.ToString("F02"); //contourPlate.GetUserProperty("USER_FIELD_1", ref userfield1); //contourPlate.GetUserProperty("USER_FIELD_2", ref userfield2); //contourPlate.GetUserProperty("USER_FIELD_3", ref userfield3); //contourPlate.GetUserProperty("USER_FIELD_4", ref userfield4); //contourPlate.GetUserProperty("comment", ref notesComments); //contourPlate.GetUserProperty("FIT_NOTES", ref fittingNotes); //contourPlate.GetUserProperty("FIT_NOTES2", ref fittingNotes2); //contourPlate.GetUserProperty("cambering", ref cambering); //contourPlate.GetUserProperty("PAINT", ref paint); //contourPlate.GetUserProperty("PRELIM_MARK", ref preliminaryMark); //contourPlate.GetUserProperty("PAINT_WFT", ref paintWFT); //contourPlate.GetUserProperty("PAINT_DFT", ref paintDFT); //double dblshear1 = 0; contourPlate.GetUserProperty("shear1", ref dblshear1); dblshear1 = dblshear1 * 0.001; shearStart = dblshear1.ToString(); //double dblshear2 = 0; contourPlate.GetUserProperty("shear2", ref dblshear2); dblshear2 = dblshear2 * 0.001; shearEnd = dblshear2.ToString(); //double dblaxial1 = 0; contourPlate.GetUserProperty("axial1", ref dblaxial1); dblaxial1 = dblaxial1 * 0.001; axialStart = dblaxial1.ToString(); //double dblaxial2 = 0; contourPlate.GetUserProperty("axial2", ref dblaxial2); dblaxial2 = dblaxial2 * 0.001; axialEnd = dblaxial2.ToString(); //double dblmoment1 = 0; contourPlate.GetUserProperty("moment1", ref dblmoment1); dblmoment1 = dblmoment1 * 0.001; momentStart = dblmoment1.ToString(); //double dblmoment2 = 0; contourPlate.GetUserProperty("moment2", ref dblmoment2); dblmoment2 = dblmoment2 * 0.001; momentEnd = dblmoment2.ToString(); //contourPlate.GetUserProperty("CONN_CODE_END1", ref connCodeStart); //contourPlate.GetUserProperty("CONN_CODE_END2", ref connCodeEnd); model.GetWorkPlaneHandler().SetCurrentTransformationPlane(currentTP); } } } if (modelObjectEnum.GetSize() > 1) { partType = ""; partID = ""; owner = ""; gridLocation = ""; partPrefix = ""; partStartNo = ""; assemblyPrefix = ""; assemblyStartNo = ""; phase = ""; name = ""; profile = ""; material = ""; finish = ""; classValue = ""; //userfield1 = ""; //userfield2 = ""; //userfield3 = ""; //userfield4 = ""; //notesComments = ""; //fittingNotes = ""; //fittingNotes2 = ""; //cambering = ""; //paint = ""; //preliminaryMark = ""; //paintWFT = ""; //paintDFT = ""; //shearStart = ""; //shearEnd = ""; //axialStart = ""; //axialEnd = ""; //momentStart = ""; //momentEnd = ""; //connCodeStart = ""; //connCodeEnd = ""; positionOnPlane = new PositionPlaneEnum(); positionOnPlaneOffset = ""; positionRotation = new PositionRotationEnum(); positionRotationOffset = ""; positionAtDepth = new PositionDepthEnum(); positionAtDepthOffset = ""; } }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.ContourPlate) { Tekla.Structures.Model.ContourPlate contourPlate = (Tekla.Structures.Model.ContourPlate)modelObjectEnum.Current; if (label == "Name") { contourPlate.Name = name; } if (label == "Profile") { contourPlate.Profile.ProfileString = profile; } if (label == "Material") { contourPlate.Material.MaterialString = material; } if (label == "Finish") { contourPlate.Finish = finish; } if (label == "Class") { contourPlate.Class = classValue; } if (label == "PartPrefix") { contourPlate.PartNumber.Prefix = partPrefix; } if (label == "PartStartNo") { contourPlate.PartNumber.StartNumber = int.Parse(partStartNo); } if (label == "AssemblyPrefix") { contourPlate.AssemblyNumber.Prefix = assemblyPrefix; } if (label == "AssemblyStartNo") { contourPlate.AssemblyNumber.StartNumber = int.Parse(assemblyStartNo); } if (label == "Phase") { contourPlate.SetPhase(new Phase(int.Parse(phase))); } if (label == "PositionOnPlane") { if (positionOnPlane == PositionPlaneEnum.Left) { contourPlate.Position.Plane = Position.PlaneEnum.LEFT; } if (positionOnPlane == PositionPlaneEnum.Middle) { contourPlate.Position.Plane = Position.PlaneEnum.MIDDLE; } if (positionOnPlane == PositionPlaneEnum.Right) { contourPlate.Position.Plane = Position.PlaneEnum.RIGHT; } } if (label == "PositionOnPlaneOffset") { contourPlate.Position.PlaneOffset = double.Parse(positionOnPlaneOffset); } if (label == "PositionRotation") { if (positionRotation == PositionRotationEnum.Top) { contourPlate.Position.Rotation = Position.RotationEnum.TOP; } if (positionRotation == PositionRotationEnum.Front) { contourPlate.Position.Rotation = Position.RotationEnum.FRONT; } if (positionRotation == PositionRotationEnum.Back) { contourPlate.Position.Rotation = Position.RotationEnum.BACK; } if (positionRotation == PositionRotationEnum.Below) { contourPlate.Position.Rotation = Position.RotationEnum.BELOW; } } if (label == "PositionRotationOffset") { contourPlate.Position.RotationOffset = double.Parse(positionRotationOffset); } if (label == "PositionAtDepth") { if (positionAtDepth == PositionDepthEnum.Behind) { contourPlate.Position.Depth = Position.DepthEnum.BEHIND; } if (positionAtDepth == PositionDepthEnum.Front) { contourPlate.Position.Depth = Position.DepthEnum.FRONT; } if (positionAtDepth == PositionDepthEnum.Middle) { contourPlate.Position.Depth = Position.DepthEnum.MIDDLE; } } if (label == "AtDepthOffset") { contourPlate.Position.DepthOffset = double.Parse(positionAtDepthOffset); } //if (label == "Userfield1") contourPlate.SetUserProperty("USER_FIELD_1", userfield1); //if (label == "Userfield2") contourPlate.SetUserProperty("USER_FIELD_2", userfield2); //if (label == "Userfield3") contourPlate.SetUserProperty("USER_FIELD_3", userfield3); //if (label == "Userfield4") contourPlate.SetUserProperty("USER_FIELD_4", userfield4); //if (label == "NotesComments") contourPlate.SetUserProperty("comment", notesComments); //if (label == "FittingNotes") contourPlate.SetUserProperty("FIT_NOTES", fittingNotes); //if (label == "FittingNotes2") contourPlate.SetUserProperty("FIT_NOTES2", fittingNotes2); //if (label == "Cambering") contourPlate.SetUserProperty("cambering", cambering); //if (label == "Paint") contourPlate.SetUserProperty("PAINT", paint); //if (label == "PreliminaryMark") contourPlate.SetUserProperty("PRELIM_MARK", preliminaryMark); //if (label == "PaintWFT") contourPlate.SetUserProperty("PAINT_WFT", paintWFT); //if (label == "PaintDFT") contourPlate.SetUserProperty("PAINT_DFT", paintDFT); //if (label == "ShearStart") contourPlate.SetUserProperty("shear1", double.Parse(shearStart) * 1000); //if (label == "ShearEnd") contourPlate.SetUserProperty("shear2", double.Parse(shearEnd) * 1000); //if (label == "AxialStart") contourPlate.SetUserProperty("axial1", double.Parse(axialStart) * 1000); //if (label == "AxialEnd") contourPlate.SetUserProperty("axial2", double.Parse(axialEnd) * 1000); //if (label == "MomentStart") contourPlate.SetUserProperty("moment1", double.Parse(momentStart) * 1000); //if (label == "MomentEnd") contourPlate.SetUserProperty("moment2", double.Parse(momentEnd) * 1000); //if (label == "ConnCodeStart") contourPlate.SetUserProperty("CONN_CODE_END1", connCodeStart); //if (label == "ConnCodeEnd") contourPlate.SetUserProperty("CONN_CODE_END2", connCodeEnd); contourPlate.Modify(); model.CommitChanges(); } } }
private void button1_Click(object sender, EventArgs e) { Model _model = new Model(); ArrayList Poinlist = new ArrayList(); int condition = 0; ModelInfo _minfo = _model.GetInfo(); string repPath = _minfo.ModelPath + "\\Reports\\BoltPartCheck.xsr"; //StreamWriter sw = new StreamWriter(repPath); //sw.WriteLine("Bolt Part Error's Report.."); //sw.WriteLine("Part ID, Bolt ID"); Tekla.Structures.Model.UI.ModelObjectSelector mos = new Tekla.Structures.Model.UI.ModelObjectSelector(); TransformationPlane currplane = _model.GetWorkPlaneHandler().GetCurrentTransformationPlane(); ModelObjectEnumerator moe = mos.GetSelectedObjects(); Tekla.Structures.Model.ModelObjectSelector mosb = _model.GetModelObjectSelector(); while (moe.MoveNext()) { Beam angle = moe.Current as Beam; if (angle.StartPoint.Z > angle.EndPoint.Z) { condition = 1; } ModelObjectEnumerator anglebolts = angle.GetBolts(); _model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane(angle.GetCoordinateSystem())); angle.Select(); while (anglebolts.MoveNext()) { BoltArray Bolt = anglebolts.Current as BoltArray; foreach (T3D.Point p in Bolt.BoltPositions) { Poinlist.Add(p); } } T3D.Point Point1 = new T3D.Point(); T3D.Point Point2 = new T3D.Point(); T3D.Point pa = Poinlist[0] as T3D.Point; Point1.Z = 0; Point2.Z = 0; if (pa.X < 150) { Point1 = pa; Point2 = Poinlist[1] as T3D.Point; } else { Point1 = Poinlist[1] as T3D.Point; Point2 = pa; } angle.StartPoint = Point1; angle.StartPoint.X = angle.StartPoint.X - 50; angle.EndPoint = Point2; angle.EndPoint.X = angle.EndPoint.X + 50; angle.Modify(); /* switch (condition) * { * case 1: * * angle.StartPoint = new T3D.Point(Poinlist[1] as T3D.Point); * angle.StartPoint.X = angle.StartPoint.X - 50; * angle.EndPoint = new T3D.Point(Poinlist[0] as T3D.Point); * angle.EndPoint.X = angle.EndPoint.X + 50; * * angle.Modify(); * * break; * * case 0: * angle.StartPoint =new T3D.Point(Poinlist[0] as T3D.Point); * angle.StartPoint.X = angle.StartPoint.X - 50; * angle.EndPoint = new T3D.Point(Poinlist[1] as T3D.Point); * angle.EndPoint.X = angle.EndPoint.X + 50; * * angle.Modify(); * break;*/ Poinlist.Clear(); } _model.GetWorkPlaneHandler().SetCurrentTransformationPlane(currplane); _model.CommitChanges(); }
ArrayList GetModelObjectsByType(string ObjectType) { ArrayList ObjectsToBeSelected = new ArrayList(); Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); foreach (Tekla.Structures.Model.ModelObject modelObject in modelObjectSelector.GetSelectedObjects()) { if (modelObject.GetType().ToString() == ObjectType) ObjectsToBeSelected.Add(modelObject); } return ObjectsToBeSelected; }
public string GetAssemblyNumbers() { Model model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector selector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator enumerator = selector.GetSelectedObjects(); SortedSet <string> list = new SortedSet <string>(); string current = string.Empty; string assemblyNumber = string.Empty; string assemblyPhase = string.Empty; string assemblySerialNumber = string.Empty; string assemblyPrefix = string.Empty; Phase phase = new Phase(); while (enumerator.MoveNext()) { Beam beam = enumerator.Current as Beam; if (beam != null) { Tekla.Structures.Model.Assembly assembly = beam.GetAssembly() as Tekla.Structures.Model.Assembly; assembly.GetReportProperty("ASSEMBLY_POS", ref assemblyNumber); assembly.GetPhase(out phase); assemblyPhase = phase.PhaseNumber.ToString(); assembly.GetReportProperty("ASSEMBLY_PREFIX", ref assemblyPrefix); var arr = assemblyNumber.Split('/'); assemblySerialNumber = arr[1]; current = assemblySerialNumber; list.Add(current); } ContourPlate contourPlate = enumerator.Current as ContourPlate; if (contourPlate != null) { Tekla.Structures.Model.Assembly assemblyCPL = contourPlate.GetAssembly() as Tekla.Structures.Model.Assembly; assemblyCPL.GetReportProperty("ASSEMBLY_POS", ref assemblyNumber); assemblyCPL.GetPhase(out phase); assemblyPhase = phase.PhaseNumber.ToString(); assemblyCPL.GetReportProperty("ASSEMBLY_PREFIX", ref assemblyPrefix); var arr = assemblyNumber.Split('/'); assemblySerialNumber = arr[1]; current = assemblySerialNumber; list.Add(current); } } string shorten = this.ReturnShortenName(list); string result = "El. " + shorten + "(" + assemblyPhase + "_" + assemblyPrefix + ")"; return(result); }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is BaseWeld) { BaseWeld weld = (BaseWeld)modelObjectEnum.Current; if (label == "SizeAbove") { weld.SizeAbove = double.Parse(sizeAbove); } if (label == "WeldTypeAbove") { if (weldTypeAbove == WeldType.WELD_TYPE_NONE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; } else if (weldTypeAbove == WeldType.WELD_TYPE_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeAbove == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_V_GROOVE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; } else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE_FLANGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_CORNER_FLANGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_PLUG) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_BACKING) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; } else if (weldTypeAbove == WeldType.WELD_TYPE_SPOT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SEAM) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; } else if (weldTypeAbove == WeldType.WELD_TYPE_SLOT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; } else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_MELT_THROUGH) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; } else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_ISO_SURFACING) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; } else if (weldTypeAbove == WeldType.WELD_TYPE_FOLD) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; } else if (weldTypeAbove == WeldType.WELD_TYPE_INCLINED) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } } if (label == "ContourTypeAbove") { if (contourTypeAbove == ContourType.None) { weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; } else if (contourTypeAbove == ContourType.Flush) { weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } } if (label == "SizeBelow") { weld.SizeBelow = double.Parse(sizeBelow); } if (label == "WeldTypeBelow") { if (weldTypeBelow == WeldType.WELD_TYPE_NONE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; } else if (weldTypeBelow == WeldType.WELD_TYPE_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeBelow == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_V_GROOVE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; } else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE_FLANGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_CORNER_FLANGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_PLUG) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_BACKING) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; } else if (weldTypeBelow == WeldType.WELD_TYPE_SPOT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SEAM) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; } else if (weldTypeBelow == WeldType.WELD_TYPE_SLOT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; } else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_MELT_THROUGH) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; } else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_ISO_SURFACING) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; } else if (weldTypeBelow == WeldType.WELD_TYPE_FOLD) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; } else if (weldTypeBelow == WeldType.WELD_TYPE_INCLINED) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } } if (label == "ContourTypeBelow") { if (contourTypeBelow == ContourType.None) { weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; } else if (contourTypeBelow == ContourType.Flush) { weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } } if (label == "RefText") { weld.ReferenceText = refText; } if (label == "Around") { if (around == Bool.True) { weld.AroundWeld = true; } else { weld.AroundWeld = false; } } weld.Modify(); } } }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Grid) { Grid Grid = (Grid)modelObjectEnum.Current; if (label == "CoordinateX") Grid.CoordinateX = coordinateX; if (label == "CoordinateY") Grid.CoordinateY = coordinateY; if (label == "CoordinateZ") Grid.CoordinateZ = coordinateZ; if (label == "LabelX") Grid.LabelX = labelX; if (label == "LabelY") Grid.LabelY = labelY; if (label == "LabelZ") Grid.LabelZ = labelZ; Grid.Modify(); } } }
public void GetProperties() { Model model = new Model(); Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); if (modelObjectEnum.GetSize() == 1) { while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is Tekla.Structures.Model.BaseWeld) { BaseWeld weld = (BaseWeld)modelObjectEnum.Current; refText = weld.ReferenceText; if (weld.AroundWeld) around = Bool.True; else around = Bool.False; sizeAbove = weld.SizeAbove.ToString(); if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_NONE) weldTypeAbove = WeldType.WELD_TYPE_NONE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET) weldTypeAbove = WeldType.WELD_TYPE_FILLET; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) weldTypeAbove = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weldTypeAbove = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) weldTypeAbove = WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) weldTypeAbove = WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) weldTypeAbove = WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) weldTypeAbove = WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT) weldTypeAbove = WeldType.WELD_TYPE_J_GROOVE_J_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE) weldTypeAbove = WeldType.WELD_TYPE_FLARE_V_GROOVE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE) weldTypeAbove = WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE) weldTypeAbove = WeldType.WELD_TYPE_EDGE_FLANGE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE) weldTypeAbove = WeldType.WELD_TYPE_CORNER_FLANGE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG) weldTypeAbove = WeldType.WELD_TYPE_PLUG; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING) weldTypeAbove = WeldType.WELD_TYPE_BEVEL_BACKING; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT) weldTypeAbove = WeldType.WELD_TYPE_SPOT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM) weldTypeAbove = WeldType.WELD_TYPE_SEAM; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT) weldTypeAbove = WeldType.WELD_TYPE_SLOT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) weldTypeAbove = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) weldTypeAbove = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH) weldTypeAbove = WeldType.WELD_TYPE_MELT_THROUGH; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) weldTypeAbove = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weldTypeAbove = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE) weldTypeAbove = WeldType.WELD_TYPE_EDGE; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING) weldTypeAbove = WeldType.WELD_TYPE_ISO_SURFACING; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD) weldTypeAbove = WeldType.WELD_TYPE_FOLD; else if (weld.TypeAbove == BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED) weldTypeAbove = WeldType.WELD_TYPE_INCLINED; else Console.WriteLine(weld.TypeAbove); if (weld.ContourAbove == BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE) contourTypeAbove = ContourType.None; else if (weld.ContourAbove == BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH) contourTypeAbove = ContourType.Flush; sizeBelow = weld.SizeBelow.ToString(); if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_NONE) weldTypeBelow = WeldType.WELD_TYPE_NONE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET) weldTypeBelow = WeldType.WELD_TYPE_FILLET; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) weldTypeBelow = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weldTypeBelow = WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) weldTypeBelow = WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) weldTypeBelow = WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) weldTypeBelow = WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) weldTypeBelow = WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT) weldTypeBelow = WeldType.WELD_TYPE_J_GROOVE_J_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE) weldTypeBelow = WeldType.WELD_TYPE_FLARE_V_GROOVE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE) weldTypeBelow = WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE) weldTypeBelow = WeldType.WELD_TYPE_EDGE_FLANGE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE) weldTypeBelow = WeldType.WELD_TYPE_CORNER_FLANGE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG) weldTypeBelow = WeldType.WELD_TYPE_PLUG; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING) weldTypeBelow = WeldType.WELD_TYPE_BEVEL_BACKING; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT) weldTypeBelow = WeldType.WELD_TYPE_SPOT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM) weldTypeBelow = WeldType.WELD_TYPE_SEAM; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT) weldTypeBelow = WeldType.WELD_TYPE_SLOT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) weldTypeBelow = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) weldTypeBelow = WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH) weldTypeBelow = WeldType.WELD_TYPE_MELT_THROUGH; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) weldTypeBelow = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) weldTypeBelow = WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE) weldTypeBelow = WeldType.WELD_TYPE_EDGE; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING) weldTypeBelow = WeldType.WELD_TYPE_ISO_SURFACING; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD) weldTypeBelow = WeldType.WELD_TYPE_FOLD; else if (weld.TypeBelow == BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED) weldTypeBelow = WeldType.WELD_TYPE_INCLINED; else Console.WriteLine(weld.TypeBelow); if (weld.ContourBelow == BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE) contourTypeBelow = ContourType.None; else if (weld.ContourBelow == BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH) contourTypeBelow = ContourType.Flush; } } } else { sizeAbove = ""; weldTypeAbove = new WeldType(); contourTypeAbove = new ContourType(); sizeBelow = ""; weldTypeBelow = new WeldType(); contourTypeBelow = new ContourType(); refText = ""; around = new Bool(); } }