Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

is cloning supported by journals 1

Status
Not open for further replies.

multicaduser

Industrial
Jan 29, 2013
261
In recording a journal of a cloning operation none of the functions showed up. The work around so far has been to record and edit a macro of the operation.

The obvious goal is to automate a process, but I don't want to update macros every time NX is updated to a new version.

Since a quick search turned up no useful results, can anyone tell me if cloning is supported by the journal functions?

NX10.0.0.24 MP1/Windows 7 Service Pack 1
 
Replies continue below

Recommended for you

Not that i know of, our solution was to automate the creation of clone log files according to our needs (rules which specify what should be retained and what should be cloned) which means that we can run customized cloning operations from within NX via assembly clone or out side of NX via the command line.
 
As a long time user I remember talk about log files and part creation but never tried it. Sounds like something to try, thanks for the hint.

NX10.0.0.24 MP1/Windows 7 Service Pack 1
 
I don't think that cloning is supported by the journal recorder, but there are API functions for clone operations; it should be possible to use these in a custom journal. In the GTAC solution center there is a Java program that performs a clone operation, search for "clone rename displayed part only" or "nx_api4470". Perhaps it will serve to show the function calls required.

www.nxjournaling.com
 
As Petulf says, I think the best method is to run a logfile in "reverse".

I. e When you run a clone operation , you will get a logfile.
Take a copy of this and you can modify the names / numbers etc as long as you follow the same syntax.
Then when you are ready , open the clone tool, -Logfiles - Load and apply existing logfile.

If you work under Teamcenter, there is a similar function there.

Regards,
Tomas
 
Hi a984928

Thanks for the links. It's good that any language can be translated through google these days. The German posting looks interesting.

NX10.0.0.24 MP1/Windows 7 Service Pack 1
 
By the way the native version journal that I posted
in the previous post is adequate to your need
not to select family members because you select
the components to clone so you can select only
components that are not a family members.
 
Here is a basic code snippet that will add the current displayed assembly to the clone process, apply a naming rule (in this case adding "-" to the end of every component), and define the output folder:

Code:
Option Strict Off
Imports System
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.Assemblies
Imports NXOpenUI
Imports NXOpenUI.FormUtilities
Imports NXOpen.UF

Module Module1
Public Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theUISession As UI = UI.GetUI
        Dim workPart As Part = theSession.Parts.Work
        Dim displayPart As Part = theSession.Parts.Display
        Dim theUFS As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession()
        Dim lw As ListingWindow = theSession.ListingWindow
        Dim Current_Assembly As String = displayPart.FullPath

Dim cloner As NXOpen.UF.UFClone = theUFS.Clone
        cloner.Initialise(NXOpen.UF.UFClone.OperationClass.CloneOperation)
        cloner.SetDefNaming(UFClone.NamingTechnique.NamingRule)
        cloner.SetDefDirectory("C:\users\Designer\")
        cloner.AddAssembly(Current_Assembly, Nothing)

        Dim opt As NXOpen.UF.UFClone.ExLogOpts
        opt.allow_missing_components = False

        Dim namerule1 As NXOpen.UF.UFClone.NameRuleDef
        namerule1.type = UFClone.NameRuleType.AppendString
        namerule1.new_string = "-"

        cloner.SetNameRule(namerule1, Nothing)
        cloner.SetDryrun(False)
        cloner.PerformClone(Nothing)
        cloner.Terminate()
End Sub
 Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

    End Function

End Module
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor