public void assignToModel(IRobotMaterialType materialType) { IRobotLabel label = RobotLabels.createLabel(IRobotLabelType.I_LT_MATERIAL, name); RobotMaterialData material = (RobotMaterialData)label.Data; material.Type = materialType; material.E = elasticity; material.NU = poisson; material.RO = specificWeight; material.Kirchoff = kirchoff; }
}//setCurrentDataBase //Store the selected section to the Robot Application public void storeSectionLabelFromDB(string database, IRobotLabelType labelType, string section) { //Access LabelServer IRobotLabelServer labelServer = getLabelServer(); //Get Section DataBase setCurrentDatabase(IRobotDatabaseType.I_DT_SECTIONS, database); //Create a Label IRobotLabel label = labelServer.Create(labelType, section); IRobotBarSectionData sectionData = (RobotBarSectionData)label.Data; sectionData.LoadFromDBase(section); labelServer.Store(label); }
public static bool SetMaterial(Material Mymaterial) { IRobotLabel material = labelServer.Create(IRobotLabelType.I_LT_MATERIAL, Mymaterial.MaterialName); RobotMaterialData materialData = material.Data; materialData.Type = IRobotMaterialType.I_MT_STEEL; materialData.E = Mymaterial.YoungsModulas; materialData.NU = Mymaterial.PoissionRatio; materialData.Kirchoff = Mymaterial.ShearModulas; materialData.RO = Mymaterial.UnitWeight; materialData.LX = Mymaterial.ThermalExpansion; materialData.DumpCoef = Mymaterial.DampingRatio; materialData.SaveToDBase(); robotApp.Project.Structure.Labels.Store(material); return(true); }
}//addRobotBars //Generate the label for constraints in the entire struture private string getConstraintLabel() { IRobotLabel supportLabel = iRobotApp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_SUPPORT, "Apoios"); IRobotNodeSupportData supports = (RobotNodeSupportData)supportLabel.Data; supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RX, 0); supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RY, 0); supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RZ, 0); supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UX, 1); supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UY, 1); supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UZ, 1); iRobotApp.Project.Structure.Labels.Store(supportLabel); return(supportLabel.Name); }//getConstraintLabel
//create a material instance and add to public void create(string name, double elasticity, double poisson, double weigth, IRobotMaterialType robotMaterialType) { material = new Material(name, elasticity, poisson, weigth, robotMaterialType); materials.Add(material); //Adding the material to the current project //Acessing RobotLabelServer IRobotLabel materialLabel = structure.getLabelServer().Create(IRobotLabelType.I_LT_MATERIAL, name); //Accessing data properties RobotMaterialData materialData = (RobotMaterialData)materialLabel.Data; materialData.Type = robotMaterialType; materialData.E = elasticity; materialData.NU = poisson; materialData.RO = weigth; materialData.Kirchoff = material.kirchoff; structure.getLabelServer().Store(materialLabel); }//create
public static void Set_sections(string name, double area, double iz, double iy) { List <String> _section_names = new List <String>(); List <double> _Area = new List <double>(); List <double> _Ix = new List <double>(); List <double> _Iy = new List <double>(); IRobotLabel a = robApp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, name); IRobotBarSectionData data = a.Data; data.Type = IRobotBarSectionType.I_BST_STANDARD; data.ShapeType = IRobotBarSectionShapeType.I_BSST_CAE; data.SetValue(IRobotBarSectionDataValue.I_BSDV_AX, area); data.SetValue(IRobotBarSectionDataValue.I_BSDV_IZ, iz); data.SetValue(IRobotBarSectionDataValue.I_BSDV_IY, iy); robApp.Project.Structure.Labels.Store(a); /* * * for (int i = 1; i <= robApp.Project.Structure.Labels.GetAvailableNames(IRobotLabelType.I_LT_BAR_SECTION).Count; i++) * { * _section_names.Add(robApp.Project.Structure.Labels.GetAvailableNames(IRobotLabelType.I_LT_BAR_SECTION).Get(i).ToString()); * // API needs to copy labels from robot at runtime for the properties to be accessible without being assigned to any bar * RobotLabel label = robApp.Project.Structure.Labels.Get(RobotOM.IRobotLabelType.I_LT_BAR_SECTION, _section_names[i-1]) as RobotOM.RobotLabel; * bool available = robApp.Project.Structure.Labels.IsAvailable(RobotOM.IRobotLabelType.I_LT_BAR_SECTION, _section_names[i-1]); * * if (label == null && available) * { * label = robApp.Project.Structure.Labels.CreateLike(RobotOM.IRobotLabelType.I_LT_BAR_SECTION, _section_names[i - 1], _section_names[i - 1]) as RobotOM.RobotLabel; * } * * IRobotBarSectionData dt = (IRobotBarSectionData)robApp.Project.Structure.Labels.Get(IRobotLabelType.I_LT_BAR_SECTION,_section_names[i-1]).Data; * Console.Write(dt.GetValue(IRobotBarSectionDataValue.I_BSDV_AX)); * * _Area.Add(dt.GetValue(IRobotBarSectionDataValue.I_BSDV_AX)); * _Ix.Add(dt.GetValue(IRobotBarSectionDataValue.I_BSDV_IX)); * _Iy.Add(dt.GetValue(IRobotBarSectionDataValue.I_BSDV_IY)); * }*/ }
public void test() { RobotApplication appRSA = new RobotApplication(); getMaterialNameListRSA(appRSA); getBarSectionNamesRSA(appRSA); RobotStructure structureRSA = appRSA.Project.Structure; RobotBarServer barsRSA = structureRSA.Bars; RobotNodeServer nodesRSA = structureRSA.Nodes; RobotObjObjectServer objRSA = structureRSA.Objects; RobotLabelServer labelsRSA = appRSA.Project.Structure.Labels; //Определение выборок выделенных в модели объектов RobotSelection barSel = structureRSA.Selections.Get(IRobotObjectType.I_OT_BAR); RobotSelection plateSel = structureRSA.Selections.Get(IRobotObjectType.I_OT_PANEL); RobotSelection holesSel = structureRSA.Selections.Get(IRobotObjectType.I_OT_GEOMETRY); RobotBarCollection barsMany = (RobotBarCollection)barsRSA.GetMany(barSel); RobotObjObjectCollection platesMany = (RobotObjObjectCollection)objRSA.GetMany(plateSel); IRobotBar barRSA = barsMany.Get(3); IRobotObjObject plate = platesMany.Get(1); IRobotLabel labelPlate = plate.GetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS); RobotGeoPoint3DCollection defPoints = (RobotGeoPoint3DCollection)plate.Main.DefPoints; RobotGeoPoint3D pt1 = defPoints.Get(1); RobotGeoPoint3D pt2 = defPoints.Get(2); RobotGeoPoint3D pt3 = defPoints.Get(defPoints.Count); //IRobotGeoContour geoContour=(IRobotGeoContour)plate.Main.Geometry; //IRobotGeoObject geoObj=plate.Main.Geometry; IRobotLabel labelBar = barRSA.GetLabel(IRobotLabelType.I_LT_BAR_SECTION); RobotBarSectionData data = labelBar.Data; RobotBarSectionConcreteData cData = data.Concrete; double b = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_B); double h = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H); double l1 = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_L1); double l2 = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_L2); double h1 = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H1); double h2 = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H2); double de = cData.GetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_DE); double alfa = barRSA.Gamma; }
private void CreateBarEndRelease(List <AnalyticalBar> barInfo) { if (barInfo.Any(x => x.EndRelease.Length != 12)) { throw new Exception("End Release value must be 12 values formatted as 'x'(free) and 'f'(fixed)"); } //create a bar end release IRobotLabel rel1 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_RELEASE, "CatiaBarRelease"); IRobotBarReleaseData relData1 = rel1.Data as IRobotBarReleaseData; IRobotBarEndReleaseData relStartData1 = relData1.StartNode; IRobotBarEndReleaseData relEndData1 = relData1.EndNode; IRobotBarEndReleaseValue[] relVals = new IRobotBarEndReleaseValue[12]; char[] letters = _barInfo[0].EndRelease.ToCharArray(); for (int i = 0; i < _barInfo[0].EndRelease.Length; i++) { if (letters[i].ToString() == "f") { relVals[i] = IRobotBarEndReleaseValue.I_BERV_FIXED; } else if (letters[i].ToString() == "x") { relVals[i] = IRobotBarEndReleaseValue.I_BERV_NONE; } } relStartData1.UX = relVals[0]; relStartData1.UY = relVals[1]; relStartData1.UZ = relVals[2]; relStartData1.RX = relVals[3]; relStartData1.RY = relVals[4]; relStartData1.RZ = relVals[5]; relEndData1.UX = relVals[6]; relEndData1.UY = relVals[7]; relEndData1.UZ = relVals[8]; relEndData1.RX = relVals[9]; relEndData1.RY = relVals[10]; relEndData1.RZ = relVals[11]; _structure.Labels.Store(rel1); }
private void CreateNodes() { IRobotLabel sup = _structure.Labels.Create(IRobotLabelType.I_LT_SUPPORT, "CatiaSupport"); IRobotNodeSupportData sup_data = sup.Data as IRobotNodeSupportData; sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UX, 1); sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UY, 1); sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UZ, 1); sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RX, 0); sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RY, 0); sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RZ, 0); _structure.Labels.Store(sup); int nodeId = 100; for (int i = 0; i < _nodeInfo.Count; i++) { Console.WriteLine("Now creating " + nodeId.ToString() + "..."); var n = (AnalyticalNode)_nodeInfo[i]; //create the robot node _nodes.Create(nodeId, n.X, n.Y, n.Z); if (n.IsFixed == true) { Console.WriteLine("Fixing node " + nodeId.ToString() + "..."); IRobotNode node = _nodes.Get(nodeId) as IRobotNode; node.SetLabel(IRobotLabelType.I_LT_NODE_SUPPORT, "CatiaSupport"); } //set the robot node information in the List //to be pushed back into the XML n.Id = nodeId; //the robot node Id //n.displaceX = 0.0; //n.displaceY = 0.0; //n.displaceZ = 0.0; nodeId++; } }
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); }
public static bool SetMaterial(Material Mymaterial) { robotApp.Interactive = 0; IRobotLabel material = labelServer.Create(IRobotLabelType.I_LT_MATERIAL, Mymaterial.MaterialName); RobotMaterialData materialData = material.Data; materialData.Type = IRobotMaterialType.I_MT_STEEL; materialData.E = Mymaterial.YoungsModulas; materialData.NU = Mymaterial.PoissionRatio; materialData.Kirchoff = Mymaterial.ShearModulas; materialData.RO = Mymaterial.UnitWeight; materialData.LX = Mymaterial.ThermalExpansion; materialData.DumpCoef = Mymaterial.DampingRatio; materialData.CS = Mymaterial.ShearReductionFactor; materialData.Default = 1; materialData.RT = Mymaterial.TensionLimitstress; materialData.RE = Mymaterial.CharchteristicResistance; materialData.SaveToDBase(); robotApp.Project.Structure.Labels.Store(material); robotApp.Interactive = 1; return(true); }
/// <summary> /// Get the Nucleus panel family, if any, mapped to the specified robot thickness label /// </summary> /// <param name="robotID"></param> /// <param name="model"></param> /// <returns></returns> public BuildUpFamily GetMappedPanelFamily(IRobotLabel label, Model.Model model) { return(GetMappedPanelFamily(label.Name, model)); }
/// <summary> /// Add a new Panel Family entry to this mapping table /// </summary> /// <param name="family"></param> /// <param name="label"></param> public void Add(BuildUpFamily family, IRobotLabel label) { Add(ThicknessCategory, family.GUID, label.Name); }
public static void AddBar(RobotStructure structureRSA, RobotNode node1, RobotNode node2, IRobotLabel labelSect) { int num1 = node1.Number; int num2 = node2.Number; RobotBarServer barsRSA = structureRSA.Bars; int freeNum = barsRSA.FreeNumber; barsRSA.Create(freeNum, num1, num2); RobotSelection selection = structureRSA.Selections.Create(IRobotObjectType.I_OT_BAR); selection.FromText(freeNum.ToString()); barsRSA.SetLabel(selection, IRobotLabelType.I_LT_BAR_SECTION, labelSect.Name); }
private void CreateBars(List <int> forDeadLoadsBars) { //create the tube section //type 1 IRobotLabel sec1 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_00"); IRobotBarSectionData data1 = sec1.Data as IRobotBarSectionData; data1.Type = IRobotBarSectionType.I_BST_NS_TUBE; data1.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_TUBE; IRobotBarSectionNonstdData nonst_data1 = data1.CreateNonstd(0); //type 2 IRobotLabel sec2 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_01"); IRobotBarSectionData data2 = sec2.Data as IRobotBarSectionData; data2.Type = IRobotBarSectionType.I_BST_NS_TUBE; data2.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_TUBE; IRobotBarSectionNonstdData nonst_data2 = data2.CreateNonstd(0); //type 3 IRobotLabel sec3 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_02"); IRobotBarSectionData data3 = sec3.Data as IRobotBarSectionData; data3.Type = IRobotBarSectionType.I_BST_NS_TUBE; data3.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_TUBE; IRobotBarSectionNonstdData nonst_data3 = data3.CreateNonstd(0); //create the plate section IRobotLabel sec4 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_00"); IRobotBarSectionData data4 = sec4.Data as IRobotBarSectionData; data4.Type = IRobotBarSectionType.I_BST_NS_RECT; data4.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_RECT; IRobotBarSectionNonstdData nonst_data4 = data4.CreateNonstd(0); IRobotLabel sec5 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_01"); IRobotBarSectionData data5 = sec5.Data as IRobotBarSectionData; data5.Type = IRobotBarSectionType.I_BST_NS_RECT; data5.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_RECT; IRobotBarSectionNonstdData nonst_data5 = data5.CreateNonstd(0); IRobotLabel sec6 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_02"); IRobotBarSectionData data6 = sec6.Data as IRobotBarSectionData; data6.Type = IRobotBarSectionType.I_BST_NS_RECT; data6.ShapeType = IRobotBarSectionShapeType.I_BSST_USER_RECT; IRobotBarSectionNonstdData nonst_data6 = data6.CreateNonstd(0); //create a cable section IRobotLabel sec7 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_CABLE, "CatiaCable"); IRobotBarCableData data7 = sec7.Data as IRobotBarCableData; data7.SectionAX = Math.PI * (Math.Pow((_sectionInfo[4] / 1000), 2)); //the area formula using the cable radius parameter data7.MaterialName = "STEEL"; if (_barInfo.Count != 0) { // double sectionDiameter = _barInfo[0].Diameter/1000; //the diameter in meters // double sectionthickness = _barInfo[0].SectionThickness/1000; //the thickness in meters //set the values of the tubes nonst_data1.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_D, _sectionInfo[0] / 1000); //the section diameter nonst_data1.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_T, _sectionInfo[1] / 1000); //the section thickness data1.CalcNonstdGeometry(); _structure.Labels.Store(sec1); nonst_data2.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_D, _sectionInfo[2] / 1000); //the section diameter nonst_data2.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_T, _sectionInfo[3] / 1000); //the section thickness data2.CalcNonstdGeometry(); _structure.Labels.Store(sec2); nonst_data3.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_D, _sectionInfo[4] / 1000); //the section diameter nonst_data3.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_TUBE_T, _sectionInfo[5] / 1000); //the section thickness data3.CalcNonstdGeometry(); _structure.Labels.Store(sec3); //set the values of the plate nonst_data4.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_H, _sectionInfo[6] / 1000); nonst_data4.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_B, 2 * _sectionInfo[7] / 1000); //generate correct section properties without overlapping thicknesses nonst_data4.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_T, _sectionInfo[7] / 1000); data4.CalcNonstdGeometry(); _structure.Labels.Store(sec4); nonst_data5.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_H, _sectionInfo[8] / 1000); nonst_data5.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_B, 2 * _sectionInfo[9] / 1000); //generate correct section properties without overlapping thicknesses nonst_data5.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_T, _sectionInfo[9] / 1000); data5.CalcNonstdGeometry(); _structure.Labels.Store(sec5); nonst_data6.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_H, _sectionInfo[10] / 1000); nonst_data6.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_B, 2 * _sectionInfo[11] / 1000); //generate correct section properties without overlapping thicknesses nonst_data6.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_T, _sectionInfo[11] / 1000); data6.CalcNonstdGeometry(); _structure.Labels.Store(sec6); //the values of the cable are already set! _structure.Labels.Store(sec7); } int barId = 5000; for (int i = 0; i < _barInfo.Count; i++) { Console.WriteLine("Now creating bar " + barId.ToString() + "..."); var b = (AnalyticalBar)_barInfo[i]; //find the corresponding points in the nodeList to create the bar //int robStart = 0; //int robEnd = 0; //foreach (var n in _nodeInfo) //{ // if (n.catiaID.Equals(b.CatiaStart)) // { // robStart = n.Id; // } // else if (n.catiaID.Equals(b.CatiaEnd)) // { // robEnd = n.robotID; // } // else // { // continue; // } //} //create the bar _bars.Create(barId, b.Start.Id, b.End.Id); //DON'T CREATE A RELEASE - DIFFICULT TO IMPLEMENT // _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_RELEASE, "CatiaBarRelease"); if (b.SectionType == SectionType.Tube00) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_00"); } else if (b.SectionType == SectionType.Tube01) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_01"); } else if (b.SectionType == SectionType.Tube02) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaTubeSection_02"); } else if (b.SectionType == SectionType.Plate00) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_00"); } else if (b.SectionType == SectionType.Plate01) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_01"); } else if (b.SectionType == SectionType.Plate02) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, "CatiaPlateSection_02"); } else if (b.SectionType == SectionType.Cable) { _bars.Get(barId).SetLabel(IRobotLabelType.I_LT_BAR_CABLE, "CatiaCable"); } forDeadLoadsBars.Add(barId); b.Id = barId; //b.RobotStart = robStart; //b.RobotEnd = robEnd; //b.StressAxial = 0.0; barId++; } }
static void Main(string[] args) { Console.WriteLine("Starting Robot application..."); //Cria um novo objeto da aplicação Robot IRobotApplication robApp = new RobotApplicationClass(); //Se a aplicaçao não estiver visivel, torna o robot visivel para permitir iteracao if (robApp.Visible == 0) { robApp.Interactive = 1; robApp.Visible = 1; } Console.WriteLine("Creating concrete project..."); //Cria o projeto da viga de concreto robApp.Project.New(IRobotProjectType.I_PT_SHELL); Console.WriteLine("Executing project settings..."); //Configuracao das preferencias RobotProjectPreferences projectPrefs = robApp.Project.Preferences; //Configuracoes do codigo de verificacao da estrutura de concreto projectPrefs.SetActiveCode(IRobotCodeType.I_CT_RC_THEORETICAL_REINF, "BAEL 91"); //Configuracao das preferencias de malha RobotMeshParams meshParams = projectPrefs.MeshParams; meshParams.SurfaceParams.Method.Method = IRobotMeshMethodType.I_MMT_DELAUNAY; meshParams.SurfaceParams.Generation.Type = IRobotMeshGenerationType.I_MGT_ELEMENT_SIZE; meshParams.SurfaceParams.Generation.ElementSize = 0.5; meshParams.SurfaceParams.Delaunay.Type = IRobotMeshDelaunayType.I_MDT_DELAUNAY; //Geração da estrutura Console.WriteLine("Generating structure"); IRobotStructure str = robApp.Project.Structure; Console.WriteLine("Generating nodes..."); str.Nodes.Create(1, 0, 0, 0); str.Nodes.Create(2, 3, 0, 0); str.Nodes.Create(3, 3, 3, 0); str.Nodes.Create(4, 0, 3, 0); str.Nodes.Create(5, 0, 0, 4); str.Nodes.Create(6, 3, 0, 4); str.Nodes.Create(7, 3, 3, 4); str.Nodes.Create(8, 0, 3, 4); str.Bars.Create(1, 1, 5); str.Bars.Create(2, 2, 6); str.Bars.Create(3, 3, 7); str.Bars.Create(4, 4, 8); str.Bars.Create(5, 5, 6); str.Bars.Create(6, 7, 8); Console.WriteLine("Generating labels..."); RobotLabelServer labels = str.Labels; string columnSectionName = "Rect. Column 30*30"; IRobotLabel label = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, columnSectionName); RobotBarSectionData section = (RobotBarSectionData)label.Data; section.ShapeType = IRobotBarSectionShapeType.I_BSST_CONCR_COL_R; RobotBarSectionConcreteData concrete = (RobotBarSectionConcreteData)section.Concrete; concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_B, 0.3); concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H, 0.3); section.CalcNonstdGeometry(); labels.Store(label); Console.WriteLine("Defining sections..."); RobotSelection selectionBars = str.Selections.Get(IRobotObjectType.I_OT_BAR); selectionBars.FromText("1 2 3 4"); str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, columnSectionName); RobotSectionDatabaseList steelSections = projectPrefs.SectionsActive; if (steelSections.Add("RCAT") == 1) { Console.WriteLine("Warning! Steel section base RCAT not found..."); } selectionBars.FromText("5 6"); label = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "HEA 340"); str.Labels.Store(label); str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, "HEA 340"); Console.WriteLine("Defining materials..."); string materialName = "Concrete 30"; label = labels.Create(IRobotLabelType.I_LT_MATERIAL, materialName); RobotMaterialData material = (RobotMaterialData)label.Data; material.Type = IRobotMaterialType.I_MT_CONCRETE; material.E = 3E+09; material.NU = 1 / 6; material.RO = 25000; material.Kirchoff = material.E / (2 * (1 + material.NU)); Console.WriteLine("Generating slab..."); RobotPointsArray points = (RobotPointsArray)robApp.CmpntFactory.Create(IRobotComponentType.I_CT_POINTS_ARRAY); points.SetSize(5); points.Set(1, 0, 0, 4); points.Set(2, 3, 0, 4); points.Set(3, 3, 3, 4); points.Set(4, 0, 3, 4); points.Set(5, 0, 0, 4); string slabSectionName = "Slab 30"; label = labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, slabSectionName); RobotThicknessData thickness = (RobotThicknessData)label.Data; thickness.MaterialName = materialName; thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS; RobotThicknessHomoData thicknessData = (RobotThicknessHomoData)thickness.Data; thicknessData.ThickConst = 0.3; labels.Store(label); RobotObjObject slab; int objNumber = str.Objects.FreeNumber; str.Objects.CreateContour(objNumber, points); slab = (RobotObjObject)str.Objects.Get(objNumber); slab.Main.Attribs.Meshed = 1; slab.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, slabSectionName); slab.Initialize(); Console.WriteLine("Adding hole in the slab..."); points.Set(1, 1.1, 1.1, 4); points.Set(2, 2.5, 1.1, 4); RobotObjObject hole; Console.ReadLine(); }
private void button1_Click_1(object sender, EventArgs e) { // new object Robot application IRobotApplication robApp; robApp = new RobotApplicationClass(); // if Robot is not visible if (robApp.Visible == 0) { // set robot visible and allow user interaction robApp.Interactive = 1; robApp.Visible = 1; } // create a project concrete beam robApp.Project.New(IRobotProjectType.I_PT_SHELL); RobotProjectPreferences ProjectPrefs; ProjectPrefs = robApp.Project.Preferences; ProjectPrefs.SetActiveCode(IRobotCodeType.I_CT_RC_THEORETICAL_REINF, "BAEL 91"); RobotMeshParams MeshParams; MeshParams = ProjectPrefs.MeshParams; MeshParams.SurfaceParams.Method.Method = IRobotMeshMethodType.I_MMT_DELAUNAY; MeshParams.SurfaceParams.Generation.Type = IRobotMeshGenerationType.I_MGT_ELEMENT_SIZE; MeshParams.SurfaceParams.Generation.ElementSize = 0.5; MeshParams.SurfaceParams.Delaunay.Type = IRobotMeshDelaunayType.I_MDT_DELAUNAY; //Output.AddItem "Structure Generation..." IRobotStructure str; str = robApp.Project.Structure; str.Nodes.Create(1, 0, 0, 0); str.Nodes.Create(2, 3, 0, 0); str.Nodes.Create(3, 3, 3, 0); str.Nodes.Create(4, 0, 3, 0); str.Nodes.Create(5, 0, 0, 4); str.Nodes.Create(6, 3, 0, 4); str.Nodes.Create(7, 3, 3, 4); str.Nodes.Create(8, 0, 3, 4); str.Bars.Create(1, 1, 5); str.Bars.Create(2, 2, 6); str.Bars.Create(3, 3, 7); str.Bars.Create(4, 4, 8); str.Bars.Create(5, 5, 6); str.Bars.Create(6, 7, 8); RobotLabelServer labels; labels = str.Labels; string ColumnSectionName = "Rect. Column 30*30"; 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.3); concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H, 0.3); section.CalcNonstdGeometry(); labels.Store(label); RobotSelection selectionBars; selectionBars = str.Selections.Get(IRobotObjectType.I_OT_BAR); selectionBars.FromText("1 2 3 4"); //给量赋值截面 str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, ColumnSectionName); RobotSectionDatabaseList steelSections; steelSections = ProjectPrefs.SectionsActive; if (steelSections.Add("RCAT") == 1) { MessageBox.Show("Steel section base RCAT not found..."); } selectionBars.FromText("5 6"); label = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "HEA 340"); str.Labels.Store(label); str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, "HEA 340"); 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)); str.Labels.Store(label); RobotPointsArray points; points = (RobotPointsArray)robApp.CmpntFactory.Create(IRobotComponentType.I_CT_POINTS_ARRAY); points.SetSize(5); points.Set(1, 0, 0, 4); points.Set(2, 3, 0, 4); points.Set(3, 3, 3, 4); points.Set(4, 0, 3, 4); points.Set(5, 0, 0, 4); string SlabSectionName = "Slab 30"; label = labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, SlabSectionName); RobotThicknessData thickness; thickness = (RobotThicknessData)label.Data; thickness.MaterialName = MaterialName; thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS; RobotThicknessHomoData thicknessData; thicknessData = (RobotThicknessHomoData)thickness.Data; thicknessData.ThickConst = 0.3; labels.Store(label); RobotObjObject slab; int ObjNumber = str.Objects.FreeNumber; str.Objects.CreateContour(ObjNumber, points); slab = (RobotObjObject)str.Objects.Get(ObjNumber); slab.Main.Attribs.Meshed = 1; slab.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, SlabSectionName); slab.Initialize(); points.Set(1, 1.1, 1.1, 4); points.Set(2, 2.5, 1.1, 4); points.Set(3, 2.5, 2.5, 4); points.Set(4, 1.1, 2.5, 4); points.Set(5, 1.1, 1.1, 4); RobotObjObject hole; int HoleNumber = str.Objects.FreeNumber; str.Objects.CreateContour(HoleNumber, points); hole = (RobotObjObject)str.Objects.Get(HoleNumber); hole.Main.Attribs.Meshed = 0; hole.Initialize(); string FootName = "Foot"; label = labels.Create(IRobotLabelType.I_LT_SUPPORT, FootName); RobotNodeSupportData footData; footData = (RobotNodeSupportData)label.Data; footData.UX = 1; footData.UY = 1; footData.UZ = 0; footData.KZ = 80000000; footData.RX = 1; footData.RY = 1; footData.RZ = 1; labels.Store(label); RobotSelection SelectionNodes; SelectionNodes = str.Selections.Get(IRobotObjectType.I_OT_NODE); SelectionNodes.FromText("1 2 3 4"); str.Nodes.SetLabel(SelectionNodes, IRobotLabelType.I_LT_SUPPORT, FootName); RobotLoadRecord LoadRecord; //self weight on entire structure RobotSimpleCase caseSW; caseSW = str.Cases.CreateSimple(1, "SW", IRobotCaseNature.I_CN_PERMANENT, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR); caseSW.Records.New(IRobotLoadRecordType.I_LRT_DEAD); LoadRecord = (RobotLoadRecord)caseSW.Records.Get(1); LoadRecord.SetValue(System.Convert.ToInt16(IRobotDeadRecordValues.I_DRV_Z), -1); LoadRecord.SetValue(System.Convert.ToInt16(IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE), 0); //contour live load on the slab RobotSimpleCase CaseLive; CaseLive = str.Cases.CreateSimple(2, "Live", IRobotCaseNature.I_CN_EXPLOATATION, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR); int Uniform = CaseLive.Records.New(IRobotLoadRecordType.I_LRT_UNIFORM); LoadRecord = (RobotLoadRecord)CaseLive.Records.Get(Uniform); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PX), 0); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PY), 0); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PZ), -10000); //apply created load to the slab LoadRecord.Objects.FromText(System.Convert.ToString(ObjNumber)); //linear wind load on the beam RobotSimpleCase CaseWind; CaseWind = str.Cases.CreateSimple(3, "Wind", IRobotCaseNature.I_CN_WIND, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR); Uniform = CaseWind.Records.New(IRobotLoadRecordType.I_LRT_BAR_UNIFORM); LoadRecord = (RobotLoadRecord)CaseWind.Records.Get(Uniform); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PX), 0); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PY), 1000); LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PZ), 0); //apply created load to the beam //将荷载作用到梁上面 LoadRecord.Objects.FromText("5"); RobotCalcEngine CalcEngine = robApp.Project.CalcEngine; CalcEngine.GenerationParams.GenerateNodes_BarsAndFiniteElems = true; CalcEngine.UseStatusWindow = true; this.Activate(); if (CalcEngine.Calculate() == 1) { MessageBox.Show("Calculation Failed!", "Calculations"); } else { MessageBox.Show("Done!", "Calculations"); } CalcEngine = null; RConcrCalcEngine concrCalcEngine; concrCalcEngine = robApp.Project.ConcrReinfEngine; RConcrSlabRequiredReinfEngine concrSlabRequiredReinfEngine; concrSlabRequiredReinfEngine = concrCalcEngine.SlabRequiredReinf; RConcrSlabRequiredReinfCalcParams slabRnfParams; slabRnfParams = concrSlabRequiredReinfEngine.Params; slabRnfParams.Method = IRobotReinforceCalcMethods.I_RCM_WOOD_ARMER; slabRnfParams.GloballyAvgDesginForces = false; slabRnfParams.ForcesReduction = false; slabRnfParams.DisplayErrors = false; slabRnfParams.CasesULS.FromText("1 2 3 4 5 6 7 8"); RobotSelection slabs; slabs = slabRnfParams.Panels; slabs.FromText(System.Convert.ToString(ObjNumber)); string SlabReinforcementName = "Slab X"; label = labels.Create(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, SlabReinforcementName); labels.Store(label); slab.SetLabel(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, SlabReinforcementName); slab.Update(); this.Activate(); if (!concrSlabRequiredReinfEngine.Calculate()) { MessageBox.Show("Calculation Failed!", "Concrete Calculations"); } else { MessageBox.Show("Done!", "Concrete Calculations"); } //getting results My and Yz for beam (bar 5) with live load (case 2) //获取单元5的内力 string txt; txt = "Bar 5, Live at 0.5 length:" + "\n\r" + " My = " + str.Results.Bars.Forces.Value(5, 2, 0.5).MY / 1000 + " [kN*m]" + "\n\r" + " Qz = " + -str.Results.Bars.Deflections.Value(5, 2, 0.5).UZ * 1000 + " [mm]" + "\n\r" + " Fz1 = " + str.Results.Bars.Forces.Value(5, 2, 0).FZ / 1000 + " [kN]" + "\n\r" + " Fz2 = " + str.Results.Bars.Forces.Value(5, 2, 1).FZ / 1000 + " [kN]" + "\n\r"; //getting results Fx and Fy for column (bar 4) with wind load (case 3) //获取单元4的内力 txt += "Bar 4, Wind:" + "\n\r" + " Fx = " + str.Results.Bars.Forces.Value(4, 3, 1).FX / 1000 + " [kN]" + "\n\r" + " Fy = " + str.Results.Bars.Forces.Value(4, 3, 1).FY / 1000 + " [kN]" + "\n\r"; //getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with self-weight (case 1) //节点1内力 txt += "Node 1, Self-Weight:" + "\n\r" + " Fx = " + str.Results.Nodes.Reactions.Value(1, 1).FX / 1000 + " [kN]" + "\n\r" + " Fy = " + str.Results.Nodes.Reactions.Value(1, 1).FY / 1000 + " [kN]" + "\n\r" + " Fz = " + str.Results.Nodes.Reactions.Value(1, 1).FZ / 1000 + " [kN]" + "\n\r" + " Mx = " + str.Results.Nodes.Reactions.Value(1, 1).MX / 1000 + " [kN]" + "\n\r" + " My = " + str.Results.Nodes.Reactions.Value(1, 1).MY / 1000 + " [kN]" + "\n\r" + " Mz = " + str.Results.Nodes.Reactions.Value(1, 1).MZ / 1000 + " [kN]" + "\n\r"; //getting results Ax+, Ax-, Ay+, Ay- for slab //获取板单元的内力 RobotSelection SelectionFE; SelectionFE = str.Selections.Get(IRobotObjectType.I_OT_FINITE_ELEMENT); SelectionFE.FromText(slab.FiniteElems); RobotLabelCollection ObjFEs; ObjFEs = (RobotLabelCollection)str.FiniteElems.GetMany(SelectionFE); double AxP; double AxM; double AyP; double AyM; double A; A = 0; AxP = 0; AxM = 0; AyP = 0; AyM = 0; RobotFiniteElement FE; for (int n = 1; n <= ObjFEs.Count; n++) { FE = (RobotFiniteElement)ObjFEs.Get(n); A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AX_BOTTOM; if (A > AxM) { AxM = A; } A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AX_TOP; if (A > AxP) { AxP = A; } A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AY_BOTTOM; if (A > AyM) { AyM = A; } A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AY_TOP; if (A > AyP) { AyP = A; } } //getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with self-weight (case 1) //求结点的反力 txt += "Slab 1, Reinforcemet extreme values:" + "\n\r" + " Ax+ = " + AxP * 10000 + " [cm2]" + "\n\r" + " Ax- = " + AxM * 10000 + " [cm2]" + "\n\r" + " Ay+ = " + AyP * 10000 + " [cm2]" + "\n\r" + " Ay- = " + AyM * 10000 + " [cm2]" + "\n\r"; this.Activate(); MessageBox.Show(txt, "Results"); }
/// <summary> /// Add a new Section entry to this mapping table /// </summary> /// <param name="section"></param> /// <param name="label"></param> public void Add(SectionFamily section, IRobotLabel label) { Add(SectionCategory, section.GUID, label.Name); }
private void button1_Click(object sender, EventArgs e) { Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"EXCELPATH...\excelFile.xlsx", 0, false); Excel.Sheets xlSheets = xlWorkbook.Worksheets; string currentSheet = "Sheet1"; Excel.Worksheet xlWorksheet = (Excel.Worksheet)xlSheets.get_Item(currentSheet); IRobotApplication robotApp = new RobotApplication(); IRobotLabelServer lab_serv = robotApp.Project.Structure.Labels; progressBar1.Value = 0; progressBar1.Maximum = 151; progressBar1.Minimum = 0; progressBar1.Step = 1; for (int i = 1; i < 152; i++) { string secName = xlWorksheet.Cells[i + 1, 1].Value.ToString(); double secAx = double.Parse(xlWorksheet.Cells[i + 1, 2].Value.ToString()); double secIx = double.Parse(xlWorksheet.Cells[i + 1, 3].Value.ToString()); double secIy = double.Parse(xlWorksheet.Cells[i + 1, 4].Value.ToString()); double secIz = double.Parse(xlWorksheet.Cells[i + 1, 5].Value.ToString()); double secVy = double.Parse(xlWorksheet.Cells[i + 1, 6].Value.ToString()); double secVpy = double.Parse(xlWorksheet.Cells[i + 1, 7].Value.ToString()); double secVz = double.Parse(xlWorksheet.Cells[i + 1, 8].Value.ToString()); double secVpz = double.Parse(xlWorksheet.Cells[i + 1, 9].Value.ToString()); IRobotLabel sec = lab_serv.Create(IRobotLabelType.I_LT_BAR_SECTION, secName); IRobotBarSectionData data = sec.Data; data.Type = IRobotBarSectionType.I_BST_STANDARD; data.ShapeType = IRobotBarSectionShapeType.I_BSST_UNKNOWN; data.SetValue(IRobotBarSectionDataValue.I_BSDV_AX, secAx); data.SetValue(IRobotBarSectionDataValue.I_BSDV_IX, secIx); data.SetValue(IRobotBarSectionDataValue.I_BSDV_IY, secIy); data.SetValue(IRobotBarSectionDataValue.I_BSDV_IZ, secIz); data.SetValue(IRobotBarSectionDataValue.I_BSDV_VY, secVy); data.SetValue(IRobotBarSectionDataValue.I_BSDV_VPY, secVpy); data.SetValue(IRobotBarSectionDataValue.I_BSDV_VZ, secVz); data.SetValue(IRobotBarSectionDataValue.I_BSDV_VPZ, secVpz); lab_serv.Store(sec); IRobotBar bar = (IRobotBar)robotApp.Project.Structure.Bars.Get(i); bar.SetLabel(IRobotLabelType.I_LT_BAR_SECTION, secName); progressBar1.PerformStep(); } Marshal.FinalReleaseComObject(xlWorksheet); Marshal.FinalReleaseComObject(xlSheets); xlWorkbook.Close(false); Marshal.FinalReleaseComObject(xlWorkbook); xlApp.Quit(); Marshal.FinalReleaseComObject(xlApp); MessageBox.Show("All the profiles have been applied!", "Work done !", MessageBoxButtons.OK); }
private void CreatePlates(double liveLoad, List <int> forLiveLoads, double windLoad, List <int> forWindLoads, double buildingLoad, List <int> forBuildingLoads, List <int> forDeadLoadsSlabs, IRobotSimpleCase ll, IRobotSimpleCase wl, IRobotSimpleCase bl, double fatManLoad, IRobotSimpleCase dl, List <int> forDeadLoadsBars) { #region material info //create the slab material // string materialName = "Catia_material_slab"; // IRobotLabel Label = _structure.Labels.Create(IRobotLabelType.I_LT_MATERIAL, materialName); // RobotMaterialData Material = Label.Data as RobotMaterialData; // Material.Type = IRobotMaterialType.I_MT_CONCRETE; // Material.E = 30000000000; // Material.NU = 0.16; // Material.RO = 25000; // Material.Kirchoff = Material.E / (2*(1 + Material.NU)); // _project.Structure.Labels.Store(Label); //create the panel type string catSlabSectionName = "Catia_Slab"; IRobotLabel Label = _structure.Labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, catSlabSectionName); RobotThicknessData thickness = Label.Data as RobotThicknessData; // thickness.MaterialName = materialName; thickness.MaterialName = "CONCR"; thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS; RobotThicknessHomoData thicknessData = thickness.Data as RobotThicknessHomoData; if (_plateInfo.Count != 0) { thicknessData.ThickConst = _plateInfo[0].Thickness / 1000; //test one panel for thickness } else { thicknessData.ThickConst = .02; } _project.Structure.Labels.Store(Label); //create the panel material // string materialName = "Catia_material_panel"; // Label = _structure.Labels.Create(IRobotLabelType.I_LT_MATERIAL, materialName); // Material = Label.Data as RobotMaterialData; // Material.Type = IRobotMaterialType.I_MT_CONCRETE; // Material.Type = IRobotMaterialType.I_MT_ALUMINIUM; // Material.E = 69000000000; // Material.NU = 0.16; //the poisson ratio // Material.RO = 25000; //the mass // Material.Kirchoff = Material.E / (2*(1 + Material.NU)); // _project.Structure.Labels.Store(Label); string catPanelSectionName = "Catia_Panel"; Label = _structure.Labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, catPanelSectionName); thickness = Label.Data as RobotThicknessData; // thickness.MaterialName = materialName; thickness.MaterialName = "ALUM"; thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS; thicknessData = thickness.Data as RobotThicknessHomoData; thicknessData.ThickConst = 0.003175; //a 1/8" thick aluminum panel, we'll need to use a single finite element _project.Structure.Labels.Store(Label); string catShearPanelName = "Catia_Shear"; Label = _structure.Labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, catShearPanelName); thickness = Label.Data as RobotThicknessData; thickness.MaterialName = "CONCR"; thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS; thicknessData = thickness.Data as RobotThicknessHomoData; thicknessData.ThickConst = 0.3; //a 1/8" thick aluminum panel, we'll need to use a single finite element _project.Structure.Labels.Store(Label); #endregion int plateId = 10000; for (int i = 0; i < _plateInfo.Count; i++) { Console.WriteLine("Now creating plate " + plateId.ToString() + "..."); List <int> robotNodes = new List <int>(); var p = (AnalyticalPlate)_plateInfo[i]; //the plate to create //at this point we know the CATIA nodes and the robot nodes //but the robot node list for each plate is empty //find the robot node that corresponds to each catia node in the list //fill up the corresponding robot id list //foreach (string catIndex in p.CatiaPoints) //{ // foreach (Node n in _nodeInfo) // { // //if the node id equals that in the catia points list // if (n.catiaID.Equals(catIndex)) // { // robotNodes.Add(n.robotID); //add the int robot id to the other list // } // else // { // continue; //continue; // } // } //} p.Nodes = robotNodes; //change out the robotNodes list on the object //the robot point array to hold all the pts RobotPointsArray pts = new RobotPointsArrayClass(); pts.SetSize(p.Nodes.Count); int ptIndex = 1; //fill up the points array foreach (int rId in p.Nodes) { IRobotNode robNode = _structure.Nodes.Get(rId) as IRobotNode; pts.Set(ptIndex, robNode.X, robNode.Y, robNode.Z); //MessageBox.Show(robNode.X.ToString()); ptIndex++; } //int plateId = _structure.Objects.FreeNumber; _project.Structure.Objects.CreateContour(plateId, pts); IRobotObjObject obj = _structure.Objects.Get(plateId) as IRobotObjObject; obj.Main.Attribs.Meshed = 1; if (p.PlateType == PlateType.Slab) { obj.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, catSlabSectionName); obj.SetLabel(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, "Panel"); } else if (p.PlateType == PlateType.Panel) { obj.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, catPanelSectionName); } else if (p.PlateType == PlateType.Shear) { obj.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, catShearPanelName); obj.SetLabel(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, "Wall"); } else { obj.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, catPanelSectionName); } obj.Initialize(); obj.Update(); //create some loads //if the live load has a value // if(p.PlateType == PlateType.slab) if (p.LiveLoad > 0.0) { Console.WriteLine("Now creating live load on slab " + plateId.ToString() + "..."); liveLoad = p.LiveLoad; forLiveLoads.Add(plateId); } //if the wind load has a value // else if (p.PlateType == PlateType.panel) if (p.WindLoad > 0.0) { Console.WriteLine("Now creating wind load on panel " + plateId.ToString() + "..."); windLoad = p.WindLoad; forWindLoads.Add(plateId); } if (p.BuildingLoad > 0.0) { Console.WriteLine("Now creating building load on panel " + plateId.ToString() + "..."); buildingLoad = p.BuildingLoad; forBuildingLoads.Add(plateId); } forDeadLoadsSlabs.Add(plateId); //all p.Id = plateId; //set the plateId on the object plateId++; } IRobotLoadRecord rec = null; if (forLiveLoads.Count > 0) { //add the live loads on all panels rec = ll.Records.Get(1); rec.Objects.FromText(forLiveLoads[0].ToString() + "to" + forLiveLoads[forLiveLoads.Count - 1].ToString()); rec.SetValue(2, -liveLoad); rec.SetValue(11, 0); } if (forWindLoads.Count > 0) { //add the forces on the wind panels rec = wl.Records.Get(1); rec.Objects.FromText(forWindLoads[0].ToString() + "to" + forWindLoads[forWindLoads.Count - 1].ToString()); rec.SetValue(0, _windx * windLoad); //the X value rec.SetValue(1, _windy * windLoad); //the Y value rec.SetValue(2, _windz * windLoad); // the Z value // rec.SetValue(11, 1); //this sets it use the "local" normal for the wind direction rec.SetValue(11, 0); //this is the default - loads act in the global direction //add the uplift on the wind panels // rec = wl_uplift.Records.Get(1); // rec.Objects.FromText(forWindLoads[0].ToString() +"to"+forWindLoads[forWindLoads.Count-1].ToString()); // rec.SetValue(2, -windLoad); // rec.SetValue(11,1); } if (forBuildingLoads.Count > 0) { rec = bl.Records.Get(1); rec.Objects.FromText(forBuildingLoads[0].ToString() + "to" + forBuildingLoads[forBuildingLoads.Count - 1].ToString()); rec.SetValue(2, -buildingLoad); rec.SetValue(11, 0); } //create a randomly placed live load on the structure //the fat man load IRobotCollection nodes = _nodes.GetAll(); Random r = new Random(); int randPoint = r.Next((nodes.Get(1) as IRobotNode).Number, (nodes.Get(nodes.Count) as IRobotNode).Number); // Debug.WriteLine(randPoint); rec = ll.Records.Get(2); rec.SetValue(2, -fatManLoad); rec.Objects.FromText(randPoint.ToString()); //set the dead loads for the structure rec = dl.Records.Get(1); //add dead loads to bars if (forDeadLoadsBars.Count > 0 && forDeadLoadsSlabs.Count == 0) { rec.Objects.FromText(forDeadLoadsBars[0].ToString() + "to" + forDeadLoadsBars[forDeadLoadsBars.Count - 1].ToString()); } //add dead loads to bars and slabs else if (forDeadLoadsBars.Count > 0 && forDeadLoadsSlabs.Count > 0) { rec.Objects.FromText(forDeadLoadsBars[0].ToString() + "to" + forDeadLoadsBars[forDeadLoadsBars.Count - 1].ToString() + " " + forDeadLoadsSlabs[0].ToString() + "to" + forDeadLoadsSlabs[forDeadLoadsSlabs.Count - 1].ToString()); } //add dead loads to slabs only else if (forDeadLoadsBars.Count == 0 && forDeadLoadsSlabs.Count > 0) { rec.Objects.FromText(forDeadLoadsSlabs[0].ToString() + "to" + forDeadLoadsSlabs[forDeadLoadsSlabs.Count - 1].ToString()); } rec.SetValue(2, -1); //set the z value // Console.WriteLine("Waiting for load application..."); // System.Threading.Thread.Sleep(10000); }
/// <summary> /// Get the Nucleus section property, if any, mapped to the ID of the specified label /// </summary> /// <param name="label"></param> /// <param name="model"></param> /// <returns></returns> public SectionFamily GetMappedSectionFamily(IRobotLabel label, Model.Model model) { return(GetMappedSectionFamily(label.Name, model)); }
/// <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(); }