Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: Paolo F Cantoni on January 16, 2019, 12:33:54 pm

Title: Certain line styles do not honour the shapescript code
Post by: Paolo F Cantoni on January 16, 2019, 12:33:54 pm
We are investigating presentation style diagrams (to hopefully, reduce the need for diagrams from presentation software).

We are looking at creating very wide lines (for example Width 25).  We are able to force the value via the DB - so OK.  However, this leaves a rounded end which overlays the origin and destination vertices (as in the incorrect diagram below).  No problem, we can change the Shapescript to reduce the length of the drawn line by the requisite amount.
Code: [Select]
Shape main
{
noshadow = true;
setlinestyle("SOLID");
setpenwidth(getUserPenSize());
setpencolor(0,255,0);
moveto(9,0);
lineto(91,0);
}
For this particulare example, we reduced the visible line by 9 pixels.  To produce the acceptable line shown in the first diagram.  We can then overlay shapes at either end to achieve our desired result.  We tried with direct and custom line styles and "all good".

(https://imgur.com/lGqGAZR.png)

Imagine our surprise when we tried the other line styles and found they DON'T honour the Shapescript code.

(https://i.imgur.com/Gi89HSg.png)

Reported,
Paolo
Title: Re: Certain line styles do not honour the shapescript code
Post by: matthew.james on January 16, 2019, 01:51:02 pm
@Paolo - I can't help with your problem below (sorry), however I am interested in understanding what you are trying to achieve with presentation style diagrams.

I gather from the issue below that you are looking for a different (simplified) style and perhaps simplified types of diagrams ?
Do you have any examples of the sorts of diagrams you are trying to create?
Title: Re: Certain line styles do not honour the shapescript code
Post by: Eve on January 16, 2019, 02:11:46 pm
The "main" shape script corresponds to the "center" segment of any connector.

The other segments are drawn by EA using a style derived from your shape script.

BTW. You didn't reduce the visible line by 9 pixels. You reduced it by 9% of the total length at each end. Even if the script magically knew how to draw your script around a bend it still wouldn't behave like you hoped.
Title: Re: Certain line styles do not honour the shapescript code
Post by: Paolo F Cantoni on January 16, 2019, 05:04:08 pm
The "main" shape script corresponds to the "center" segment of any connector.

The other segments are drawn by EA using a style derived from your shape script.

BTW. You didn't reduce the visible line by 9 pixels. You reduced it by 9% of the total length at each end. Even if the script magically knew how to draw your script around a bend it still wouldn't behave as you hoped.
Ah yes,... The old "Centre section" problem.

Accepting that "this is the way it is"  :P,  I'll stick to the two working types.

I get confused by the values, sometimes they're pixels and sometimes they're not.

I think I can get it working for the two line styles I have.  I'll check for varying the length of the line.

Paolo
Title: Re: Certain line styles do not honour the shapescript code
Post by: Paolo F Cantoni on January 25, 2019, 05:48:51 pm
@Paolo - I can't help with your problem below (sorry), however, I am interested in understanding what you are trying to achieve with presentation style diagrams.

I gather from the issue below that you are looking for a different (simplified) style and perhaps simplified types of diagrams?
Do you have any examples of the sorts of diagrams you are trying to create?
Hi Matthew,
See: Presentation Models and Diagrams (https://www.sparxsystems.com/forums/smf/index.php/topic,42178.new.html#new)

Paolo