Author Topic: Shape script for Composite element  (Read 13789 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Shape script for Composite element
« on: December 07, 2011, 07:01:39 pm »
Hi there!


I'm working on an MDG Technology for a client, where I need to create a shape script for an element type which is normally created as a composite.

If it isn't considered proprietary material, does anyone have a script snippet to draw the composite "link" symbol?

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Shape script for Composite element
« Reply #1 on: December 07, 2011, 09:40:48 pm »
One of the Sparxians posted it here. You have to search for it (good luck).

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Shape script for Composite element
« Reply #2 on: December 12, 2011, 09:19:06 am »
Try something like this:

Code: [Select]
decoration composite
{
      orientation="SE";
      if(hasproperty("iscomposite","true"))
      {
            ellipse(0,40,40,60);
            ellipse(60,40,100,60);
            moveto(30,50);
            lineto(70,50);
      }
}
The Sparx Team
[email protected]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Shape script for Composite element
« Reply #3 on: December 12, 2011, 09:58:06 pm »
That was the sort of automatic search I hoped for :-)

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1374
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Shape script for Composite element
« Reply #4 on: January 20, 2022, 05:53:04 pm »
Hi,

I had to do the similar update with a stereotyped use case and the above shapescript is not suitable so I ended up writing the following:

Code: [Select]
decoration composite
{
    orientation="SE";
    ellipse(-110,-30,-53,5); //left,top,right,bottom
    ellipse(-23,-30,39,5);
    moveto(-53,-15);
    lineto(-23,-15);
}
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com