Showing results for 
Search instead for 
Did you mean: 

Creating Multiple Parts from Multiple Bodies


Hello - I have a problem that I can't figure out how to resolve in an easy fashion and am looking for some help.  I'm trying to create multiple new parts from multiple bodies, but don't want to click "create new part" individually, I'm looking to do it in batch form to save time.  Is there a way to do this easily?




Re: Creating Multiple Parts from Multiple Bodies


hi instead of 'create new part' you can use File->Export->Part


this is faster way but still you have to select the bodies individually


Re: Creating Multiple Parts from Multiple Bodies

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Can this be journaled?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

Re: Creating Multiple Parts from Multiple Bodies

Siemens Phenom Siemens Phenom
Siemens Phenom

I had an old journal progam here. It creates a part file for each displayed body.


'Select all the displayed bodies and for each create a new component with a filename starting from 1 to N

Imports NXOpen
Imports NXOpenUI
Imports NXOpen.uf
Module ugs
    Dim s As Session = Session.GetSession
    Dim theui As UI = UI.GetUI
    Dim wp As Part = s.Parts.Work
    Dim ufs As UFSession = UFSession.GetUFSession
    Sub Main()
        Dim fenetre As ListingWindow = s.ListingWindow
        Dim nb_entite As Integer = 0
        Dim origine(2) As Double
        Dim matrice(5) As Double
        Dim entite(0) As Tag
        Dim retour As Tag
        origine(0) = 0 : origine(1) = 0 : origine(2) = 0
        matrice(0) = 1 : matrice(1) = 0 : matrice(2) = 0
        matrice(3) = 0 : matrice(4) = 1 : matrice(5) = 0
        For Each obj As DisplayableObject In s.Parts.Work.Bodies
            entite(0) = obj.Tag
            nb_entite = nb_entite + 1
            ufs.Assem.CreateComponentPart(wp.Tag, Str(nb_entite), "MODELE", _
                                            Str(nb_entite), 1, 0, origine, matrice, 1, entite, retour)
    End Sub
    Public Function GetUnloadOption() As Integer
        Return Session.LibraryUnloadOption.Immediately
    End Function
End Module