hi @rbaXBU6W
Add this function to search the group list of bars by its name :
Function GetListByGroup(RobApp As IRobotApplication, GroupName As String) As String
Dim GroupBars As RobotGroup
Dim RGroups As RobotGroupServer: Set RGroups = RobApp.Project.Structure.Groups
Dim BarType As IRobotObjectType: BarType = IRobotObjectType.I_OT_BAR
Dim GroupBarsCnt As Integer: GroupBarsCnt = RGroups.GetCount(BarType)
For i = 1 To GroupBarsCnt
Set GroupBars = RGroups.Get(BarType, i)
If GroupBars.name = GroupName Then
GetListByGroup = GroupBars.SelList: Exit Function
End If
Next i
GetListByGroup = ""
End Function
Modify previous code as follow:
Sub Apply_UniformLoad_To_Bars_List()
(...)
' Rec.Objects.FromText "1 2 3 4" < Previous Line
Dim GroupName As String
GroupName = "Rafter"
Rec.Objects.FromText GetListByGroup(RobApp, GroupName)
(...)
End Sub
Result:

Best regards
See also https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-apply-load-to-a-chain-of-ba...
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 !
