×
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

How to Get ObjectsHandler(NX Open) or Tags(Ufunc) of Objects created using Instance Geometry

How to Get ObjectsHandler(NX Open) or Tags(Ufunc) of Objects created using Instance Geometry

How to Get ObjectsHandler(NX Open) or Tags(Ufunc) of Objects created using Instance Geometry

(OP)
Hi All,
I have created a Plane and then Instanced it Using GeomCopyBuilder class, now I want to get the Object Handler or Tags for the newly created Datum Planes. I have tried using GetBodies, Get Entities but it's not giving me anything...any help is appreciated...

RE: How to Get ObjectsHandler(NX Open) or Tags(Ufunc) of Objects created using Instance Geometry

Here is a bit of a round about method that might give you some ideas. Run this journal on an open part file, it will report all the features. Instanced features will have an asterisk in front and the tag will be reported.

CODE

Option Strict Off
Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim workPart As Part = theSession.Parts.Work

        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        Dim featArray() As Features.Feature = theSession.Parts.Work.Features.GetFeatures()
        Dim previousTimestamp As Integer = -1

        lw.WriteLine("*** All Features ***")
        For Each myFeature As Features.Feature In featArray
            lw.WriteLine("name: " & myFeature.GetFeatureName)
            lw.WriteLine("type: " & myFeature.FeatureType)
            lw.WriteLine("timestamp: " & myFeature.Timestamp)

            If myFeature.Timestamp = previousTimestamp Then
                If myFeature.FeatureType.ToString.ToUpper <> "CONTAINER" Then
                    lw.WriteLine("* instance feature tag: " & myFeature.Tag.ToString)
                End If
            End If

            previousTimestamp = myFeature.Timestamp

            lw.WriteLine("")
        Next
        lw.Close()


    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

    End Function

End Module 

www.nxjournaling.com

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