Profile Picture

NLogicalLinePort GlueToContour Issue

Posted By Igor Yakubov 15 Years Ago
Author
Message
Igor Yakubov
questionmark Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 7, Visits: 1

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.



Ivo Milanov
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 35, Visits: 15
Hi Igor,

It is not a built in behavior, but I have sent a personal email to you with the code of the related ports.
You should be having problems merging them to create a custom one.

Best regards,
Ivo

Igor Yakubov
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 7, Visits: 1

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



Ivo Milanov
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 35, Visits: 15

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





Similar Topics


Reading This Topic