×
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

select by entering tag number or entity number ?
2

select by entering tag number or entity number ?

select by entering tag number or entity number ?

(OP)
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


RE: select by entering tag number or entity number ?

2
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

RE: select by entering tag number or entity number ?

(OP)
Cowski my friend, again you save me !

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


Thanks,
Tomas

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