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!

select by entering tag number or entity number ? 4

Status
Not open for further replies.

Toost

Mechanical
Jan 18, 2011
2,963
I dont know if this has been up before or not. Difficult to search .

anyhow, i can read in my NX logfile that either :
"entity[58611] blablabla"
or
"blablabla body (tag: 39539)"
has something wrong .

something is obviously wrong with entity xx or tag yy
now i am curious on which these objects are, can i somehow select entity [58611] or body (tag: 39539)to see which object it is ?

In this particular case i suspect either directly imported solids, or wave linked imported bodies.
one of the messages i receive is "ZERO MASS BODY encountered during weight calculation".

In reverse, if i select a solid body ( select using quick pick, then last line "solid body" and then Ctrl+I, NX will report the tag number.
But, i have some +7500 bodies in this assembly...

Regards,
Tomas


 
Replies continue below

Recommended for you

Tags are internal identifiers used by NX to keep track of the various objects in the part file.

The journal below will allow you to enter a tag number and it will report the object type, the object layer, and it will zoom in on the object. The object will not be selected, but there is a line of code that you can un-comment to highlight the object. The highlighting will probably stay until you use part cleanup to "remove extraneous highlighting". Entering random numbers probably won't end well...

Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

    Dim theSession As Session = Session.GetSession()
    Dim theUfSession As UFSession = UFSession.GetUFSession()

    Dim theUI As UI = UI.GetUI()
    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()

        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "NXJ")

        lw.Open()

        Dim myTag As Integer
        Dim answer As String = ""

        'loop until there is valid input
        Do
            answer = NXOpenUI.NXInputBox.GetInputString("Enter an integer tag number", "Tag?", " ")
            'if cancel is pressed, exit sub
            If answer = "" Then Exit Sub
        Loop Until Integer.TryParse(answer, myTag)

        lw.WriteLine("entered tag: " & myTag.ToString)

        Dim myObj As DisplayableObject
        Try
            myObj = Utilities.NXObjectManager.Get(myTag)
        Catch ex As NXException
            lw.WriteLine("NX error: " & ex.Message)
            Return
        Catch ex As Exception
            lw.WriteLine("error: " & ex.Message)
            Return
        End Try

        myObj.Unblank()

        Dim stateArray1(0) As Layer.StateInfo
        If (myObj.Layer <> 0) And (myObj.Layer <> theSession.Parts.Work.Layers.WorkLayer) Then
            stateArray1(0).Layer = myObj.Layer
            stateArray1(0).State = Layer.State.Selectable
            theSession.Parts.Work.Layers.ChangeStates(stateArray1, True)
        End If

        lw.WriteLine("object type: " & myObj.GetType.ToString)
        lw.WriteLine("layer: " & myObj.Layer.ToString)
        theSession.Parts.Work.ModelingViews.WorkView.FitToObjects({myObj})
        'myObj.Highlight()

        lw.Close()

    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

www.nxjournaling.com
 
Cowski my friend, again you save me !

This is wonderful. I can now find the foul objects.


Thanks,
Tomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor