Book a Demo

Author Topic: Embedded element shape script  (Read 3620 times)

bacz

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Embedded element shape script
« on: June 02, 2018, 10:40:38 am »
Hey Sparkies,
I have a bit of  a problem that despite researching the internet have not been able to resolve.
I am using MDG Shapescript to modify an embedded element - port.
I want to keep the shape, but simply move it to the edge of element I have built.

The edge of the element, as you would expect from a port, is not on the edge, but in the centre. I want the port square symbol to rest ON the edge, not be off set by -10 of whatever so the edge is in the centre of the port.

I have tried using bottomAnchorOffSet, left, right etc but no effect. Can anyone advise?
Thanks


shape main{
   noshadow = "true";
   bottomAnchorOffset= (0,0);
    rectangle(0,0,100,100);
   
   if (HasTag("Status","Future")) {
         setfillcolor(0,255,0);
    }
   if (HasTag("Status","ToGo")) {
         setfillcolor(255,0,0);
    }
   fillandstrokepath();
   
}

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Embedded element shape script
« Reply #1 on: June 02, 2018, 10:05:17 pm »
Not sure if you can offset a port (but why not?). You should try the attribute parentedge which delivers “right”, “left”, “top” or “bottom” so you can calculate the needed offsets.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Embedded element shape script
« Reply #2 on: June 04, 2018, 09:25:02 am »
If you want it external, try extending ProvidedInterface instead.

If you don't change the metatype, you'd have to check parentedge, and offset your drawing by 50%.