Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

KushWadhwani123

Mechanical
Aug 5, 2013
2
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...
 
Replies continue below

Recommended for you

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor