UGMasters
Automotive
- Jan 22, 2008
- 51
Good morning Gents,
I need help to fix this code.
Every time I run this Journal,it replces the old .JPG (NX_screenshot.jpg)
I like to see all the snap shots saved with different names
NX_screenshot-1.jpg,
NX_screenshot-2.jpg etc
any help is appreciated.
Regards
Girish.
****************************************************************************************************************
'Journal created for taking screen shot pictures with white background in meetings
Option Strict Off
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.UF
Module Module1
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Sub Main()
If IsNothing(theSession.Parts.BaseWork) Then
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
'Saving location
ExportScreenshot("C:\Temp\NX_screenshot.jpg")
lw.Close()
End Sub
Sub ExportScreenshot(ByVal filename As String)
Dim wcsVisible As Boolean = theSession.Parts.Display.WCS.Visibility
Dim triadVisible As Integer = theSession.Preferences.ScreenVisualization.TriadVisibility
Try
DeleteFile(filename)
theUfSession.Disp.CreateImage(filename, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)
Catch ex As Exception
MsgBox(ex.Message & ControlChars.NewLine & _
"'" & filename & "' could not be created")
*******************************************************************************************************************************
I need help to fix this code.
Every time I run this Journal,it replces the old .JPG (NX_screenshot.jpg)
I like to see all the snap shots saved with different names
NX_screenshot-1.jpg,
NX_screenshot-2.jpg etc
any help is appreciated.
Regards
Girish.
****************************************************************************************************************
'Journal created for taking screen shot pictures with white background in meetings
Option Strict Off
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.UF
Module Module1
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Sub Main()
If IsNothing(theSession.Parts.BaseWork) Then
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
'Saving location
ExportScreenshot("C:\Temp\NX_screenshot.jpg")
lw.Close()
End Sub
Sub ExportScreenshot(ByVal filename As String)
Dim wcsVisible As Boolean = theSession.Parts.Display.WCS.Visibility
Dim triadVisible As Integer = theSession.Preferences.ScreenVisualization.TriadVisibility
Try
DeleteFile(filename)
theUfSession.Disp.CreateImage(filename, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)
Catch ex As Exception
MsgBox(ex.Message & ControlChars.NewLine & _
"'" & filename & "' could not be created")
*******************************************************************************************************************************