mnash60
Materials
- Feb 21, 2012
- 29
In this piece of code the output file goes to the folder where the .prt file is located.
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim outputPath As String = IO.Path.GetDirectoryName(workPart.FullPath)
Dim outputFile As String = IO.Path.GetFileNameWithoutExtension(workPart.FullPath)
outputFile = IO.Path.Combine(outputPath, outputFile & "MatingSurf")
I have been trying to do two things with no luck.
First, instead of the same folder I need to go back to a certain folder in the root folder.
N:\CAD Data\DATA\dwr12324\Step Data Release\Release CAD Is where the .prt file is located
N:\CAD Data\DATA\dwr12324\Step Data Release\Mating Surfaces Is where the .prt file is located
In excel I know that I can use the left string to rename the folder detestation but it seems not to work with UG.
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim outputPath As String = IO.Path.GetDirectoryName(workPart.FullPath)
Dim outputFile As String = IO.Path.GetFileNameWithoutExtension(workPart.FullPath)
outputFile = IO.Path.Combine(outputPath, outputFile & "MatingSurf")
I have been trying to do two things with no luck.
First, instead of the same folder I need to go back to a certain folder in the root folder.
N:\CAD Data\DATA\dwr12324\Step Data Release\Release CAD Is where the .prt file is located
N:\CAD Data\DATA\dwr12324\Step Data Release\Mating Surfaces Is where the .prt file is located
In excel I know that I can use the left string to rename the folder detestation but it seems not to work with UG.