Author Topic: Change size of selection frame for a Custom Shape (created using Shape script)  (Read 1189 times)

David Rains (bioform)

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
I have created a custom shape for a stereotype using a shape script, however the size of the "frame" when you click on the element is bigger than the shape. Is there a way to redefine that frame to be closer to the size of the displayed image.

Problem will be when multiple images are displayed on a diagram the selection "frames" will overlap resulting in an unpleasant experience  :o

Am I forgetting a setting within the script or a "_setting" as an attribute of the element?

Thanks,

David (Bioform) Rains - It is good to be back working in EA!  :D

qwerty

  • EA Guru
  • *****
  • Posts: 12741
  • Karma: +361/-295
  • I'm no guru at all
    • View Profile
No. There's a virtual 100x100 units rectangle where connectors attach. That's even true for the build-in use case oval.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2890
  • Karma: +52/-3
    • View Profile
It is as qwerty says. One of the commonest mistakes people make in writing shape scripts is if they want a 50x50 rectangle, they will say

Code: [Select]
rectangle(0,0,50,50);
but that just fills the top left corner of the selection rectangle. Instead they need to say

Code: [Select]
defsize(50,50);
rectangle(0,0,100,100);

which uses 100% of the selection rectangle.
The Sparx Team
support@sparxsystems.com

David Rains (bioform)

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Okay, so the stereotype package's frame is the exact same size as a default package, so it seems that the frame size is based on the "source" element type.
My only way to achieve my goal with a stereotype package, is to:
   fixedAspectRatio = "true";
   defsize(100,100);

Then after importing the MDG containing the stereotyped package with the shapescript (redrew the image maximizing screen 100 x 100), drag onto diagram (the drawn image is NOW the same size as the frame and manually grab a corner and reduce it's size... of course the font size becomes too small and moves UP... so I increase the FONT and I can live with the name displayed in the middle...

Thanks to KP and qwerty (read through the ShapeScript made Easy again!), Looking forward to checking out the updates on Scripting EA too!

I remember reading about a project/tool to create a point and click to define shape-script commands for shapes... any idea where that was and any status on that?

David 'Biofom' Rains - Dragging BA's into the ReqEng arena 1 project at a time :)
« Last Edit: August 08, 2019, 02:31:57 am by David Rains »