×
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

Journal to delete reference set

Journal to delete reference set

Journal to delete reference set

(OP)
Hi,
I've imported a step of a board and NX ha generated a reference set for each body imported 4200.
I want to delete all this reference set.
I don't know a OOTB command in NX, so a simple journal to clean those unwanted reference set.

Thank you,

Thank you...

Using NX 8 and TC9.1

RE: Journal to delete reference set

Cubalibre00,

I can't take credit for this ...

CODE --> (journal)

'This journal cycles through a part and deletes all reference sets
'
'It assumes that you have already loaded the part.

Option Strict Off
Imports System
Imports System.Collections
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.UF


Module Delete_All_RefSets_in_part
Sub Main
  Dim s As Session = Session.GetSession()
  Dim ufs As UFSession = UFSession.GetUFSession()
  
  Dim part As Part = s.Parts.Work

  Dim refset As Tag = Tag.Null
  Dim list As ArrayList = New ArrayList
''Dim compList = New List(of NXOpen.Assemblies.Component)()

  Do
     ufs.Obj.CycleObjsInPart(part.Tag,UFConstants.UF_reference_set_type,refset)
     If refset <> Tag.Null Then
        Dim name As String
        ufs.Obj.AskName(refset, name)
        If name <> "Empty" Then
           list.Add(refset)
        End If
     End If
  Loop While refset <> Tag.Null
  For Each refset In list
      ufs.Obj.DeleteObject(refset)
  Next
  MessageBox.Show("Deleted " & list.Count & " reference sets")

End Sub
End Module 

HTH, Joe

RE: Journal to delete reference set

(OP)
Joe,
this journal works very well.
Deleted 4200 reference sets.

Thank you a lot.

Thank you...

Using NX 8 and TC9.1

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