RuudvdBrand
Computer
- Aug 6, 2012
- 34
Dear all,
i have a question about a journal that i have found.
I want to place the file location into a part attribute.
this so i can use this attribute to controle a ug_excel_read expression.
This part is changed from location when there is a save as action been done.
now i can created with the journal the complet filepath but i want to cut off the .prt
how can help me with this.
Below the script.
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Module NXJurnal
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Sub Main
workPart.SetAttribute("File_Path", GetFilePath())
Dim user_name As String = System.Environment.ExpandEnvironmentVariables("%username%")
workPart.SetAttribute("Name", user_name)
End Sub
'***********************************************************************
Function GetFilePath()
Dim strPath as String
Dim strPart as String
Dim pos as Integer
'get the full file path
strPath = displayPart.fullpath
GetFilePath = strPath
End Function
End Module
already thanks
Ruud
i have a question about a journal that i have found.
I want to place the file location into a part attribute.
this so i can use this attribute to controle a ug_excel_read expression.
This part is changed from location when there is a save as action been done.
now i can created with the journal the complet filepath but i want to cut off the .prt
how can help me with this.
Below the script.
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Module NXJurnal
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Sub Main
workPart.SetAttribute("File_Path", GetFilePath())
Dim user_name As String = System.Environment.ExpandEnvironmentVariables("%username%")
workPart.SetAttribute("Name", user_name)
End Sub
'***********************************************************************
Function GetFilePath()
Dim strPath as String
Dim strPart as String
Dim pos as Integer
'get the full file path
strPath = displayPart.fullpath
GetFilePath = strPath
End Function
End Module
already thanks
Ruud