Journal function don't do what documentation say.
Journal function don't do what documentation say.
(OP)
Hi
This is a revised journal (journal from this forum)
I added these 2 lines
Dim File,Window As ListingWindow.DeviceType
lw.SelectDevice(File, "C:\vita_vme_std\Export\cloning_log.txt")
but the cloning log don't go to the file
instead it still go to the information window.
Can someone give a clue, what wrong.
Thanks in advanced.
This is a revised journal (journal from this forum)
I added these 2 lines
Dim File,Window As ListingWindow.DeviceType
lw.SelectDevice(File, "C:\vita_vme_std\Export\cloning_log.txt")
but the cloning log don't go to the file
instead it still go to the information window.
Can someone give a clue, what wrong.
Thanks in advanced.
CODE -->
'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:
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 File,Window As ListingWindow.DeviceType
lw.SelectDevice(File, "C:\vita_vme_std\Export\cloning_log.txt")
Dim cloner As NXOpen.UF.UFClone = theUFS.Clone
cloner.Terminate()
cloner.Initialise(NXOpen.UF.UFClone.OperationClass.CloneOperation)
cloner.SetDefNaming(UFClone.NamingTechnique.NamingRule)
cloner.SetDefDirectory("C:\vita_vme_std\Export\\Export")
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 




RE: Journal function don't do what documentation say.
CODE
'use listing window to write to file and window lw.SelectDevice(ListingWindow.DeviceType.FileAndWindow, outputFile) lw.Open() 'write information to listing window lw.WriteLine("full path: " & workPart.FullPath) lw.WriteLine(New String("-", ("full path: " & workPart.FullPath).Length)) lw.WriteLine("file name: " & fileName) lw.WriteLine("file name w/o extension: " & fileNameNoExt) lw.WriteLine("parent folder: " & parentFolder) lw.WriteLine("root folder: " & root) lw.WriteLine("") lw.Close() 'flush file buffer by changing listing window device lw.SelectDevice(ListingWindow.DeviceType.Window, "")You can find the above code and some more explanation in the article here.
www.nxjournaling.com
RE: Journal function don't do what documentation say.
lw.open() and the flush command
to my journal will amended the journal.
RE: Journal function don't do what documentation say.
lw.open() and the flush command
to my journal will repairs the journal.
RE: Journal function don't do what documentation say.
Also note that some operations (such as cloning) may ignore your settings and do what they want. Below are a couple of threads from the Siemens programming forum:
https://community.plm.automation.siemens.com/t5/NX...
https://community.plm.automation.siemens.com/t5/NX...
www.nxjournaling.com
RE: Journal function don't do what documentation say.
Maybe I need to live with those pop up cloning reports.