Hello!
I'm making program, which will do steel structure optimization.
I define the structure, set up design groups, make static calculations then Code group design.
In code group design I get profile name:
RdmDetRes = RDmGrpRes.Get(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING); opt_profile = RdmDetRes.ProfileName;
But how do I change the bar profile to designed ones? Do I really have to have all the sections within optimisation range with their Labels defined in model?
In visual interface there is "change all" button.
Maybe there is any example? I'm writing C# but any example would be very useful.
P.S. One more " bonus" question - Is there access to "Cost Estimation" table through API? I'm looking for the fastest way to get total weight of structure.
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
But how do I change the bar profile to designed ones?
I'm looking for the fastest way to get total weight of structure.
Usually Case 1 = selweight (or any other)
so get FZ sum of reactions of sw case.
Thank you, but this example (just as steel frame example within SDK) works with labels which are already defined in "sections" window.
IRobotNamesArray inames = robotApp.Project.Structure.Labels.GetAvailableNames(IRobotLabelType.I_LT_BAR_SECTION);
Or maybe I am missing something?
You can get designed section name by IRDimDetailedRes.ProfileName, then use standard Bar.SetLabel...
There is no "Change All" or "Change" implemented in Steel Design API.
there were almost no information on the internet about Robot (except Millenium videos).
Indeed there was no forum but....
IRobotBarSectionQuantitySurvey qsurvey; qsurvey = iapp.Project.Structure.QuantitySurvey.BarSections; double sectcount = qsurvey.Count; double sectweight=0; string sectname=""; for (var i = 1; i <= sectcount; i++) { sectweight = qsurvey.GetWeight(i) / 9.80665; sectname = qsurvey.GetName(i); MessageBox.Show(sectname + " " + sectweight.ToString()); }
This is code i'm using to get weights for every section. Maybe helps for someone.
This post also helped me:
I'm changing profiles this way:
for (var i = 1; i <= ObjCnt; i++) { RDmGrpRes = (IRDimGrpRes)RdmAllRes.Get(i); // reading design group results
// for optimisation only one profile family, therefore first parameter always 0 RdmDetRes = RDmGrpRes.Get(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING); opt_profils = RdmDetRes.ProfileName; //create profile label IRobotLabel opt_label = iapp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_BAR_SECTION, opt_profils); IRobotBarSectionData SData = (IRobotBarSectionData)opt_label.Data; SData.LoadFromDBase(opt_profils); iapp.Project.Structure.Labels.Store(opt_label); // apply label and material to the bars RobotSelection isel_dim = iapp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_BAR); isel_dim.AddText(dgrp_members[i]); ibars.SetLabel(isel_dim, IRobotLabelType.I_LT_BAR_SECTION, opt_profils); ibars.SetLabel(isel_dim, IRobotLabelType.I_LT_MATERIAL, default_material); isel_dim.Clear(); }
I belive that routine could be speeded up by using LoadFromDBase2() instead LoadFromDBase()