cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
17 stars 21 forks source link

Obtaining index of current element #928

Open Moop204 opened 3 years ago

Moop204 commented 3 years ago

Is there an easier method of finding a specific unnamed element like Reset in a model than iterating through all resets? Named elements have .name() to get a key to search with but indexed elements don't have an equivalent .index().

hsorby commented 3 years ago

Are you asking to find a Reset based on order? So you are asking for the Reset with order 30 in a component?

Moop204 commented 3 years ago

I would like to find Reset using any key available to the Reset class. I am under the impression a component was able to have multiple Resets with the same order value as long as the variable was different so you cannot purely rely on order().