Book a Demo

Author Topic: Shape Script Connector  (Read 4325 times)

Ben74

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Shape Script Connector
« on: March 08, 2021, 07:30:03 pm »
I do not know if this a bug, but it is an issue (for me then).

If I "shape script" a connector. All comes out right. The (0,0) position is where the shape hits the Element.

Question:
Why does it draw the line "through" the shape? Even though the shape is "fillandstrokepath()"? If a draw a circle the connector line has to start "outside" the shape? I had to moveTo (in main shape) to get the line outside the shape, but then it leaves a gap. When the Element is further away from the other Element then gap will get wider?

I will put my shape script below (Source->Target):
[Modified]
Code: [Select]
// Connector Example
shape main
{
// draw a line
noshadow=true;
setlinestyle("SOLID");
moveto(0,0); //compensation for line going thhrough the shape
lineto(100,0); //compensation for line going through shape
}

shape source
{
        rotatable = true;
startpath();
Polygon(0,0,4,6,90);
        endpath();
fillandstrokepath();
}

shape target
{
rotatable = true;
startpath();
Polygon(0,0,3,9,180);
        endpath();
fillandstrokepath();
}

« Last Edit: March 08, 2021, 08:00:29 pm by Ben74 »

Ben74

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Shape Script Connector
« Reply #1 on: March 08, 2021, 07:57:54 pm »

Ben74

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Shape Script Connector
« Reply #2 on: March 08, 2021, 08:11:21 pm »
After a lucky search I got a post from Geert. I was using the Association and changed it to Dependency and now this problem is solved.

https://www.sparxsystems.com/forums/smf/index.php?topic=42332.0

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape Script Connector
« Reply #3 on: March 08, 2021, 08:25:11 pm »
I think you need to use endPointY and endPointX in your target shape.

Here's an example from BPMN

https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/blob/master/BPMN2.0/DataInputAssociation.shapeScript

Geert