Splicing Into Link - Attach to Spliced Node Ports

When splicing my objects into a link I would like them to link to a port instead of to the entire node. My initial thought is to have the linking go as normal to generate the list of points, and then link to the port that is closest to that location. How can I determine the location of my ports? or is there a better way to do this?


Are you sure that you want to use ports at all? Ports are normally used to provide logical as well as physical distinctions. Trying to connect to the nearest port sounds like there really isn’t any difference between them.

But if you want to, you can iterate over the Node.Ports and find the one whose Part.GetElementPoint is most desirable.

The main reasons I am using ports is because some of our objects need specific connection points and the links to those ports need to stay connected there. At the same time I need to limit the number of links per port (to 1) and in the case that I have a link to a port and a link to the node, I can move the node to make it appear that I have 2 links coming out of the same port (which I do not want).

Anyways, I’ll check out the GetElementPoint. Thanks.