shan89
Automotive
- Dec 14, 2012
- 19
Hi,
I need a journal to save as assembly files in IGES format in the working directory itself.
I tried to create one looking at some existing journals, but unable to complete my journal. I know nothing about computer languages, so I could be wrong at many or all points.
*************
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim fileName As String = IO.Path.GetFileName(workPart.FullPath)
Dim fileNameNoExt As String = IO.Path.GetFileNameWithoutExtension(workPart.FullPath)
Dim parentFolder As String = IO.Path.GetDirectoryName(workPart.FullPath)
Dim root As String = IO.Path.GetPathRoot(workPart.FullPath)
Dim thepath As String = "fileNameNoExt: "
Dim PartExt As String = ".igs"
Dim displayPart As Part = theSession.Parts.Display
Dim partSaveStatus1 As PartSaveStatus
Try
partSaveStatus1 = workPart.SaveAs(thePath+displayPart.Leaf+PartExt)
partSaveStatus1.Dispose()
Catch ex As Exception
End Try
End Sub
End Module
**************
However after running this journal, no error came but no file was created as well.
Thanks in advance,
Ishant
I need a journal to save as assembly files in IGES format in the working directory itself.
I tried to create one looking at some existing journals, but unable to complete my journal. I know nothing about computer languages, so I could be wrong at many or all points.
*************
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim fileName As String = IO.Path.GetFileName(workPart.FullPath)
Dim fileNameNoExt As String = IO.Path.GetFileNameWithoutExtension(workPart.FullPath)
Dim parentFolder As String = IO.Path.GetDirectoryName(workPart.FullPath)
Dim root As String = IO.Path.GetPathRoot(workPart.FullPath)
Dim thepath As String = "fileNameNoExt: "
Dim PartExt As String = ".igs"
Dim displayPart As Part = theSession.Parts.Display
Dim partSaveStatus1 As PartSaveStatus
Try
partSaveStatus1 = workPart.SaveAs(thePath+displayPart.Leaf+PartExt)
partSaveStatus1.Dispose()
Catch ex As Exception
End Try
End Sub
End Module
**************
However after running this journal, no error came but no file was created as well.
Thanks in advance,
Ishant