Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Last line segments are not drawn (Read 3629 times)
fglazenburg
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Jul 1st, 2008
Last line segments are not drawn
Aug 21st, 2008 at 1:30pm
Print Post  
Hey,

When i manually insert control points into the diagramlinks control point collection, the last line segments are not drawn.

I use the following code to insert the controlpoint:

DataRow[] cpRows = dr.GetChildRows("REL_PROCESS_STEP_PROCESS_STEP_CONTROL_POINT");

if (cpRows.Count() > 0)
{
processStep.ControlPoints.Clear();

foreach (DataRow cpRow in dr.GetChildRows("REL_PROCESS_STEP_PROCESS_STEP_CONTROL_POINT"))
{
processStep.ControlPoints.Add(
new System.Drawing.PointF(Convert.ToSingle(cpRow["X_COORDINATE"]), Convert.ToSingle(cpRow["Y_COORDINATE"])));
}
}

addProcessStep(processStep);

diagram.Selection.Links.Add(processStep);

processStep.UpdateFromPoints();


Image:




Anybody familiar with this issue?

Thanks in advance!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Last line segments are not drawn
Reply #1 - Aug 21st, 2008 at 4:08pm
Print Post  
Hi,

Set processStep.SegmentCount to the number of points - 1 before calling Clear and adding the points.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
fglazenburg
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Jul 1st, 2008
Re: Last line segments are not drawn
Reply #2 - Aug 22nd, 2008 at 7:38am
Print Post  
I tried to set it before the clearing and the insert of the new control point, but it doesn't help.

Diagram.dirty = true doesn't bring any help either.

Any other suggestions?

Thanks in advance!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Last line segments are not drawn
Reply #3 - Aug 22nd, 2008 at 8:58am
Print Post  
have you set

processStep.SegmentCount = cpRows.Count() - 1;

?
  
Back to top
 
IP Logged
 
fglazenburg
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Jul 1st, 2008
Re: Last line segments are not drawn
Reply #4 - Aug 22nd, 2008 at 9:15am
Print Post  
Hey,

I got it. Setting processtep.autoroute to false did the trick.

My final code look like this:

if (cpRows.Count() > 0)
{
processStep.AutoRoute = false;
processStep.SegmentCount = System.Convert.ToInt16(cpRows.Count() - 1);

processStep.ControlPoints.Clear();

//processStep.AutoRoute = true;


foreach (DataRow cpRow in dr.GetChildRows("REL_PROCESS_STEP_PROCESS_STEP_CONTROL_POINT"))
{
processStep.ControlPoints.Add(
new System.Drawing.PointF(Convert.ToSingle(cpRow["X_COORDINATE"]), Convert.ToSingle(cpRow["Y_COORDINATE"])));
}
}

addProcessStep(processStep);

diagram.Selection.Links.Add(processStep);


diagram.Selection.Clear();



Thanks for the support!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint