Reputation: 119
We recently upgraded enterprise architect to version 12 and when I open up our diagram, all names wrap now to the width of the element. Before it would write the server name in one line under the element even if the name was longer than the element itself, but now they wrap to the width of the element.
How can I make it show the name of the element in one line instead of wrapping?
Edit: This seems to be a problem if we have dashes in the name. If I change the dashes to underscores, it doesn't wrap. But we really need dashes in the names.
Edit #2: Here is a screen shot of my issue. One on the left has a dash and wraps, one on the right has underscore and doesn't wrap. Everything else is the same.
Upvotes: 0
Views: 261
Reputation: 36295
You need to open Features and Properties/Feature...
There you switch this for individual elements. To do that globally you would need to script this:
dia = Repository.GetDiagram... # get the diagram itself
for do in dia.DiagramObjects {
do.ElementDisplayMode = 1 # longest, or 3: truncate (2 = wrap)
do.Update()
}
Edit: Applies only to features of a class and not its name. EA wraps names (if the rectangle is too small) at dashes and spaces (eventually a few more chars?). And this can not be altered. You might script it the following way:
dia = repository.GetDiagram.... # load the diagram
for do in dia.diagramObjects {
e = repository.getElementById(do.ElementId)
width = stringBitWidth(e.Name) # calc width of text in screen pixels; use your phantasy
currWidth = do.right - do.left
extend = (width - currWidth) / 2
do.Left -= extend
do.Right += extend
do.Update()
}
Upvotes: 1