Jump to content

List of element names in Element Group


---
 Share

Recommended Posts

Hello, 

I would like to access a list of names of the elements in an Element Group, but it doesn't seem like there is a Element Value in neither the Geometry-tab or Information-tab, that corresponds to that. 

Maybe I am overlooking something? 

Thank you, 

Best regards,
Emil. 

Link to comment
Share on other sites

This should get you a list of just the names of the elements in the group.

names = [elem.name for elem in gom.app.project.inspection['Your_Group_Name'].creation_sequence_args['elements']]

 

Link to comment
Share on other sites

A token (but not officially offered right now) is  'group_element_list_draft' to get a list of group members.

print (gom.app.project.inspection['your_group_name'].group_element_list_draft)

Shain's tip is based on the creation of the element group which normally should also work, but if the creation command differs you can try the mention token (as you can see it's still a 'draft' version)

Link to comment
Share on other sites

  • 5 weeks later...

Ended with solution: 

try: 
  elements = elementGroup.group_element_list_draft
  for i, element in enumerate(elements): 
    ## Access element
except: 
  pass 

Thank you. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...