Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: rty on November 13, 2020, 06:07:54 pm

Title: Modify minimal height of UML model elements?
Post by: rty 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?
Title: Re: Modify minimal height of UML model elements?
Post by: qwerty 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.
Title: Re: Modify minimal height of UML model elements?
Post by: Paolo F Cantoni 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
Title: Re: Modify minimal height of UML model elements?
Post by: rty 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 (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

Title: Re: Modify minimal height of UML model elements?
Post by: Geert Bellekens 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
Title: Re: Modify minimal height of UML model elements?
Post by: rty 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:
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. :'(
Title: Re: Modify minimal height of UML model elements?
Post by: Geert Bellekens 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 (https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/drawing_methods.html) for more info

Geert
Title: Re: Modify minimal height of UML model elements?
Post by: rty on November 19, 2020, 03:13:24 am
Thanks, that's it.