public static bool SetBeamSections(Frame frame) { robotApp.Interactive = 0; IRobotLabel builtUpSectionLabel = labelServer.Create(IRobotLabelType.I_LT_BAR_SECTION, "Hndz - Tapered"); RobotBarSectionData builtUpsectionData = builtUpSectionLabel.Data; builtUpsectionData.Type = IRobotBarSectionType.I_BST_NS_II; builtUpsectionData.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_I_MONOSYM; RobotBarSectionNonstdData builtUpsectionDataNonS = builtUpsectionData.CreateNonstd(1); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_B1, frame.Beams[0].BeamSectionAtStartNode.B1); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_B2, frame.Beams[0].BeamSectionAtStartNode.B2); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_H, frame.Beams[0].BeamSectionAtStartNode.Height); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TF1, frame.Beams[0].BeamSectionAtStartNode.TF1); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TF2, frame.Beams[0].BeamSectionAtStartNode.TF2); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TW, frame.Beams[0].BeamSectionAtStartNode.Tw); builtUpsectionDataNonS = builtUpsectionData.CreateNonstd(0); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_B1, frame.Beams[0].BeamSectionATEndNode.B1); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_B2, frame.Beams[0].BeamSectionATEndNode.B2); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_H, frame.Beams[0].BeamSectionATEndNode.Height); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TF1, frame.Beams[0].BeamSectionATEndNode.TF1); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TF2, frame.Beams[0].BeamSectionATEndNode.TF2); builtUpsectionDataNonS.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_II_TW, frame.Beams[0].BeamSectionATEndNode.Tw); builtUpsectionData.CalcNonstdGeometry(); labelServer.Store(builtUpSectionLabel); RobotSelection Selection = robotApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); Selection.AddOne(frame.Beams[0].Id); Selection.AddOne(frame.Beams[1].Id); barServer.SetLabel(Selection, IRobotLabelType.I_LT_BAR_SECTION, builtUpSectionLabel.Name); //barServer.SetLabel(RightColumn, IRobotLabelType.I_LT_BAR_SECTION, builtUpSectionLabel.Name); robotApp.Interactive = 1; return(true); }
}//createFrame private void addRobotBars(int startIndex, string column, string railBeam, string wheelBeam, string simpleBar) { IRobotBarServer iBars = iRobotApp.Project.Structure.Bars; //Bar selection RobotSelection barSelection = iRobotApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); for (int i = startIndex; i < bars.Count; i++) { //Create the bars in the Robot Software iBars.Create(bars[i].id, bars[i].startNode.id, bars[i].endNode.id); //Clear the previous selection barSelection.Clear(); //Add the current bar to the selection barSelection.AddOne(bars[i].id); //Assign the profile switch (bars[i].type) { case MemberType.Column: bars[i].sectionLabel = column; break; case MemberType.RailBeam: bars[i].sectionLabel = railBeam; break; case MemberType.WheelBeam: bars[i].sectionLabel = wheelBeam; break; case MemberType.Bar: bars[i].sectionLabel = simpleBar; break; default: break; } //Setting the label iBars.SetLabel(barSelection, IRobotLabelType.I_LT_BAR_SECTION, bars[i].sectionLabel); } }//addRobotBars
public static void Design(Frame frame) { IRDimServer RDmServer; RDimStream RDmStream; IRDimGroups RDmGrps; RDimGroup RDmGrp1; RDimGrpProfs RDmGrpProfs; int BeamNo; int ColumnNo; RDmServer = robotApp.Project.DimServer; RDmServer.Mode = IRDimServerMode.I_DSM_STEEL; RDmGrps = RDmServer.GroupsService; BeamNo = 1; RDmGrp1 = RDmGrps.New(0, BeamNo); RDmGrp1.Name = "HNDZ-Beams"; RDmStream = RDmServer.Connection.GetStream(); RDmStream.Clear(); RDmStream.WriteText("3 4"); RDmGrp1.SetMembList(RDmStream); RDmGrpProfs = RDmServer.Connection.GetGrpProfs(); RDmGrpProfs.Clear(); RDmStream.Clear(); RDmGrp1.SetProfs(RDmGrpProfs); RDmGrps.Save(RDmGrp1); //Group 2 ColumnNo = 2; RDmGrp1 = RDmGrps.New(0, ColumnNo); RDmGrp1.Name = "HNDZ-Columns"; RDmStream = RDmServer.Connection.GetStream(); RDmStream.Clear(); RDmStream.WriteText("1 2"); RDmGrp1.SetMembList(RDmStream); RDmGrpProfs = RDmServer.Connection.GetGrpProfs(); RDmGrpProfs.Clear(); RDmStream.Clear(); RDmGrp1.SetProfs(RDmGrpProfs); RDmGrps.Save(RDmGrp1); // add Section Data to members IRobotLabel BeamTypeLabel; IRDimMembDefData BeamMembDefData; BeamTypeLabel = labelServer.Create(IRobotLabelType.I_LT_MEMBER_TYPE, "Hndz-Beam"); BeamMembDefData = BeamTypeLabel.Data; //============================================ // K factors needs to be reviewed BeamMembDefData.SetDeflectionYZ(IRDimMembDefDeflDataType.I_DMDDDT_DEFL_Y, 1); BeamMembDefData.SetDeflectionYZ(IRDimMembDefDeflDataType.I_DMDDDT_DEFL_Z, 1); BeamMembDefData.Type = IRDimMembDefType.I_DMDT_USER; labelServer.Store(BeamTypeLabel); RobotSelection Selection = robotApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); Selection.AddOne(frame.Beams[0].Id); Selection.AddOne(frame.Beams[1].Id); barServer.SetLabel(Selection, IRobotLabelType.I_LT_MEMBER_TYPE, BeamTypeLabel.Name); //========================= IRobotLabel ColumnTypeLabel; IRDimMembDefData ColumnMembDefData; ColumnTypeLabel = labelServer.Create(IRobotLabelType.I_LT_MEMBER_TYPE, "Hndz-Column"); ColumnMembDefData = ColumnTypeLabel.Data; ColumnMembDefData.Type = IRDimMembDefType.I_DMDT_USER; labelServer.Store(ColumnTypeLabel); //======================== RobotSelection Selection2 = robotApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); Selection.AddOne(frame.Columns[0].Id); Selection.AddOne(frame.Columns[1].Id); barServer.SetLabel(Selection, IRobotLabelType.I_LT_MEMBER_TYPE, ColumnTypeLabel.Name); //================= //Calutlation enginer IRDimCalcEngine RdmEngine = robotApp.Project.DimServer.CalculEngine; IRDimCalcParam RdmCalPar = RdmEngine.GetCalcParam(); IRDimCalcConf RdmCalCnf = RdmEngine.GetCalcConf(); RDimStream RdmStream = robotApp.Project.DimServer.Connection.GetStream(); RdmStream.Clear(); RdmStream.WriteText("all"); RdmCalPar.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_GROUPS_DESIGN, RdmStream); RdmCalPar.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_SERVICEABILITY, 1); RdmCalPar.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_ULTIMATE, 1); RdmStream.Clear(); RdmStream.WriteText("1 2"); RdmCalPar.SetLoadsList(RdmStream); RdmEngine.SetCalcConf(RdmCalCnf); RdmEngine.SetCalcParam(RdmCalPar); }
public void createFrame(double g, double d, double b, double c, double e, string railBeam, string column, string wheelBeam) { //Disable Robot software iteraction with the user iRobotApp.Interactive = 0; //Create a new 3D Frame //iRobotApp.Project.New(IRobotProjectType.I_PT_FRAME_3D); //Creating nodes nodes = new List <Node>(); nodes.Add(new Node(1, 0, 0, 0)); nodes.Add(new Node(2, 0, g, 0)); nodes.Add(new Node(3, 0, g / 2, (d + b) / 2)); nodes.Add(new Node(4, (c - e) / 2, g / 2, (d + b) / 2)); nodes.Add(new Node(5, (c - e) / 2 + e, g / 2, (d + b) / 2)); nodes.Add(new Node(6, c, g / 2, (d + b) / 2)); nodes.Add(new Node(7, c, 0, 0)); nodes.Add(new Node(8, c, g, 0)); IRobotNodeServer iNodes = iRobotApp.Project.Structure.Nodes; RobotSelection supportSelection = iRobotApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_NODE); supportSelection.Clear(); string supportLabels = getConstraintLabel(); foreach (Node n in nodes) { iNodes.Create(n.id, n.xCoord, n.yCoord, n.zCoord); //Setting constraint labels switch (n.id) { case 1: case 2: case 7: case 8: supportSelection.AddOne(n.id); break; } iNodes.SetLabel(supportSelection, IRobotLabelType.I_LT_SUPPORT, supportLabels); } //Creating bars bars = new List <Bar>(); bars.Add(new Bar(1, nodes[0], nodes[1], MemberType.WheelBeam)); bars.Add(new Bar(2, nodes[0], nodes[2], MemberType.Column)); bars.Add(new Bar(3, nodes[1], nodes[2], MemberType.Column)); bars.Add(new Bar(4, nodes[0], nodes[3], MemberType.Column)); bars.Add(new Bar(5, nodes[1], nodes[3], MemberType.Column)); bars.Add(new Bar(6, nodes[2], nodes[5], MemberType.RailBeam)); bars.Add(new Bar(7, nodes[6], nodes[4], MemberType.Column)); bars.Add(new Bar(8, nodes[7], nodes[4], MemberType.Column)); bars.Add(new Bar(9, nodes[6], nodes[5], MemberType.Column)); bars.Add(new Bar(10, nodes[7], nodes[5], MemberType.Column)); bars.Add(new Bar(11, nodes[6], nodes[7], MemberType.WheelBeam)); addRobotBars(0, column, railBeam, wheelBeam, null); //Set the geometry created status to true geometryCreated = true; //Allow the user to work with Robot Sofware GUI iRobotApp.Interactive = 1; }//createFrame
/// <summary> /// 创建连续梁模型 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button3_Click(object sender, EventArgs e) { //截面宽度,高度 double sectionWidth = double.Parse(txtSectionWdith.Text); double sectionHeight = double.Parse(txtSectionHeight.Text); //材料 // string material=comboBoxMaterial.SelectedItem.ToString(); //几何跨数,单跨长度 int elementAmount = int.Parse(comboBoxElementCount.SelectedItem.ToString()); double elementLength = double.Parse(textBoxElementLength.Text); //----------------------------------------------------------------------- //关闭和ROBOT的交互功能 iapp.Interactive = 0; //创建一个Frame2d类型的项目 iapp.Project.New(IRobotProjectType.I_PT_FRAME_2D); //创建节点 IRobotNodeServer inds = iapp.Project.Structure.Nodes;//获取节点集合 int n1 = startNode; inds.Create(n1, 0, 0, 0); for (int i = 1; i < elementAmount + 1; i++)//创建节点,格式为节点号,x坐标,y坐标,z坐标 { inds.Create(i + 1, i * elementLength, 0, 0); } //创建杆单元 IRobotBarServer ibars = iapp.Project.Structure.Bars;//获取杆单元集合 int b1 = startBar; for (int i = 1; i < elementAmount + 1; i++) { ibars.Create(i, i, i + 1);//创建杆单元,格式为单元号,单元起始节点,单元结束节点 } //设置材料和截面 //给量赋值截面 RobotLabelServer labels; labels = iapp.Project.Structure.Labels; string ColumnSectionName = "Rect. Column 60*100"; IRobotLabel label = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, ColumnSectionName); RobotBarSectionData section; section = (RobotBarSectionData)label.Data; section.ShapeType = IRobotBarSectionShapeType.I_BSST_CONCR_COL_R; RobotBarSectionConcreteData concrete; concrete = (RobotBarSectionConcreteData)section.Concrete; concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_B, 0.6); concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H, 1.0); section.CalcNonstdGeometry(); labels.Store(label); RobotSelection selectionBars; selectionBars = iapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_BAR); //selectionBars.FromText("1 2 3 4 5"); selectionBars.AddOne(1); selectionBars.AddOne(2); selectionBars.AddOne(3); selectionBars.AddOne(4); selectionBars.AddOne(5); //给量赋值截面 string MaterialName = "Concrete 30"; label = labels.Create(IRobotLabelType.I_LT_MATERIAL, MaterialName); RobotMaterialData Material; Material = (RobotMaterialData)label.Data; Material.Type = IRobotMaterialType.I_MT_CONCRETE; Material.E = 30000000000; // Young Material.NU = 1 / 6; // Poisson Material.RO = 25000; // Unit weight Material.Kirchoff = Material.E / (2 * (1 + Material.NU)); iapp.Project.Structure.Labels.Store(label); RobotSelection isel = iapp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); isel.AddOne(1); isel.AddOne(2); isel.AddOne(3); isel.AddOne(4); isel.AddOne(5); ibars.SetLabel(isel, IRobotLabelType.I_LT_BAR_SECTION, ColumnSectionName); //ibars.SetLabel(isel, IRobotLabelType.I_LT_MATERIAL, MaterialName); //------------------------------------------------ //支撑 //给节点设置支持形式 IRobotNode ind = (IRobotNode)inds.Get(1); ind.SetLabel(IRobotLabelType.I_LT_SUPPORT, "固定"); //ind.SetLabel(IRobotLabelType.I_LT_SUPPORT, comboSupportLeft.Text); geometryCreated = true; //结构几何创建结束 loadsGenerated = false; //结构荷载没有创建 // switch Interactive flag on to allow user to work with Robot GUI //打开robot截面操作 iapp.Interactive = 1; // get the focus back this.Activate(); }
// create the structure geometry //建立结构的集合模型 private void createGeometry(object sender, EventArgs e) { // switch Interactive flag off to avoid any questions that need user interaction in Robot //关闭和ROBOT的交互功能 iapp.Interactive = 0; // create a new project of type Frame 2D //创建一个Frame2d类型的项目 iapp.Project.New(IRobotProjectType.I_PT_FRAME_2D); // create nodes //创建节点 double x = 0, y = 0; double h = System.Convert.ToDouble(editH.Text); //获取高度 double l = System.Convert.ToDouble(editL.Text); //获取长度 double alpha = System.Convert.ToDouble(editA.Text); //获取角度 IRobotNodeServer inds = iapp.Project.Structure.Nodes; //获取节点集合 int n1 = startNode; inds.Create(n1, x, 0, y);//创建节点,格式为节点号,x坐标,y坐标,z坐标 inds.Create(n1 + 1, x, 0, y + h); inds.Create(n1 + 2, x + (l / 2), 0, y + h + Math.Tan(alpha * (Math.PI / 180)) * l / 2); inds.Create(n1 + 3, x + l, 0, y + h); inds.Create(n1 + 4, x + l, 0, 0); // create bars //创建杆单元 IRobotBarServer ibars = iapp.Project.Structure.Bars;//获取杆单元集合 int b1 = startBar; ibars.Create(b1, n1, n1 + 1);//创建杆单元,格式为单元号,单元起始节点,单元结束节点 ibars.Create(b1 + 1, n1 + 1, n1 + 2); beam1 = b1 + 1; ibars.Create(b1 + 2, n1 + 2, n1 + 3); beam2 = b1 + 2; ibars.Create(b1 + 3, n1 + 3, n1 + 4); // set selected bar section label to columns //给柱子设置截面 RobotSelection isel = iapp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); isel.AddOne(b1); isel.AddOne(b1 + 3); ibars.SetLabel(isel, IRobotLabelType.I_LT_BAR_SECTION, comboColumns.Text); // set selected bar section label to beams //给梁设置截面 isel.Clear(); isel.AddOne(b1 + 1); isel.AddOne(b1 + 2); ibars.SetLabel(isel, IRobotLabelType.I_LT_BAR_SECTION, comboBeams.Text); // set selected support label to nodes //给节点设置支持形式 IRobotNode ind = (IRobotNode)inds.Get(n1); ind.SetLabel(IRobotLabelType.I_LT_SUPPORT, comboSupportLeft.Text); ind = (IRobotNode)inds.Get(n1 + 4); ind.SetLabel(IRobotLabelType.I_LT_SUPPORT, comboSupportRight.Text); geometryCreated = true; //结构几何创建结束 loadsGenerated = false; //结构荷载没有创建 // switch Interactive flag on to allow user to work with Robot GUI //打开robot截面操作 iapp.Interactive = 1; // get the focus back this.Activate(); }