max_elements = 0
max_comp_name = str()
for comp_name in mw.components():
num_elements = len(mw.component_elements(comp_name))
if num_elements > max_elements:
max_elements = num_elements
max_comp_name = comp_name
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
When you have a lot of components, it should be faster to iterate over all elements once and accumulate the number for each component using mw.element_component(element_id).