kotchwane
kotchwane

Reputation: 2404

Display component name on two lines in Dymola

I would like the name of a custom component in Dymola to be displayed on two lines.

When I use %name or %paramName (where paramName is the name of a String parameter of the component) in the TextBox, the name gets written on one line, even when there is space for two, and even when i try to use any of the following: \n, <br>, \\n...

So the only solution I found so far was to create two parameters, nameLine1 and nameLine2, and to use them inside the TextBox, where I can put each parameter on a different line easily by using S+RET.

Yet I find this solution quite cumbersome. Is there any way to do it more easily?

                                                           Dymola component with a name on two lines

Upvotes: 3

Views: 154

Answers (1)

marco
marco

Reputation: 6645

No, I think not. That's a very general problem Dymola/Modelica has with text boxes in the graphical layer. There is no auto-wrap.

You have two options (unless you go for your multi-parameter-solution). Make sure that there is not font size set (which is the default), then:

  • Use text box with non-zero width. Dymola will try truncate the text (but it's not very good at it)
  • Use a text box with zero width. Dymola will automatically adjust the width to the content.

Oh, there is a third, maybe not so bad option: Don't use so long names.

Upvotes: 2

Related Questions