Patrik,
This is awesome!
My only suggested change is to make the replaceable record its own model because in many applications the parameter sets will be used in vastly different models. Having the set as part of a larger model is cumbersome and restricts changes. For example, in your spring mass example, lets say I wanted to add another mass but still use the same parameter sets. This would not be possible. I modified your example to make it possible to use the sets in various models:
Here is the base class replaceable record (NewReplaceableSetClass):
Patrick's model looks the same:
But now it is duplicatable and editable:
To do this you only need one line from Patrik's example in the newReplaceableSetClass:
replaceable ParameterSetsRedeclare.Records.Set1 set annotation(choices(choice(redeclare ParameterSetsRedeclare.Records.Set1 set "Set 1"), choice(redeclare ParameterSetsRedeclare.Records.Set2 set "Set 2"), choice(redeclare ParameterSetsRedeclare.Records.Set2Alt set "Set 2 alternative")), Placement(visible = true, transformation(origin = {-124.703, 81.48}, extent = {{-13.52, -13.52}, {13.52, 13.52}}, rotation = 0)));
and you need to add only one line to the models in which you use the replaceable set: (Note I added the icon AFTER my parameter set so the model will replace the parameter icon with the example icon -- makes things look nicer)
extends ParameterSetsRedeclare.BaseClasses.NewReplaceableSetClass(redeclare ParameterSetsRedeclare.Records.Set2 set);
extends Modelica.Icons.Example;
I have attached Patrik's file with these small edits.
Attachments: