Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: George on May 10, 2025, 06:55:40 am

Title: Incorrect orientation of provided/required interface positioned horizontally
Post by: George on May 10, 2025, 06:55:40 am
Hi all,
I think that I found a bug in EA automation when placing ProvidedInterface or RequiredInterface elements in a component diagram via EA automation.
Following are fragments of test script that demonstrates this issue.
Code: [Select]

// Sizes and positions
var COMP_X = 300, COMP_Y = 100, COMP_W = 200, COMP_H = 100; // Component rectangle
var IF_LEN = 40, IF_THICK = 13, IF_OFFSET = 1; // Real size of the i/f lollipop is 40x13 px and 1 px into the component
...

Session.Output("TopInterface expected: l=" + IF_TOP_X + ";t =" + IF_TOP_Y + "; r=" + (IF_TOP_X + IF_THICK) + "; b=" + (IF_TOP_Y + IF_LEN));
Session.Output("TopInterface actual:   l=" + diaIfTop.left + "; t=" + diaIfTop.top + "; r=" + diaIfTop.right + "; b=" + diaIfTop.bottom);
...

Session.Output("LeftInterface expected: l=" + IF_LEFT_X + "; t=" + IF_LEFT_Y + "; r=" + (IF_LEFT_X + IF_LEN) + "; b=" + (IF_LEFT_Y + IF_THICK));
Session.Output("LeftInterface actual:   l=" + diaIfLeft.left + "; t=" + diaIfLeft.top + "; r=" + diaIfLeft.right + "; b=" + diaIfLeft.bottom);
Logged results:
Code: [Select]

[653159378]      Component position: l=300; t=-100; r=500; b=-200
[653159387]      TopInterface expected: l=380;t =61; r=393; b=101
[653159390]      TopInterface actual:   l=380; t=-61; r=393; b=-101
[653159400]      LeftInterface expected: l=261; t=150; r=301; b=163
[653159403]      LeftInterface actual:   l=261; t=-150; r=274; b=-190
Does anyone have the same experience?
Rgds
Jiri