Ehaviv
Computer
- Jul 2, 2003
- 1,012
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