Book a Demo

Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
Automation Interface, Add-Ins and Tools / Re: Shape Scripts: Text in Subshapes
« Last post by Guillaume on January 28, 2026, 06:47:04 pm »
Hi Takeshi,

Thank you for the explanations  :)

To summarize, the parameters are:
1- Shape name
2- Width
3- Height
4- Relative value (horizontal to move left/right ?)
5- Relative value from the reference point (vertical to move up/down?)

Hopefully Sparx team will add clarifications and examples to cover these additional parameters in the user guide.
52
Automation Interface, Add-Ins and Tools / Re: Shape Scripts: Text in Subshapes
« Last post by Takeshi K on January 28, 2026, 10:24:45 am »
Hi Guillaume,

If I understand correctly, the third (3rd) and fourth (4th) parameters are relative position values.
But it is tricky to determine actual position to draw a subshape.

The important point is that the calculation of the reference point used for relative values is a bit cumbersome.

In this case, the layouttype is default, this is may be 'TopDown'. In the 'TopDown' type, the 3rd parameter is simple, just relative value from 0. If the 3rd value is -50, the subshape will be drawn 50 point left from the rectangle by the drawnativeshape command. After adding a subshape the reference point will be moved to lower (in the 'TopDown' type). In this case, the second parameter (height) is 50, so the reference point will be 50 (0+50). The Y position for the next subshape will be calculated from 50.

We can understand this behaviour by trying the following script. (and change 4th parameter of the second addsubshape)

addsubshape("test", 50, 50, -50, -50); //1
addsubshape("test", 50, 50, -50,  0); //2

Before the first addsubshape, the reference point is (0, 0), this is default.
By the first addsubshape, the reference point will be (0, 50) because the height (the 2nd parameter of the first addsubshape) is 50.
So, the second addsubshape will be drawn from (-50, 50) - in the 'TopDown' type, the 3rd parameter is just relative point from 0, the 4th parameter is calculated from the current reference point - 50 (the 2nd parameter of the first addsubshape) + 0 (the 4th parameter of the second addsubshape)

It is similar when the layouttype is LeftRight, the X position is relative.

This seems very tricky, but because of this behaviour, we can draw subshapes nicely without 3rd and 4th parameters (addsubshape of 2 parameters is commonly used).

HTH,



53
Automation Interface, Add-Ins and Tools / Re: Shape Scripts: Text in Subshapes
« Last post by Guillaume on January 28, 2026, 02:08:48 am »
I just came across a similar issue.
Using a subshape to display the text is great but I can't find the parameters definition for "addsubshape" matching this signature: addsubshape("test", 50, 50, -50, -50);
I'm struggling moving the text to the right location by changing the 4 values (top? width ? ...)

The information I found from the user guide is addsubshape(string shapename(int width, int height))
54
Thanks for the hint...I don't have access, but I will see if I can talk to our dev team, who does have that permission.
55
OK...after some googling, the values I have listed above match what is in the "t_connectortypes" table.

Can anyone tell me exactly how that is populated? If I create a local model, it has the full list, compared to the cut down list on our shared repo model.

TIA...Eric

I did notice at a few clients that they had incomplete setup data in their tables.
I don't have an idea how or why this happened, but I fixed it by running the relevant parts of the initial data scripts: https://sparxsystems.com/resources/repositories/

Geert
56
Thanks Paolo for the suggestion.

We do use MDG, but I had loaded it in my local model, just to be sure (the MDG tech we have set up adds search views and custom tags). It did not change the dropdown on t_connectortypes.

Eric
57
OK... after some googling, the values I listed above match those in the "t_connectortypes" table.

Can anyone tell me exactly how that is populated? If I create a local model, it has the full list, whereas the cut-down list is in our shared repo model.

TIA...Eric
Are both repositories using the same MDG?  If NOT, that’s your likely cause.  In recent versions, EA has become adept at providing restricted views to help new users avoid being overwhelmed by so many choices.  The downside is that if you’re unaware you’re in a restricted view, it can be confusing. I’ve been caught by that many times.

Hopefully, that’s your answer.
Paolo
58
I am relatively certain that I did with an earlier version of Sparx EA, many years ago, when features did not change, and you knew what you were doing or what you needed to do.  Please accept my apologies for the slight rant.

I know if it’s guesswork, but XML has become guesswork; there aren’t many XSD’s published.

I also know there are many tools out there, but they tend to cost money, and if they are online, there is always a data privacy/sensitivity issue.
Hi Modesto,
As Geert implies, reverse engineering an XSD from an XML is ais an almost pointless exercise.  Even tools like XMLSpy (which I love) can only infer one (of many - as Geert says) XSDs that will validate that particular XML and some nominal variants.  If the intent (as it should be) is to validate a set of incoming (or outgoing) XMLs, then you’ve (as you suggested) “bought a plug nickel”.  If you know what the validation rules are (or should be, or even would like to be), then you should be creating XSDs and check the XMLs against them.

I mourn the passing of XSDs (as I suspect you do), but in the era of “post truth” and “Vibe Coding”, it IS about guesswork.  “I’m sending you some informationin this XML, but you need to decide if it’s misinformation or disinformation!  That’s not my job!”

Paolo
59
OK...after some googling, the values I have listed above match what is in the "t_connectortypes" table.

Can anyone tell me exactly how that is populated? If I create a local model, it has the full list, compared to the cut down list on our shared repo model.

TIA...Eric
60
I am relatively certain that I have done with an earlier version of Sparx EA, many years ago when features did not change and you knew what you were doing or what you needed to do. Please accept my apologies for the slight rant.

I know if guess work but XML has become guess work, there aren't many XSD's published.

I also know there are many tools out there but they tend to cost money and if they are online there is always a data privacy/sensitivity issue.
Pages: 1 ... 4 5 [6] 7 8 ... 10