turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Siemens PLM Community
- NX Customization and Programming
- NX Programming & Customization Forum
- Create a line at Minimum distance b/w 2 splines

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-05-2015 01:49 AM

Hi All;

I Need to create a line at the point which measures minimum distance between 2 splines;

So i have choose to use measureDistance builder in measureDistanceBuilder1.AnnotationMode = NXOpen.MeasureBuilder.AnnotationType.CreateLine;

But how do i get the points to create a line at minimum distance?

Any Help!

Thanks FL;

Solved! Go to Solution.

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-05-2015 12:32 PM

I had a quick look at the documentation for the measureDistanceBuilder object. The point information is probably buried somewhere within its properties, but it sure wasn't obvious where.

You could make use of one of the AskMinimumDist functions (UF.Modl. AskMinimumDist, .AskMinimumDist2, or .AskMinimumDist3); these functions readily give up the "point on object" information.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-08-2015 09:16 PM

It's easy using the SNAP ClosestPoints function

Dim s1 = <some spline> Dim s2 = <some other spline> Dim result As Snap.Compute.DistanceResult = Snap.Compute.ClosestPoints(s1, s2) Dim p1 As Position = result.Point1 Dim p2 As Position = result.Point2 Snap.Create.Line(p1, p2)

Without SNAP, the easiest approach is to use NXOpen.UF.Modl.AskMinimumDist3, as Cowski suggested:

Dim ufs As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession Dim workPart As NXOpen.Part = NXOpen.Session.GetSession.Parts.Work Dim s1 As NXOpen.Spline = <some spline> Dim s2 As NXOpen.Spline = <some other spline> Dim opt = 2 Dim noGuess As Integer = 0 Dim guessPt As Double() = Nothing Dim dist As Double Dim p1(2) As double Dim p2(2) As Double Dim accuracy As Double ufs.Modl.AskMinimumDist3(opt, s1.Tag, s2.Tag, noGuess, guessPt, noGuess, guessPt, dist, p1, p2, accuracy) Dim pt1 As New NXOpen.Point3d(p1(0), p1(1), p1(2)) Dim pt2 As New NXOpen.Point3d(p2(0), p2(1), p2(2)) workPart.Curves.CreateLine(pt1, pt2)

yamada

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc