User manual

16
i.e. the local variable phi of angleSensor is present. The reason was that the search pattern
given was “*.phi”, i.e. any prefix to .phi. The pattern matching is performed from the top
level model so the path “axis1.angleSensor.phi” was found. It is possible to make the pattern
matching locally in certain classes only, by providing a (pattern for the) class name. In this
case the pattern for the name is just “phi”.
model Selection6
annotation (__Dymola_selections={
Selection(name="MySelection",
match={MatchVariable(className="Modelica.Mechanics.Rotational.Interfaces.Flange*",
name="phi", newName="%path%")})});
end Selection6;
The result is then:
Tags
Variables can be tagged using the tag annotation:
Real w annotation(__Dymola_tag={"Mechanical"});
Several tags can be associated with a variable:
Real w annotation(__Dymola_tag={"Mechanical","Rotational"});
If a tag is attached to a component, it is also attached to sub-components and variables.
Matching can then be made on tags as well.
Advanced Pattern Matching and Substitution
All matches must be exact, and only scalar variables are considered for the matching;
however, tags are inherited by sub-components.
The regular expression syntax is the same as in the Advanced plot dialog.
The name, description, and tag support leading “!” for selecting non-matches.
The newName can use %componentPath%, %name%, %path% and %i%. The %name%
corresponds to the part matching the regular expression and %componentPath%%name% is
the full path of the variable. The %1% is the part matching the first parenthesis-enclosed
part of the regular expression.