cancel
Showing results for 
Search instead for 
Did you mean: 

NX Snap, Intersection of two lines

Experimenter
Experimenter

Hello everyone,

 

I am currently into re-programming some old NX Open GRIP programms using NX Snap language.

Using GRIP, it was/is possible to compute the intersection of two curves (lines), even if they do not directly touch each other.

 

Intersect.PNG

Is there a convienient way using NX SNAP to manage this? Or do i have to use NX Open functions? If so, which functions do i have to use?

 

Or do I even have to calculate the Intersections myself?

 

Thanks,

 

Erwin

2 REPLIES

Re: NX Snap, Intersection of two lines

Siemens Phenom Siemens Phenom
Siemens Phenom

SNAP will allow you to find the intersection, even if the lines do not touch.  FOr example:

Imports Snap, Snap.Create

Public Class MyProgram

Public Shared Sub Main()
Dim line1 As NX.Line = Line(0, 0, 0, 100, 0, 0)
Dim line2 As NX.Line = Line(150, -25, 0, 150, 25, 0)

Dim nearPoint As New Position(125, 0, 0)

' Get intersection point
Dim point As Position? = Compute.Intersect(line1, line2, nearPoint)

InfoWindow.WriteLine("Intersect Position : " & point.Value.ToString())

End Sub

End Class

 

The output looks like this:

 

Intersect Position : ( 150 , 0 , 0 )

Re: NX Snap, Intersection of two lines

Experimenter
Experimenter

Thank you very much

 

I missinterpreted the "Near Point" functionality by thinking it "filters" multiple intersections to only show the intersection closest to the given point.

I did not notice it also allows these intersections