Dear Colleagues,
I am trying to figure out how to programmatically set, with Mathematica, the rotationType
parameter in a Modelica.Mechanics.MultiBody.Parts.FixedRotation
.
This is a snippet of my code where topMdlName
is the name of the model, tNames4Modelica
is a list of names of FixedRotation
transforms in the model, and tCnt
is the number of transforms.
Map[
SetSystemModel[topMdlName, <|"ParameterValues" -> {StringJoin[tNames4Modelica[[#]],
".rotationType"] ->"Modelica.Mechanics.MultiBody.Types.RotationTypes.PlanarRotationSequence"}|>] &,Range[tCnt]];
The function, obviously, writes strings to the model and the Simulation Center stops on an error that asserts that the value of the parameter is a string and not the expected enumeration.
I know that the value of the rotationType parameter is a Modelica enumeration as explained in the documentation
type RotationTypes = enumeration(RotationAxis "Rotating frame\_a around an angle with a fixed axis", TwoAxesVectors "Resolve two vectors of frame\_b in frame\_a", PlanarRotationSequence "Planar rotation sequence") "Enumeration defining in which way the fixed orientation of frame\_b with respect to frame_a is specified" annotation(Documentation(Evaluate = true, info = "<html>
but I cannot find a way to set it in Mathematica.
I have read the SetSystemModel
help pages and searched the interwebs to no avail. So I am writing to ask for help either for a pointer to documentation or a workaround.
Thank you.
Bogdan