lklo
Industrial
- Nov 24, 2010
- 226
Hi -
Have anyone here tried to figure out - if it should be possible to "extract" the file size of current workpart in NX > managed mode?
looking for this possibility - either to do it in VB.NET or Knowledge Fusion....
But seem's like I have some challenges regarding finding some classes of functions.
Tried look into NXOpen.PDM Namespace and UFUgmgr Class - without finding some interesting.
I did succeed in a nx native environment - see code snippet .
But how to do this in a nx-teamcenter session ??
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim workPart As Part = theSession.Parts.Work
dim currentFilePath as string = workpart.fullpath
Dim infoReader As System.IO.FileInfo
infoReader = My.Computer.FileSystem.GetFileInfo(currentFilePath)
MsgBox("File is " & (((infoReader.Length)/1024)) & " KB.")
End Sub
End Module
regards lklo
Have anyone here tried to figure out - if it should be possible to "extract" the file size of current workpart in NX > managed mode?
looking for this possibility - either to do it in VB.NET or Knowledge Fusion....
But seem's like I have some challenges regarding finding some classes of functions.
Tried look into NXOpen.PDM Namespace and UFUgmgr Class - without finding some interesting.
I did succeed in a nx native environment - see code snippet .
But how to do this in a nx-teamcenter session ??
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim workPart As Part = theSession.Parts.Work
dim currentFilePath as string = workpart.fullpath
Dim infoReader As System.IO.FileInfo
infoReader = My.Computer.FileSystem.GetFileInfo(currentFilePath)
MsgBox("File is " & (((infoReader.Length)/1024)) & " KB.")
End Sub
End Module
regards lklo