Hi,
I would like to export the results of efforts with VBA in excel files like in the video attached.
Can you help me ?
Solved! Go to Solution.
Solved by rsousa_. Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
@Anonymous_Adsk wrote:for selection of fes and nodes attached
Hi it doesn't work I think. Can we enter a list of nodes in a excel cell and have the results of the selection ?
No it works on nodes selection and FEs selection made in Robot
I tried to modify the macro to be able to enter the number of selection in cell(9.2) but it doesn't work.
My goal is not have to interact with the model.
Only pilot in excell :
Dim obj As RobotObjObject Dim FECollection As RobotFiniteElementCollection Dim FEs As String Dim NodesSel As String Dim NodeSelection As RobotSelection Dim NodeCollection As RobotNodeCollection Set RSelection = RobApp.Project.Structure.Selections.Create(I_OT_FINITE_ELEMENT) Set NodesSelection = RobApp.Project.Structure.Selections.Create(I_OT_NODE) RSelection.FromText "" NodesSelection.FromText " " For jj = 1 To PanelCol.Count Set obj = RobApp.Project.Structure.Objects.Get(PanelCol.Get(jj).Number) FEs = obj.FiniteElems NodeSel = obj.Nodes RSelection.AddText (FEs) NodesSelection.AddText (NodeSel) Next jj Set RSelection = RobApp.Project.Structure.Selections.Create(I_OT_FINITE_ELEMENT) If (OptionButton1.Value) Then Set RSelection = RobApp.Project.Structure.Selections.Get(I_OT_FINITE_ELEMENT) If (RSelection.Count = 0) Then MsgBox "FEs not selected", vbOKOnly, "ERROR" RobApp.Interactive = True Exit Sub End If End If If (OptionButton2.Value) Then Set NodesSelection = RobApp.Project.Structure.Selections.Get(I_OT_NODE) num_node = Cells(9, 2) If num_node <> "" Then NodesSelection.FromText num_node Set NodesSelection = RobApp.Project.Structure.Nodes.GetMany(NodesSelection) Else If (NodesSelection.Count = 0) Then MsgBox "Nodes not selected", vbOKOnly, "ERROR" RobApp.Interactive = True Set NodesSelection = Nothing Exit Sub End If End If End If Set FECollection = RobApp.Project.Structure.FiniteElems.GetMany(RSelection) Set NodeCollection = RobApp.Project.Structure.Nodes.GetMany(NodesSelection)
I just want to choose nodes and cases in excell.
Can you modify the macro for it ?
I don't know if i understand correctly what you want, but see if this can help you. You have to put your selection set only in excel... Test the sheet, because i had little time to program the exceptions...
Regards
Every time I get the same error "Select case(s), combinations(s) in robot.
What I have to do? I put case in B10 cell but still doesn0t work
hi @Rafal.Gaweda I say you macro "panel_res", but I do not get the same results as in ARSA. In particular in ARSA I get Max moment around 12 kNm/m while in your macro 8.2 kNm/m. Maybe through your macro I obtain different values. If yes, how can I get the value through macro of Maps-Detailed-Moment please?
Thanks Rafal
Hi @Anonymous
Macro gives you exactly the same values like in Robot
thanks @Rafal.Gaweda for replying,
How can I get the Moment Value 12.78 kNm/m that appears in the Result-Maps?
Because I did by hand the calculation and the result should be around that number.
@Rafal.Gaweda I kindly ask you if you could add here the strings to add that code.
Can you send me the link where is written the difference between the Fe complex value and the Fe principal value please?
Hi @Rafal.Gaweda could you please post here a screen or a video about to import results if I select: Load Case Code Combinations - Full automatic combinations, please?
Because I do not get results if I select that code combinations
Hi @Anonymous
This macro does not work for Code Combinations.
You have to add some code to it doing that.
Hi @Anonymous
Here you are
.... ElseIf (RCaseCol.Get(ii).Type = I_CT_CODE_COMBINATION) Then Dim CCount As Integer Dim CCa As RobotCodeCombination Set CCa = RCaseCol.Get(ii) CCount = CCa.Components.Count Dim StrCC As String StrCC = Str(CCount) If InStr(RCaseCol.Get(ii).Name, "+") <> 4 And InStr(RCaseCol.Get(ii).Name, "-") <> 4 And InStr(RCaseCol.Get(ii).Name, "+") <> 8 And InStr(RCaseCol.Get(ii).Name, "-") <> 8 Then FEparams.Case = CCa.Number For icomp = 1 To CCount row = row + 1 FEparams.CaseCmpnt = icomp If (OptionButton1.Value) Then Cells(row, 1) = Str(FEparams.Element) + " / " + Str(FEparams.Case) + " / " + Str(FEparams.CaseCmpnt) If (OptionButton2.Value) Then Cells(row, 1) = Str(FEparams.Node) + " / " + Str(FEparams.Case) + " / " + Str(FEparams.CaseCmpnt) If (OptionButton3.Value) Then Cells(row, 1) = Str(FEparams.Panel) + " / " + Str(FEparams.Node) + " / " + Str(FEparams.Case) + " / " + Str(FEparams.CaseCmpnt) Set FEresults = RobApp.Project.Structure.Results.FiniteElems.Detailed(FEparams) Cells(row, 2) = FEresults.QXX Cells(row, 3) = FEresults.QYY Set FEcomplex = RobApp.Project.Structure.Results.FiniteElems.Complex(FEparams) Cells(row, 4) = FEcomplex.MXX_TOP Cells(row, 5) = FEcomplex.MXX_BOTTOM Cells(row, 6) = FEcomplex.MYY_TOP Cells(row, 7) = FEcomplex.MYY_BOTTOM Next icomp End If ...
@Rafal.Gaweda the units are daNm/m? Because I'm getting confuse with this macro about the units! Can you specify them please?
Hi @Anonymous
SI units (N, m, Nm...).
All data set \ get \ stored in Robot by API should be in SI units. If you want different units you need to multiply results in code by your own.
@Rafal.Gaweda Does not matter if I have daNm/m in my Results-Maps?
Just to confirm: Membrane forces [N]
Moment [Nm/m]
Shear forces [N/m]
Correct?
Hi @Anonymous
All data set \ get \ stored in Robot by API should be \ is in SI units. If you want different units you need to multiply results in code by your own.
I would share with you my problem with your macro! It is awesome and I use it almost everyday!
I'm designing a classic pool, for Walls 7 and 9 everything is perfect but I get 0 values for the wall 8 and 10. Could you check the reason please?
Thanks
Hi @Anonymous
You need to adjust results direction settings.
It is defined
FEparams.SetDirX I_OLXDDT_CARTESIAN, 1, 0, 0
For walls along Y it should be
FEparams.SetDirX I_OLXDDT_CARTESIAN, 0, 1, 0
@Rafal.Gaweda I have changed the code
FEparams.SetDirX I_OLXDDT_CARTESIAN, 1, 0, 0
in
FEparams.SetDirX I_OLXDDT_CARTESIAN, 0, 1, 0
but I still get 0 values.
In any case, Do I have to change every time the code depending if I'm exporting values from X directions or Y directions?
Can't find what you're looking for? Ask the community or share your knowledge.