×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Obtain Point Reference Number

Obtain Point Reference Number

Obtain Point Reference Number

(OP)
thread561-276765: Created Leaders using journal

When you use the feature Information->Object-> and you select a point you're able to see the reference name for the point, i.e. Point(1) or Point (2) depending on when it was created.  Is there a way to retrieve this property in a Journal.

RE: Obtain Point Reference Number

Here is a simple journal that demonstrates getting point feature names.

Option Strict Off
Imports System
Imports NXOpen

Module pointfeatname
    Sub Main()

        Dim s As Session = Session.GetSession()
        Dim lw As ListingWindow = s.ListingWindow
        Dim workPart As Part = s.Parts.Work
        Dim pcol As PointCollection = workPart.Points
        Dim fcol As Features.FeatureCollection = workPart.Features
        Dim feat1 As Features.Feature
        Dim featname1 As String = Nothing
        If pcol.ToArray().Length = 0 Then
            lw.Open()
            lw.WriteLine("No Points found. Exit.")
            Return
        End If

        For Each pt As Point In pcol
            feat1 = fcol.GetAssociatedFeature(pt)
            featname1 = feat1.GetFeatureName.ToString
            If featname1.Substring(0, 5) = "Point" Then
                MsgBox(featname1)
            End If
        Next

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

    End Function

End Module

Regards

Frank Swinkels

RE: Obtain Point Reference Number

(OP)
That works perfectly! Thanks so much for your help.

-nathangaldamez

RE: Obtain Point Reference Number

(OP)
Frank,

How would translate this code to give me Ruled Surfaces instead of Points.

Thanks,

Nathan

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources