Sparx Systems Forum
Enterprise Architect => General Board => Topic started 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?
-
For stereotyped elements of your MDG you can use shape script. For anything else you need a Template Package.
q.
-
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
-
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
shape main {
cy = "120";
}
didn't work out as hoped:
Error parsing ShapeScript: There was an error parsing on line 2. Unexpected symbol: cy
-
In the shapescripts you can set the defsize like this
defsize(50,50);
cy and cx are properties of the actual stereotype. Right click on the stereotype element and edit with profile helper.
Geert
-
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. :'(
-
The thing with shapescripts is that they completely take over the rendering.
So if you put 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 drawnativeshape(); or 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
-
Thanks, that's it.