(API) Finite element results for CQC combinations

(API) Finite element results for CQC combinations

alexanderziotopoulos5224
Explorer Explorer
2,245 Views
12 Replies
Message 1 of 13

(API) Finite element results for CQC combinations

alexanderziotopoulos5224
Explorer
Explorer

Hi,

 

in the forum there is an example where you can get finite element results via API using an excell file and VBA.

Using this file when exporting results from a model containing earthquake analysis results it seems that only the results from mode 1 are exported for the excitation directions (X Y Z) and not from the CQC combination of the modes.

Is there a possibility to specify that the CQC combination of the modes is to be exported when having earthquake analysis results.

 

Thanks

0 Likes
Accepted solutions (2)
2,246 Views
12 Replies
Replies (12)
Message 2 of 13

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Sure it can be done

Take a look at attached macro



Rafal Gaweda
Message 3 of 13

alexanderziotopoulos5224
Explorer
Explorer

Thanks Rafal.

0 Likes
Message 4 of 13

alexander.silvaGA9XG
Participant
Participant

Hi mr. Rafal,
Can you tell me if it possible to get the complex result (top and bottom reinforcement) at the FE nodes and/or from a section cut?
Thanks.

0 Likes
Message 5 of 13

hi @alexander.silvaGA9XG 

You can add a polyline on your panel before meshing and extract the results at the corresponding nodes.

Best Regards

 

See also : https://forums.autodesk.com/t5/robot-structural-analysis-forum/panel-cuts-in-panels-in-tablature-for...

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 6 of 13

miguel_paulinoY2Y8C
Community Visitor
Community Visitor

"I'm struggling to get there on my own. Would you happen to have an example, maybe in Python or a similar language, that you could share?"

0 Likes
Message 7 of 13

hi @miguel_paulinoY2Y8C 

Have you tried using an AI tool or a code conversion website, such as ChatGPT, deepseek, GitHub Copilot, or code converters like Telerik Code Converter or CodeTranslator.com?

Why not use @Rafal.Gaweda's Excel app if you're not familiar with coding?

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 8 of 13

Just translating code into another language without adding anything new isn’t very helpful for the forum. Do you have any extra features or improvements in mind?

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 9 of 13

miguel_paulinoY2Y8C
Community Visitor
Community Visitor

miguel_paulinoY2Y8C_0-1752741679292.png

Dear Stephane,


Our goal is to analyze the redistribution of complex forces in reinforcement elements perpendicular to a defined section ("cut").

If there is a way to extract both bottom and top reinforcement values and their positions in a format that would allow for graphical plotting, that would be greatly appreciated.

Thank you in advance for your support.

0 Likes
Message 10 of 13

reinforcement => not implemented   (API) Geting Required Reinforcement on panels

For tabulated cutting results, refer to the values at the nearest nodes.

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 11 of 13

alexander.silvaGA9XG
Participant
Participant

Mr. Stephane,

What about the complex forces, is implemented by API?

alexandersilvaGA9XG_2-1752754994823.png

 

0 Likes
Message 12 of 13

as explained first follow the code provided by @Rafal.Gaweda, here is my test ↓

static void PrintPanelReinforcements(string panels)
{
    RobotApplication RobApp = new();
    RobotStructure structure = RobApp.Project.Structure;
    RobotFeResultServer feRes = structure.Results.FiniteElems;

    var pSel = structure.Selections.Create(I_OT_PANEL); pSel.FromText(panels);
    static string GetFormatedValues(RobotFeResultReinforcement r)
        => string.Concat(new[] { r.AX_BOTTOM, r.AX_TOP, r.AY_BOTTOM, r.AY_TOP }.Select(v => $"{v * 10000,10:F2}"));

    int wl = RobApp.Preferences.GetLanguage(I_L_WORK);
    foreach (int p in pSel.ToArray(wl))
        foreach (int n in ((RobotObjObject)structure.Objects.Get(p)).Nodes.ToArray(wl))
            WriteLine($"{$"{p} / {n}",-10}{GetFormatedValues(feRes.Reinforcement(p, n))}");
}

Stephanekapetanovic_0-1752760012019.png

Stephanekapetanovic_1-1752760084320.png

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 13 of 13

Accepted solution

hi @miguel_paulinoY2Y8C 

For once, here’s a C# interpretation of the original VBA code.

Compared to Excel, displaying results in the console allows you to divide the execution time by 2.

You can save another 30-50% by using classes, and even more if you reduce the output to a simple data table for plotting.

Stephanekapetanovic_0-1752819594373.png

public static void PrintCQCResultsForForum(string panels, string cases) {
    if (string.IsNullOrEmpty(panels) || string.IsNullOrEmpty(cases)) return;

    RobotApplication RobApp = new RobotApplication();
    if (RobApp.Visible != -1 || RobApp.Project.IsActive != -1 ||
        !new[] { I_PT_PLATE, I_PT_SHELL, I_PT_BUILDING }.Contains(RobApp.Project.Type) ||
        RobApp.Project.Structure.Results.Available != -1) return;
    RobotStructure Structure = RobApp.Project.Structure;
    RobotSelectionFactory Selections = Structure.Selections;
    RobotSelection ps = Selections.Create(I_OT_PANEL); ps.FromText(panels); if (ps.Count == 0) return;
    RobotSelection cs = Selections.Create(I_OT_CASE);  cs.FromText(cases);  if (cs.Count == 0) return;

    int wl = RobApp.Preferences.GetLanguage(I_L_WORK); var symbols = new[] { "+", "-" };
    var feStrings = ps.ToArray(wl).Select(p => ((RobotObjObject)Structure.Objects.Get(p)).FiniteElems);
    int[] FEsNumbers = string.Join(" ", feStrings).ToArray(wl),
         CaseNumbers = cs.ToArray(wl);

    RobotFeResultServer FeRS = Structure.Results.FiniteElems;
    RobotFeResultParams FePrms = new() { Layer = IRobotFeLayerType.I_FLT_MIDDLE };
    FePrms.SetDirX(IRobotObjLocalXDirDefinitionType.I_OLXDDT_CARTESIAN, 1, 0, 0);

    static string GetFormatedValues(IRobotFeResultComplex c, IRobotFeResultDetailed d)
        => string.Concat(new[] { d.QXX, d.QYY, c.MXX_TOP, c.MXX_BOTTOM, c.MYY_TOP, c.MYY_BOTTOM }
                 .Select(v => $"{v,15:F2}"));
    void Print(string name, RobotFeResultParams Params) =>
        WriteLine($"{name,-15}{GetFormatedValues(FeRS.Complex(Params), FeRS.Detailed(Params))}");

    string main = "FE / Case";
    string[] headers = ["QXX", "QYY", "MXX_TOP", "MXX_BOTTOM", "MYY_TOP", "MYY_BOTTOM"];
    WriteLine("Project: " + RobApp.Project.Name);
    WriteLine(main.PadRight(15) + string.Concat(headers.Select(h => h.PadLeft(15))));

    foreach (int FeNo in FEsNumbers) { FePrms.Element = FeNo;
        foreach (int CasNo in CaseNumbers) { FePrms.Case = CasNo;
            IRobotCase cas = Structure.Cases.Get(CasNo); if (symbols.Any(cas.Name.Contains)) continue;
            switch (cas.Type) {
                case IRobotCaseType.I_CT_SIMPLE:
                case IRobotCaseType.I_CT_COMBINATION:
                    if (cas.AnalizeType == IRobotCaseAnalizeType.I_CAT_DYNAMIC_SEISMIC)
                        FePrms.ModeCmb = IRobotModeCombinationType.I_MCT_CQC;
                    Print($"{FeNo} / {CasNo}", FePrms); break;
                case IRobotCaseType.I_CT_MOBILE: FePrms.Case = CasNo;
                    IRobotMobileCaseComponentMngr Components = ((IRobotMobileCase)cas).Components;
                    for (int k = 1; k <= Components.Count; k++) {
                        FePrms.CaseCmpnt = Components.Get(k).Point; Print($"{FeNo} / {CasNo} / {FePrms.CaseCmpnt}", FePrms);
                    }
                    break;
            }
        }
    }
}

see also Parse robot text lists into arrays of integers (offline) 

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes