Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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) Get groups through API

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
shulwh
305 Views, 2 Replies

(API) Get groups through API

Hi everyone

I set some member groups in RSA manually.  

And then, I want to get one of these groups through the following API, but it needs the index of the group. How should get the index?

shulwh_2-1659253888246.png

 

shulwh_0-1659253856796.png

 

Tags (3)
Labels (3)
2 REPLIES 2
Message 2 of 3

hi @shulwh 

Sub ListGroupBars()
  Dim RobApp As IRobotApplication, RGroups As RobotGroupServer
  Set RobApp = New RobotApplication
  Set RGroups = RobApp.Project.Structure.Groups
  
  Dim Group As RobotGroup, GroupCnt As Integer, ObjTyp As IRobotObjectType
  ObjTyp = IRobotObjectType.I_OT_BAR
  GroupCnt = RGroups.GetCount(ObjTyp)
  If GroupCnt <> 0 Then
    For j = 1 To GroupCnt
      Set Group = RGroups.Get(ObjTyp, j)
      Debug.Print j, Group.Name, Group.SelList, Group.Color
    Next j
  End If
  Set RobApp = Nothing
End Sub

Best Regards

Tags (3)
Message 3 of 3

Thank you for your quick reply, it's quite convenient!

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

Post to forums  

Autodesk Design & Make Report