Problem Description:
How to get all entities in a certain group using OpenSTAAD function (VBA and python)
Solution:
You need to use function GetGroupEntities along with function GetGroupEntityCount
Parameter for function GetGroupEntityCount:
[Input] GroupName: Group string name
[Return Value] GroupEntityCount: The total number of entities in specified group
Parameter for function GetGroupEntities:
[Output] EntityList: Entity number ID(s)
Sample VBA Syntax:
Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD") Dim GroupEntityCount As Long Dim GroupName As String Dim EntityList() As Long
GroupName = "_COLUMN1"
GroupEntityCount = objOpenStaad.Geometry.GetGroupEntityCount(GroupName)
ReDim EntityList(GroupEntityCount - 1) objOpenStaad.Geometry.GetGroupEntities GroupName, EntityList
Sample python script:
https://communities.bentley.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-54/GetGroupEntities.py
Output: