Hello,
I want to create a VBA Macro to find and list the maximum axial force (FX) for each bar in each storey of a building, along with the relevant load case details.
what I'm struggling with is to select bars by storey and then fitch for each bar the maximum Fx value with the corresponding Combination number, Also I'm struggling to output the Bar Label (section) not the name this is the step I'm following
to result in the end with a table like this : I'm attaching Excel to what i arrived so far thank you.
Storey | Bar Label | FX Max (kN) | Bar Member | Bar Node | Bar Case |
Level 0 | CC 35x35 | 824 | 193 | 23 | 7 |
Level 1 | CC 35x35 | 815 | 215 | 114 | 7 |
Level 2 | CC 35x35 | 751 | 240 | 277 | 5 |
Level 3 | CC 30x30 | 611 | 287 | 355 | 16 |
Solved! Go to Solution.
Solved by Stephane.kapetanovic. Go to Solution.
Solved by Stephane.kapetanovic. Go to Solution.
Hi community,
I understand that there may be questions within the community regarding specific developments. Suggestions provided here are in the spirit of collaboration and are generally focused on promoting the use of Robot software and its API. It is important to note that the solutions provided here may not be specific to complex individual cases.
Best Regards
hi @WALIDGIO
you'll find below a code to search for the bars on each floor. For the lists to be initialized, the model must be consolidated.
Public Sub FindStoreyBarList()
Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
Dim Storeys As RobotStoreyMngr, Storey As RobotStorey, Selection As RobotSelection
With RobApp.Project.Structure
Set Selection = .Selections.Create(I_OT_BAR)
Set Storeys = .Storeys
End With
For i = 1 To Storeys.Count
Set Storey = Storeys.Get(i)
Selection.FromText Storey.Objects
For j = 1 To Selection.Count
BarNumber = Selection.Get(j)
'[...]
Next j
Next i
Set RobApp = Nothing
End Sub
See also :
Best Regards
hi @WALIDGIO
you should read this topic
If one or more questions have been resolved, for the benefit of the community, it is recommended to approve the solutions.
Best Regards
hi @WALIDGIO
you can get help through the approved solutions on the forum, for example by searching for API.
Different languages exist such as C#, Python and VB, you will be able to adapt your code to your use.
Note that you also have files and example delivered with the SDK located in the installation subdirectory ...\SDK.
You can also find information such as the API tutorial, videos (1, 2) and useful addins already developed and the app store.
Best Regards
thank you stephane i used your code and adapted it in mine it worked perfectly, thank you so much
I also was wondering how to extract bar section to output it in excel i found the solution I'll put here if anyone will find it helpful in the future
BarName = BarObject.GetLabel(I_LT_BAR_SECTION).Name
Thanks.
Can't find what you're looking for? Ask the community or share your knowledge.