Hello Tonny,
it is difficult to give you the right advice what is going wrong. What do you mean with 'hasn't shown'? Do you see nothing? Or other shape is shown? As first step I would use the integrated debugging functionality to trace the Path.Begin() and Path.AddLine() invocations. For this purpose adapt the code as shown below:
[...]
if ( x == 0.0 )
{
Path.Begin( 0, 20, 350 );
trace "Execute: Begin()", 20, 350;
}
Path.AddLine( 0, x + 96.0, y1 );
trace "Execute: AddLine()", x + 96.0, y1;
[...]
The trace outputs appear in Log window. Analyse the outputs. Do the outputs confirm, the values are really correct? You can also copy the contents from the Log window and post these in this thread so I can take a look at it.
Regarding the method Begin(), it is intended to set the position for the first point in the path. Please see the documentation Store data in a sub-path. Usually, this method is invoked only at the begining of the path construction. In your application, you invoke the method each time the value x == 0.0. Doing this discards all the previously stored path data. Maybe, this is your problem? Remove the Begin() invocation from the loop and execute it before the loop enters. For example:
// The start position of the path
Path.Begin( 0, x_start, y_start );
// The positions of the following line segments
for ( ... )
{
Path.AddLine( 0, x_next, y_next );
}
I assume, you have a Stroked Path view in your GUI component. And this view is connected with the Path data object. Can you verify this? Without the connection, the view has no knowledge what to show. Furthermore, check the property Offset and FlipY of the Stroked Path view. With these properties you determine the position within the view where the Path Data coordinate x=0.0 and y=0.0 are mapped. If not correctly configured, the path may appear 'outside' of the visible Stroked Path View area.
Does it help you further?
Best regards
Paul Banach