king
Dec 5 2007, 05:16 AM
Hi,
In a model, I want to have a STRING parameter for which i should be able to choose an option from the drop-down list box. the options may be "pipe" & "hose".
(pipe & hose are just STRINGS and no record is associated with them)
Based on the selection of "pipe" or "hose" for that parameter, I have to use the equations ( i may use when statement)
how to do this?
wagner
Dec 10 2007, 08:08 AM
Hello king,
are you using Dymola? I think there's an example in the Dymola 6 Addition-Manual on how to use drop-down-lists in the parameter dialog.
Regards
Florian
Roland
Jan 3 2008, 03:48 PM
Hello king,
what you can write is:
parameter String modelType = "pipe"
annotation(
choices(
choice(modelType = "pipe" "pipe"),
choice(modelType = "hose" "hose")));
The first string in the choices is the value, modelType will have, the second string is the text displayed in the drop down box.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.