MATLAB: Simbiology – Copying “quantities used by this rule”

SimBiology

Hi everyone,
I'm currently working on a script to move a reaction with all related rules and parameters between two models of the same system but with different reaction kinetics. For the "root" parameters and related rules it was easy enough to use strcat, strcmp, and find to locate the index and then copyobj to move it between models. However, some of the rules are complex and involve many other parameters.
In the GUI, these show up at the bottom of the rule as "Quantities used by this rule." However, I can't find a convenient way to select for them in the script. I've started on a solution which parses the rule expression and then compares it to a list of names extracted from the various model objects and then copying the identified parameters, but I don't have much experience with that kind of programming and it's going slow and I suspect clunky and prone to mistakes I don't even know about yet. Before I put my time into fixing it I thought I'd ask if anyone can suggest a better way.
tl;dr – Given a rule index, I want to select/find index of "quantities used by this rule" and then copy those objects to a different model.
Thanks for reading and thinking about it. Double thanks for any suggestions.
-Adam

Best Answer

Unfortunately, SimBiology does not have a publicly documented way to access the quantities used by a rule from a MATLAB function. I will contact you directly to see if we can develop a suitable workaround.