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.
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
www.nxjournaling.com
RE: export bodies into individual files
You may want to search your NX doc for those two words.
RE: export bodies into individual files
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
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
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
RE: export bodies into individual files
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.