×
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

export bodies into individual files

export bodies into individual files

export bodies into individual files

(OP)
I model using all my pieces as bodies in one file.  I am looking for a way to export each body into individual files that would be named the same as the body name.
I would also like to know if there is a simple way to take this main file and convert it to an assembly.

RE: export bodies into individual files

Quote:

a simple way to take this main file and convert it to an assembly
If you navigate to Assemblies -> Components -> Create New Component, it will allow you to select one of your solid bodies and export it to its own file, then import it back in as a component. Repeat for each solid you wish to make into a component. If you have many solid bodies, it may be worth the time to create a journal to automate this process.

www.nxjournaling.com

RE: export bodies into individual files

This is called the "Top down" method.
You may want to search your NX doc for those two words.

RE: export bodies into individual files

(OP)
thanks for the info.  I would like to get to the bulk version of export.  All the bodies at once.
I was not aware of the "top down" term, I will check it out.
if I write a vb for this, does anyone know how to get it to pull the name from the body property?

RE: export bodies into individual files

Quote:

does anyone know how to get it to pull the name from the body property?
If you have given the solid bodies names, the following journal will display them in the listing window. If the journal indicates it has no name, perhaps you renamed a feature rather than the solid body (if the name shows up in the part navigator, you most likely have renamed a feature).

To display names of entities on screen, go to Preferences -> Visualization -> Names/Borders and select the 'work view' setting for 'object name display'. The name the journal returns will match the name displayed with this setting.

To return the feature name will require a different approach.

CODE

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim lw As ListingWindow = theSession.ListingWindow
Dim mySolidBodies() as Body

lw.Open

lw.WriteLine("Collecting solid bodies...")
mySolidBodies = displayPart.Bodies.ToArray

For each obj as Body in mySolidBodies
    lw.WriteLine("Object Tag: " & obj.Tag)
    if obj.Name = "" then
        lw.WriteLine("Solid Body has no name")
    else
        lw.WriteLine("Name: " & obj.Name)
    end if
    
    lw.WriteLine("")
Next

lw.Close

End Sub

End Module

www.nxjournaling.com

RE: export bodies into individual files

(OP)
thank you for the help, I will give it a try
 

RE: export bodies into individual files

rebel, if you artificially create a DESC attribute in the Part Nav with Timestamp Order = OFF  you may be able to have your generated component to read that name.
I searched for your threads as you had responded to one of mine earlier about Model Size. I did not get an email notification of that response. The thread is now closed, unfortunately.

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