Hi Igor,
The nearest point in general can be found using the NPointFList.GetNearestPoint method. It takes a list of points and returns the point that is nearest to a specified point. You can create a list of the port locations like this:
List<NPointF> points = new List<NPointF>(); for (int i = shape.Ports.ChildrenCount - 1; i >= 0; i--)
{
NPort port = (NPort)shape.GetChildAt(i);
points.Add(port.Location);
}
If you are connecting a plug then you can use this technique to get the the nearest port to the plug location.
Best regards,
Ivo
Thanks a lot!
I have another one question about ports.
When i want to connect one shape to another that have more then one port, how can i find out the nearest port to the shape that i want to connect?
Best Regards
Igor Yakubov
Hi,
I need to be able to set GlueToContour to port of type NLogicalLinePort.
Is it possible to add GlueMode property to NLogicalLinePort like in case of NDynamicPort?
If so how can i achieve this?
Thanks.