Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API/VBA select Bars within Storeys and retrieve Fx max

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
WALIDGIO
382 Views, 6 Replies

API/VBA select Bars within Storeys and retrieve Fx max

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

  1. Iterate over each storey.
  2. Select all bars within the current storey. ( if possible only columns)
  3. Get all combination 
  4. Find the maximum FX value for each bar with the corresponding Combination within the storey. 
  5. Write the results to the worksheet.

to result in the end with a table like this : I'm  attaching Excel to what i arrived so far thank you.

StoreyBar LabelFX Max (kN)Bar MemberBar NodeBar Case
Level 0CC 35x35824193237
Level 1CC 35x358152151147
Level 2CC 35x357512402775
Level 3CC 30x3061128735516
Tags (5)
Labels (1)
6 REPLIES 6
Message 2 of 7

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

Message 3 of 7

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 :

https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-find-storey-that-a-element-...

 

 

Best Regards

Tags (2)
Message 4 of 7

hi @WALIDGIO 

you should read this topic

https://forums.autodesk.com/t5/robot-structural-analysis-forum/getting-internal-forces-from-rsa-to-x...

 

If one or more questions have been resolved, for the benefit of the community, it is recommended to approve the solutions.

Best Regards

Message 5 of 7

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 (12) and useful addins already developed and the app store.

Best Regards

Tags (1)
Message 6 of 7
WALIDGIO
in reply to: WALIDGIO

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.

Message 7 of 7

see also :

BarName = BarObject.GetLabelName(I_LT_BAR_SECTION)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report