×
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 list reference sets in a part

Journal to list reference sets in a part

Journal to list reference sets in a part

(OP)
Is there any way to create a list of reference sets in a part?

We are in the process of taking ~2000 models from a customer and reformatting them to our standards which requires replacing the existing reference sets with our own along with a few other cleaning operations.  I have been able to automate most of the cleaning operations using a journal file, but as of yet I cannot handle reference sets.  Our current method requires going through each part and manually deleting each refernece set, then adding at least one reference set for the solid.

I have gone though the .net api reference as far as I can follow but cant figure out where to pull a list of reference sets from a part.  I have found how to add and removed them and how to add items to them, but nothing to list them.

referenceSet1 = workPart.CreateReferenceSet()
referenceSet1.SetName("model")
referenceSet1.AddObjectsToReferenceSet(components1)
workPart.DeleteReferenceSet(referenceSet1)

Any suggestions would be gratefully appreciated.

UG NX 6.0.4.3

RE: Journal to list reference sets in a part

Make sure the Reference Set column is enabled in the Assembly Navigator and then export it to the Spreadsheet.  

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Journal to list reference sets in a part

(OP)
This is being done on the detail level, not the assembly.  The assemblies that they feed into currently use various reference sets or entire part and we will be replacing them all to use a single model reference set.

Is there a way to list each reference set in a detail part or just delete all existing ones, which our ultimate goal?

UG NX 6.0.4.3

RE: Journal to list reference sets in a part

Attached are two programs.  The first is a c program which was created some time ago (ChangeReferenceSets.c)  I have compiled it for NX7.5.  It has been compiled and signed to run as executing a NXOpen program.  It allows you to change all components reference set to either model or empty.  If this is along the lines of what you are looking for I can rewrite it using a .NET language.  You can decide if you wanted a different reference set (such as lightweight) also included.

The second program simply reports the reference sets for all components.  This has been written more recently and is in VB.  I have also compiled it and signed it.

Frank Swinkels

RE: Journal to list reference sets in a part

(OP)
@FrankSwinks

The programs are similar to what I was looking for but from looking at them i found the CycleObjsInPart function which has allowed me to accomplish what I was looking for.  Thanks

Below is what i cam up with:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UF.UFObj
imports nxopen.utilities

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim WorkPart As Part = theSession.Parts.Work
Dim TheUFsession As UFSession = UFSession.GetUFSession()
Dim NULLTAG As Tag = NXOpen.Tag.Null
Dim objectTag As Tag = NXOpen.Tag.Null

theUfSession.Obj.CycleObjsInPart(workpart.Tag, NXOpen.UF.UFConstants.UF_reference_set_type, objectTag)

Do
    
    Dim myrefset As referenceset = Nothing
    Dim myObject As NXObject = Nothing

    myObject = NXObjectManager.Get(objectTag)
    myrefset = CType(myObject, referenceset)

    MsgBox("Name = " & myrefset.name)

    theUfSession.Obj.CycleObjsInPart(workPart.Tag, NXOpen.UF.UFConstants.UF_reference_set_type, objectTag)

    
Loop While objectTag <> NULLTAG

End Sub
End Module

UG NX 6.0.4.3

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