1) How Rotate a bar
Gamma for RobotBar
//IRobotObjOperationType obrot = IRobotObjOperationType.I_OOT_ROTATE;
IRobotObjOperation obrot;
IRobotObjOperRotation rotacja;
rotacja.Angle 90;
private IRobotApplication robApp;
private RobotProjectPreferences ProjectPrefs;
private RobotMeshParams MeshParams;
private IRobotStructure str;
private RobotLabelServer labels;
private IRobotLabel label;
private RobotSelection SelectionNodes;
private RobotNodeSupportData footData;
private RobotSectionDatabaseList steelSections;
string StrSlup = "HEB 240"; // nazwy z odstępem
string StrRygiel = "IPE 180";
string StrScianaSrodek = "UPE 80";
string StrScianaGora = "UPE 80";
string klasaStal = "S355";
robApp = new RobotApplicationClass();
str = robApp.Project.Structure;
labels = robApp.Project.Structure.Labels;
IRobotLabel Section;
IRobotBarSectionData SData;
IRobotNodeServer inds = robApp.Project.Structure.Nodes;
IRobotBarServer ibars = robApp.Project.Structure.Bars;
RobotSelection iselSlup = robApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR);
inds.Create(1,0,0, 0);
inds.Create(2, 5,5, 0);
ibars.Create(1, 1, 2); //slup
iselSlup.AddOne(1);
ibars.SetLabel(iselSlup, IRobotLabelType.I_LT_MATERIAL, klasaStal);
Section = robApp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, StrSlup);
SData = (IRobotBarSectionData)Section.Data;
SData.LoadFromDBase(StrSlup);
robApp.Project.Structure.Labels.Store(Section);
str.Bars.SetLabel(iselSlup, IRobotLabelType.I_LT_BAR_SECTION, StrSlup);
On a link “setting gamma using the API” there is
IRobotBar bar;
Bar = … please write this line using above code
bar.Gamma = 90;
I don’t know how to add created bar ibars.Create(1, 1, 2); to IRobotBar method
2) How to set local system as axis of a bar ( 3 points) ?
I want to set a local system parallel to axis in a bar to do an offset for another bar
IRobotGeoCoordinateSystem.I_GCS_LOCAL_ORIGINAL;
3)
How to add all bars from construction
I would like TempLato involves to all bars in a construction
private IRobotStructure structure;
RobotSimpleCase TempLato, TempZima;
TempLato = structure.Cases.CreateSimple(7, "TmpLato", IRobotCaseNature.I_CN_TEMPERATURE,
IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR);
TempLato.Records.New(IRobotLoadRecordType.I_LRT_BAR_THERMAL);
LoadRecord = (RobotLoadRecord)TempLato.Records.Get(1);
LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TX), obcTmpLato);
LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TY), 0);
LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TZ), 0);
4) How to divide bar into “ n parts”
number of segments : 4
Edit divide (division )
DivideBar (_bar_number : long, _div_points : IRobotValuesArray, _relative : bool) :
IRobotNumbersArray
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Ad 1
robApp = new RobotApplicationClass(); str = robApp.Project.Structure; labels = robApp.Project.Structure.Labels; IRobotLabel Section; IRobotBarSectionData SData; IRobotNodeServer inds = robApp.Project.Structure.Nodes; IRobotBarServer ibars = robApp.Project.Structure.Bars; RobotSelection iselSlup = robApp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); inds.Create(1,0,0, 0); inds.Create(2, 5,5, 0); int BarNumber = 2; ibars.Create(BarNumber, 1, 2); //slup iselSlup.AddOne(1); ibars.SetLabel(iselSlup, IRobotLabelType.I_LT_MATERIAL, klasaStal); Section = robApp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, StrSlup); SData = (IRobotBarSectionData)Section.Data; SData.LoadFromDBase(StrSlup); robApp.Project.Structure.Labels.Store(Section); str.Bars.SetLabel(iselSlup, IRobotLabelType.I_LT_BAR_SECTION, StrSlup); IRobotBar Bar = (IRobotBar)ibars.Get(BarNumber); Bar.Gamma = 12;
2) How to set local system as axis of a bar ( 3 points) ?
I want to set a local system parallel to axis in a bar to do an offset for another bar
LCS of bars is created automatically accordding to these rules:
You can rotate it around local X using Bar.Gamma =
3)
How to add all bars from construction
I would like TempLato involves to all bars in a construction
robApp = new RobotApplicationClass(); IRobotStructure structure = robApp.Project.Structure; RobotSimpleCase TempLato, TempZima; TempLato = structure.Cases.CreateSimple(7, "TmpLato", IRobotCaseNature.I_CN_TEMPERATURE, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR); TempLato.Records.New(IRobotLoadRecordType.I_LRT_BAR_THERMAL); double obcTmpLato = 21; RobotLoadRecord LoadRecord = (RobotLoadRecord)TempLato.Records.Get(1); LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TX), obcTmpLato); LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TY), 0); LoadRecord.SetValue(Convert.ToInt16(IRobotBarThermalRecordValues.I_BTRV_TZ), 0); LoadRecord.Objects.AddText("wsz"); // in english replace string by "all"
4) How to divide bar into “ n parts”
number of segments : 4
Example of dividing bar number 1 into 4 pieces by 3 points located 2,4,5 meters from the begining:
IRobotApplication robApp; RobotValuesArray DivPoints = new RobotValuesArray(); RobotNumbersArray RobotNumberAr = new RobotNumbersArray(); robApp = new RobotApplication(); DivPoints.SetSize(3); DivPoints.Set(1,2); DivPoints.Set(2,4); DivPoints.Set(3,5); RobotNumberAr.SetSize(4); int barnumber = 1; RobotNumberAr = (RobotNumbersArray)robApp.Project.Structure.Edit.DivideBar(barnumber,DivPoints,false);