Hello @gopinathmY575P,
Writing such script can go from really easy to hard depending the case. For instance, first question would be : Are the two circles on the same elevation ? If yes, we can simply create two lines, calculate the point where they cross, connect them and add a simple perpendicular constraint. If not, we have to add a third line to compensate the elevation, and this complexifies the calculus for the connexions. Next on would be the starting situation rotation. Here in the provided example we can see the parts looks perpendicular, and looks like they follow the XYZ corrdinate (meaning we can constraint the line to an existing axis to be parallel). But what if there is a 16.72156454 rotation of the parts on the Z axis ? Then we could not add the constraints as easily since there is no parallel reference (though we could use the part's reference axis if the hole is perpendicular for one of those, but what if not?). Often those sorts of code are designed for "all stars aligned" situations, but in actual reality (from my experience), the situations are often more complex that it seems, thus causing harm since taking such short cuts makes the scrit realy sensitive.
What you are really asking in the end is some sort of piping sofware. Why not use the one provided in Inventor? (Tube & pipes). Developping such code cost time & thus money, then also complexifies the process since there is now code to maintain & learn if you leave the job. Why can't we go for tube & pipe ?
Could you please be more clear in what you are trying to achieve.
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"@LinkedIn @JohnCockerill