Book a Demo

Author Topic: Modify minimal height of UML model elements?  (Read 4333 times)

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Modify minimal height of UML model elements?
« on: November 13, 2020, 06:07:54 pm »
Hi all,

The visualization of UML model elements respects minimal width and height of the displayed element's bounding box.

However, the minimal height of a component is imho too high which wastes a lot of space in diagrams. The height of the component box twice the height of the component icon. Looks inappropriate.

How can I modify the element's minimal height or switch off the min width/height check in general?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Modify minimal height of UML model elements?
« Reply #1 on: November 13, 2020, 06:55:28 pm »
For stereotyped elements of your MDG you can use shape script. For anything else you need a Template Package.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modify minimal height of UML model elements?
« Reply #2 on: November 13, 2020, 07:47:19 pm »
For stereotyped elements of your MDG, you can use shape script. For anything else, you need a Template Package.

q.
You can also use the cx and cy value of the stereotype in the MDG.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Re: Modify minimal height of UML model elements?
« Reply #3 on: November 16, 2020, 08:15:52 pm »
I had a look at the shape script guide (https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/usingtheshapescript.html) but was not able to find a shape attribute which defines the minimal height/width. Could you help me out?

Guessing

Code: [Select]
shape main {
cy = "120";
}

didn't work out as hoped:
Error parsing ShapeScript: There was an error parsing  on line 2. Unexpected symbol: cy


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Modify minimal height of UML model elements?
« Reply #4 on: November 16, 2020, 08:20:15 pm »
In the shapescripts you can set the defsize like this

Code: [Select]
defsize(50,50);
cy and cx are properties of the actual stereotype. Right click on the stereotype element and edit with profile helper.

Geert

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Re: Modify minimal height of UML model elements?
« Reply #5 on: November 16, 2020, 09:30:35 pm »
Terribly sorry to bother, but that didn't help.

Feeling like a bloody noob, I was desperatedly searching for a HOWTO, even for setting up a Template Package so that also non-stereotyped elements wouldn't waste the height, but did not find any.

Here's what I did:
  • Open UML Types dialogue (Ribbon Configure → Reference Date → UML Types).
  • Select steretyped element from list.
  • Select 'Shape Script' in 'Override Appearance' frame, select 'Edit'.
  • Tried various script fragments (e.g. shape main { defsize(50,50); }).
But this is apparently not what I was suggested to do since it generates either errors or prevents my component from being rendered at all. :'(

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Modify minimal height of UML model elements?
« Reply #6 on: November 16, 2020, 10:13:43 pm »
The thing with shapescripts is that they completely take over the rendering.

So if you put
Code: [Select]
shape main { defsize(50,50); } you are not drawing anything at all, you are only saying what the default size it.

What you could try is to add
Code: [Select]
drawnativeshape(); or
Code: [Select]
drawparentshape();
See https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/drawing_methods.html for more info

Geert

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Re: Modify minimal height of UML model elements?
« Reply #7 on: November 19, 2020, 03:13:24 am »
Thanks, that's it.