Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

file size of nx partfile > native & teamcenter

Status
Not open for further replies.

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
 
Replies continue below

Recommended for you

Why on earth do you want to do this ?!?

I assume that you know that you can see the file size if you use "Named References" on the NX dataset in Teamcenter. ?


Regards,
Tomas

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor